Closed jreduardo closed 5 years ago
Does tinytex::tlmgr_install("hyphen-portuguese")
solve the problem?
Ooh thanks, this worked (I'm ashamed of not having found this simple solution before :smile:).
By the way, thank you for the tinytex
package, it's nice!
No worries. Thanks for the confirmation! I think I can at least make the life of R users easier by providing a more helpful message when the hyphenation package is missing.
It would be great.
I had the same issue with German and want to share my solution for those coming across this issue.
Package babel Warning: No hyphenation patterns were preloaded for
the language `German (new orthography)' into the format.
The solution was to run tinytex::tlmgr_install("collection-langgerman")
Thank you, Yihui, for an awesome package.
@hplieninger Thanks for sharing the solution!
Unfortunately, I still run into the same issue. I have successfully installed all required files via tinytex::tlmgr_install("collection-langgerman")
and still get that error msg. I checked specifically for the hyphen file and got the message
tlmgr install: package already present: hyphen-german
, and I checked the installed packages and they were all there.
Any further suggestions how to tackle this?
UPDATE: I have updated all packages, to no avail. I am still getting the same error.
I still continue to get the error message, despite having uninstalled collection-langgerman
) and reinstalled it again, hoping I would get the same result as @hplieninger .
I do get two error messages though:
fmtutil [WARNING]: inifile pdflatex.ini for pdflatex/pdftex not found.
fmtutil [WARNING]: inifile latex.ini for latex/pdftex not found.
Could that be related to my issue?
@jreduardo Could you try tinytex::tlmgr_install(c('texlive-scripts', 'dehyph-exptl'))
? Thanks!
@jreduardo Could you try
tinytex::tlmgr_install(c('texlive-scripts', 'dehyph-exptl'))
? Thanks!
Thanks @yihui for the suggestion. This time the command worked, both pkgs were installed. Alas, no change. I also deinstalled and reinstalled using tinytex::tlmgr_install("collection-langgerman")
. I keep getting those warnings:
fmtutil [WARNING]: inifile latex.ini for latex/pdftex not found.
fmtutil [WARNING]: inifile pdflatex.ini for pdflatex/pdftex not found.
Now it works. After deleting the folder Users/jrennstich/.TinyTeX
and reinstalling everything it works.
@jreduardo Thanks for reporting back! https://tex.stackexchange.com/q/529413/9128
@yihui Using tinytex 0.25.1 I still get the warning
Package babel Warning: No hyphenation patterns were preloaded for
(babel) the language `German (new orthography)' into the format.
(babel) Please, configure your TeX system to add them and
(babel) rebuild the format. Now I will use the patterns
(babel) preloaded for \language=0 instead on input line 47.
Installing tinytex::tlmgr_install(c('texlive-scripts', 'dehyph-exptl'))
doesn't remedy it, only tinytex::tlmgr_install("collection-langgerman")
does. Maybe this should be taken care of automatically by the package?
Package babel Warning: No hyphenation patterns were preloaded for (babel) the language `German (new orthography)' into the format.
@fkohrt I think you only need tinytex::tlmgr_install("hyphen-german")
. This will be taken care of automatically in the next version of tinytex. For now, you can install the development version:
remotes::install_github('yihui/tinytex')
I had the same problem for Dutch (on macOS) and for me too tinytex::tlmgr_install("hyphen-dutch")
didn't resolve the issue. However, using babel-dutch
instead did work.
I'm not sure if https://github.com/rstudio/tinytex/commit/0f2007426f730a6ed9d45369233c1349a69ddd29 should be autoinstalling hyphen-spanish, but recently I had issues (https://github.com/quarto-dev/quarto-cli/issues/8684) using the tinytex bundle that's shipped with quarto, which I solved by manually installing hyphen-spanish.
@memeplex If you have the LaTeX log file, you can run tinytex:::check_babel()
on it and see if tinytex is able to detect the missing package. I'm not sure if Quarto has included the patch I made in tinytex (https://github.com/rstudio/tinytex/commit/0f2007426f730a6ed9d45369233c1349a69ddd29).
I'm not sure if Quarto has included the patch I made in tinytex (0f20074).
I suspect this may be the case, I've already suggested this possibility in their tracker. Thanks!
Apparently they did: https://github.com/quarto-dev/quarto-cli/blob/078cac0de0a42bca9cfa788b17f160128193286c/src/command/render/latexmk/pdf.ts#L181C38-L181C65
This is the example that wasn't being hyphenated:
---
lang: es
---
automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente automáticamente
They answered:
We do support parsing of Babel warnings, but none are emitted in the example that you provided, so there isn't really a reasonable way for us to automatically detect this if the LaTeX engine isn't notifying us of any issue.
Do you think your solution will work in this example?
Comparing the logs with and without hyphen-spanish installed I found this important difference:
> Package babel Info: Hyphen rules for 'spanish' set to \l@nil
> (babel) (\language7). Reported on input line 128.
By inspecting the code, it doesn't seem to be detected, maybe they changed the way it is reported?
Maybe. I'll take a look and see if I can adapt tinytex:::check_babel()
to the new form of babel messages.
I feel it will be nicer if babel could issue a warning instead of info in this case... That way, it will be easier for us to recognize the problem. We can definitely check info, too, but I'm not sure that's too much.
@yihui this is the new detection rule in Quarto : https://github.com/quarto-dev/quarto-cli/blob/6f4e15c09da45e675354498665d561e58cd4c425/src/command/render/latexmk/parse-error.ts#L110-L145
We now parse
// Try an alternative way of parsing
const hyphenRulesRegex =
/Package babel Info: Hyphen rules for '(.*?)' set to \\l@nil/m;
to install missing package
We can definitely check info, too, but I'm not sure that's too much.
I think it could be worth it.
When I run
pdflatex
(or its friendsxelatex
,lualatex
) on a document with packagebabel
, option other thanenglish
, I receive the message:Even after run
fmtutils-sys --all
(in terminal or using the wrappertinytex::tlmgr_update()
), the hyphenation don't work. The (final) output offmtutils-sys --all
isTo try to debug this error, I installed a huge LaTeX distribution
texlive
and additional packages. And when I ran/usr/bin/pdflatex document.tex
the output was fine and the hyphenation worked.Faced with this, I tried to put the files related to the packages that make the hyphenation side by side. But I didn't find crucial differences, everything seems equal (
config/language*
,babel/portuges.sty
,hyphen/hyphen.tex
).Do you have any idea what could be wrong?