ho-tex / hologo

hologo package for LaTeX
LaTeX Project Public License v1.3c
4 stars 1 forks source link

\section{\hologo{<anylogo>} generates errors in book document class #3

Open xexeo opened 4 years ago

xexeo commented 4 years ago

When I use \hologo in a \section{} command, in some ocasions it generates an error.

Is is not a consistente error, if you insert a \chapter{...} the error disappears, but some other text make the error appear again. I have a larger file where if I remove a verbatim text, the error disappears. Also, for bigger files, the error is reported in  a line elsewhere in the file (where there is no hologo command).

Here is a MWE:

\documentclass{book}
\usepackage{hologo}
\begin{document}
\section{O Ecossistema \hologo{biber}}
\end{document}

Here is the error:

F:\Github\Bug>latex introducaoaoLaTeX
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 2.9.7420 64-bit)
entering extended mode
(introducaoaoLaTeX.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-05-14>
("F:\Program Files\MiKTeX 2.9\tex/latex/base\book.cls"
Document Class: book 2019/12/20 v1.4l Standard LaTeX document class
("F:\Program Files\MiKTeX 2.9\tex/latex/base\bk10.clo"))
("F:\Program Files\MiKTeX 2.9\tex/generic/hologo\hologo.sty"
("F:\Program Files\MiKTeX 2.9\tex/generic/ltxcmds\ltxcmds.sty")
("F:\Program Files\MiKTeX 2.9\tex/generic/infwarerr\infwarerr.sty")
("F:\Program Files\MiKTeX 2.9\tex/generic/kvsetkeys\kvsetkeys.sty")
("F:\Program Files\MiKTeX 2.9\tex/generic/kvdefinekeys\kvdefinekeys.sty")
("F:\Program Files\MiKTeX 2.9\tex/latex/pdftexcmds\pdftexcmds.sty"
("F:\Program Files\MiKTeX 2.9\tex/generic/iftex\iftex.sty"))
("F:\Program Files\MiKTeX 2.9\tex/latex/kvoptions\kvoptions.sty"
("F:\Program Files\MiKTeX 2.9\tex/latex/graphics\keyval.sty")))
("F:\Program Files\MiKTeX 2.9\tex/latex/l3backend\l3backend-dvips.def")
(introducaoaoLaTeX.aux)

! Package hologo Error: Unknown logo `BIBER'.

See the hologo package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.5 \end{document}

Same error, with LuaLaTeX

F:\Github\Bug>lualatex introducaoaoLaTeX
This is LuaHBTeX, Version 1.12.0 (MiKTeX 2.9.7420 64-bit)
 restricted system commands enabled.
(./introducaoaoLaTeX.tex
LaTeX2e <2020-02-02> patch level 5
 L3 programming layer <2020-05-14>
("F:/Program Files/MiKTeX 2.9/tex/latex/base/book.cls"
Document Class: book 2019/12/20 v1.4l Standard LaTeX document class
("F:/Program Files/MiKTeX 2.9/tex/latex/base/bk10.clo"))
("F:/Program Files/MiKTeX 2.9/tex/generic/hologo/hologo.sty"
("F:/Program Files/MiKTeX 2.9/tex/generic/ltxcmds/ltxcmds.sty")
("F:/Program Files/MiKTeX 2.9/tex/generic/infwarerr/infwarerr.sty")
("F:/Program Files/MiKTeX 2.9/tex/generic/kvsetkeys/kvsetkeys.sty")
("F:/Program Files/MiKTeX 2.9/tex/generic/kvdefinekeys/kvdefinekeys.sty")
("F:/Program Files/MiKTeX 2.9/tex/latex/pdftexcmds/pdftexcmds.sty"
("F:/Program Files/MiKTeX 2.9/tex/generic/iftex/iftex.sty"))
("F:/Program Files/MiKTeX 2.9/tex/latex/kvoptions/kvoptions.sty"
("F:/Program Files/MiKTeX 2.9/tex/latex/graphics/keyval.sty")))
("F:/Program Files/MiKTeX 2.9/tex/latex/l3backend/l3backend-pdfmode.def")
(./introducaoaoLaTeX.aux) ("F:/Program Files/MiKTeX 2.9/tex/latex/base/ts1cmr.f
d")

! Package hologo Error: Unknown logo `BIBER'.

See the hologo package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.5 \end{document}

?
u-fischer commented 4 years ago

Well it breaks when the \MakeUppercase from the header kicks in. The easiest is probably to generate variants of the commands, which allows to use uppercase arguments:

\documentclass{book}

\usepackage{hologo}

\ExplSyntaxOn
\newcommand\hologoEntry[3]{\tl_set_eq:cc { HoLogo@\str_uppercase:n{#1}}{HoLogo@#1}}
\hologoList
\ExplSyntaxOff

\begin{document}

\section{O Ecossistema \hologo{biber}}
\end{document}
jfbu commented 6 months ago

Another option is to declare robust commands \DeclareRobustCommand\biberlogo{\hologo{biber}}

u-fischer commented 6 months ago

One can also use the robust variant and add it to the no-case-change list:

\documentclass{book}
\usepackage{hologo}
\AddToNoCaseChangeList{\hologoRobust}
\begin{document}
\section{O Ecossistema \hologoRobust{biber}}
\end{document}