LaTeXML icon indicating copy to clipboard operation
LaTeXML copied to clipboard

Fix authblk line breaks when font has been customized

Open DominikPeters opened this issue 1 year ago • 1 comments

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.

DominikPeters avatar May 02 '24 17:05 DominikPeters

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

brucemiller avatar May 29 '24 18:05 brucemiller

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

From my usual corpus perspective, if the author is captured in the structured frontmatter, it can be styled with CSS. The TeX-based customization using \Authfont may make it harder to interplay with a generic style, so - if used consistently - it should ideally deposit a class attribute rather than a style directvie.

dginev avatar Jun 06 '25 11:06 dginev

I guess one could merge this PR and open an issue saying that \Authfont is being ignored. Then someone could work on implementing that separately at some point. The current behavior is just clearly not right.

DominikPeters avatar Jun 06 '25 12:06 DominikPeters

OK, fine. Ganging up on me!! Thanks for the contribution!

brucemiller avatar Jul 22 '25 19:07 brucemiller