Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add parameter to set (pass on) the hyphenation language #312

Open
salim-b opened this issue Oct 14, 2017 · 3 comments
Open

add parameter to set (pass on) the hyphenation language #312

salim-b opened this issue Oct 14, 2017 · 3 comments

Comments

@salim-b
Copy link

salim-b commented Oct 14, 2017

Since I'm mostly writing stuff in German and the hyphenation function which pander uses under the hood already supports a bunch of languages including German, I'd like to have an option to change the current hard-coded value of 'en.us'.

The relevant code seems to be this line of helpers.R:

koRpus::hyphen(s, hyph.pattern = 'en.us', quiet = TRUE)@hyphen[1, 2]

If I'm right, we just need to be able to set hyph.pattern directly in pandoc.table (and maybe other relevant pander functions, I don't know) and pass that argument on to koRpus::hyphen(). Of course, 'en.us' could still be the default.

According to the package documentation the following languages are currently supported out of the box:

  • "de" — German (new spelling, since 1996)
  • "de.old" — German (old spelling, 1901–1996)
  • "en" — English (UK)
  • "en.us" — English (US)
  • "es" — Spanish
  • "fr" — French
  • "it" — Italian
  • "ru" — Russian

So a lot of non-english speaking people would benefit of this addition 🙂 What do you think?

@daroczig
Copy link
Member

Sure, we should parametrize the language for koRpus and maybe it will be useful at some other parts of pander as well (eg decimal mark defaults in the future, but let's not turn this into something complicated).

I think we should add a new field in panderOptions -- I won't be able to actively work on this in the near future, but would be happy to review and merge a related PR

@salim-b
Copy link
Author

salim-b commented Oct 14, 2017

I won't be able to actively work on this in the near future, but would be happy to review and merge a related PR

Ok, I see. Actually I'd like to contribute, but haven't developed R packages before. So I'd need some time to get started (and get familiar with pander's internals). At the moment I won't have time for this either, but hopefully that might change towards the end of the year... 😬

@daroczig
Copy link
Member

FTR it seems that hyphenation is being moved out of koRpus to its own package at https://cran.r-project.org/web/packages/sylly, so this maybe we should address that as well as part of this idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants