I first encountered this bug trying to solve #660298 for my
debian-reference to build pdf. Although all other languages build
including French, Chinese, ... Portuguese didn't build.
Careful tracing of the bug lead me to the following minimal source case
and root cause pf the problem seems to be this texlive-lang-portuguese
package. I suspect the file:
/usr/share/texlive/texmf-dist/tex/generic/babel-portuges/portuges.ldf
Especially lines after:
\expandafter\ifx\csname l@\CurrentOption\endcsname\relax
This needs to be checked for interfering with the proper operation.
##################################
minimal input file to reproduce this bug:
pt.tex in attached babel-pt.tar.xz
Steps:
* Install texlive-lang-all texlive-latex-base
* Extract tarball
* Execute make in the extracted directory
* If get stuck, use ^D as usual to proceed.
* get the full comparative build and check *.diff *.log
Highlight of bug:
Failed build leave pt.log and it should show:
| ...
| \tf@lot=\write11
| \openout11 = `pt.lot'.
|
| Package babel Info: Redefining portuges shorthand "|
| (babel) in language on input line 63.
| Package babel Info: Redefining portuges shorthand "|
| (babel) in language on input line 63.
| [4
|
| ]
| Cap\'{\i }tulo 1.
| Package babel Info: Redefining portuges shorthand "|
| (babel) in language on input line 69.
| LaTeX Font Info: Font shape `T1/ptm/bx/n' in size <10> not available
| (Font) Font shape `T1/ptm/b/n' tried instead on input line 83.
| ! Extra \endcsname.
| \language@active@arg" ...@"@\string #1@\endcsname
| \fi
| l.100 \caption{List "\texttt{ls -{}\penalty0 l}"}
Comparative situation:
* The source tex differences should be available as *.diff after the build.
* The slightly modified tex for Portuguese with babel has no problem. (pt1.tex)
* The same tex for French with babel has no problem. (fr.tex)
* The same tex for English without babel has no problem. (en.tex)
Note:
I originally faced problem under xelatex but as shown here, latex also
suffer. It seems babel problem.
######################################
List of ls-R files
tags + 862497 moreinfo thanks Dear Osamu, thanks for your investigation and test case. Since docbook.sty is hacking around in lots of corners, and hasn't probably been updated to current babel, please check first whether this is a genuine babel bug, that is whether it happens with babel-portugues but *not* using third-party modules like docbook.sty/dblatex. I tried to dig into the dblatex code, but it is so painfully convoluted that I don't see the real chance to go to the bottom of it. If you can reproduce the bug with a plain latex + babel-portugues *only* setup, I will forward it to the authors/babel team. Thanks for your understanding Norbert
Hi, Thanks for quick reply. Thanks for your explanation. I also realized broken pt.pdf build leaves bogus @ at the end of line causing problem in generated PDF. True. Now I wonder the root cause is something like \makeatother invoked by a some system macro such as one from dblatex when the TeX code should still be under \makeatletter for babel. Probable because docbook.sty. Maybe it is easier to make minimal dblatex example and ask dblatex folks. After all this bug may be coming from it. Let me think ... TeX is tough. Osamu
Dear Osamu, Umpf, well, another problem. Indeed. babel and the babel interface has been unchanged for many many years, but now we have new maintainers and finally development is going on, bringing babel to work with new (unicode) engines etc. My guess is as before, one of the dblatex files tried to patch some routines in babel in a non-standard way, which simply broke. Well, it is a programming language *and* typesetting language ;-) But yes, it it tough. All the best Norbert
Hi, I have a test case that reproduces the problem without any dblatex dependency. See attached. I guess it is hyperref and babel interaction that is wrong, since " is active for babel, and the problem occurs when put in section like commands like \caption, \section and so on. Tested with pdflatex engine. Tell me if it is convincing enough. Regards, BG
forward 862497 https://github.com/ho-tex/hyperref/issues/39 thanks I reduced the example even further and submitted an issue on the github page. Best Norbert
Hi https://github.com/ho-tex/hyperref/issues/39#issuecomment-310641565 Well, David answered on the github issue, and I agree with him - I didn't realize it before, but of course, this is a user error. The usage of " is unsafe, and anyway wrong. One needs to use `` or '' for proper quotes. Babel uses " in many places as active character. Thus, this is a problem of the user, or if something, problem of the code generator, but neither babel nor texlive-lang-portuges. I think this bug should be assigned to dblatex and told *not* to generate anything like \caption{List "\texttt{ls -{}\penalty0 l}"} but \caption{List ``\texttt{ls -{}\penalty0 l}''} In absence of any opposing voices I will reassign and retitle in due time. Thanks Norbert
reassign 862497 dblatex retitle 862497 don't generate LaTeX code that uses " thanks Since there have been any, I am doing this now. All the best Norbert