brucemiller / LaTeXML

LaTeXML: a TeX and LaTeX to XML/HTML/ePub/MathML translator.
http://dlmf.nist.gov/LaTeXML/
Other
863 stars 93 forks source link

Fix authblk line breaks when font has been customized #2363

Open DominikPeters opened 1 month ago

DominikPeters commented 1 month ago

Author lines typeset using the authblk package can have an unexpected behavior when the \Authfont has been set to a custom font size and a line break \authorcr is used to separate authors.

Example document:

\documentclass{article}
\usepackage{authblk}
\renewcommand\Authfont{\Large}
\title{Use of authblk}
\author[1]{Alice}
\author[1]{Bob}
\author[1]{\authorcr Charlie} % \authorcr = line break
\author[1]{Dominik}
\affil[1]{Example University}
\begin{document}
    \maketitle
\end{document}
PDF LaTeXML LaTeXML with this pull request
image image image
<br class="ltx_break"><span class="ltx_text" style="font-size:144%;">Charlie</span> <br class="ltx_break">Charlie

The reason for the difference is that the authblk binding does not actually apply the \Authfont to the author name text in its current version, except after \authorcr. https://github.com/brucemiller/LaTeXML/blob/f75b0c6b06ff9191178a008c62a95f2b9c1dd087/lib/LaTeXML/Package/authblk.sty.ltxml#L27 This pull request removes this: https://github.com/brucemiller/LaTeXML/blob/ca7e2146e73b9e566b797992487cc8102f0fe14a/lib/LaTeXML/Package/authblk.sty.ltxml#L27

Example to make it clear that normally \Authfont is ignored: let's set

\renewcommand\Authfont{\bfseries}

Then LaTeXML outputs the following:

image

LaTeXML with this pull request gives the same output as in the above table, right-most cell.

brucemiller commented 2 weeks ago

Would it be "better" to use \Authfont consistently, versus using it not-at-all?