I want to use lmodern fonts with authblk package, and I want to set the author and affiliation lines in \scshape and \itshape respectively. However, it gives me slanted letters in affiliation.
\documentclass[a4paper]{article} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[]{authblk} \renewcommand\Authfont{\scshape} \renewcommand\Affilfont{\itshape\small} \title{The Title} \author{First Author} \affil{Some University} \begin{document} \maketitle Hello {\itshape world}! \end{document} which results in:
I get slanted letters on affiliation. Disabling lmodern gives me regular italic characters:
\documentclass[a4paper]{article} %\usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[]{authblk} \renewcommand\Authfont{\scshape} \renewcommand\Affilfont{\itshape\small} \title{The Title} \author{First Author} \affil{Some University} \begin{document} \maketitle Hello {\itshape world}! \end{document} Weirdly, if I disable renewing of Authfont only while lmodern is still loaded, I get italic letters on affiliation:
\documentclass[a4paper]{article} \usepackage{lmodern} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[]{authblk} %\renewcommand\Authfont{\scshape} \renewcommand\Affilfont{\itshape\small} \title{The Title} \author{First Author} \affil{Some University} \begin{document} \maketitle Hello {\itshape world}! \end{document} gives me
What's happening here? Note that the italics show properly in the main text in all cases. Is this issue related to the way authblk loads the font shapes? I've tested this on both TeXLive 2022 and 2023.
EDIT
Here is the log from Texifier (for macOS) when \normalshape is used within \Affilfont definition:
This is TexpadTeX (based on TeX Version 3.14159265 with e-TeX extensions) running in extended mode embedded in Texpad 754 (preloaded format=latex 2021.3.29) 9 APR 2023 13:32 ** (manuscript-template.tex LaTeX2e <2017-04-15> Babel <3.16> and hyphenation patterns for 84 language(s) loaded. (article.cls Document Class: article 2014/09/29 v1.4h Standard LaTeX document class (size10.clo File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option) ) \c@part=\count79 \c@section=\count80 \c@subsection=\count81 \c@subsubsection=\count82 \c@paragraph=\count83 \c@subparagraph=\count84 \c@figure=\count85 \c@table=\count86 \abovecaptionskip=\skip41 \belowcaptionskip=\skip42 \bibindent=\dimen102 ) (lmodern.sty Package: lmodern 2009/10/30 v1.6 Latin Modern Fonts LaTeX Font Info: Overwriting symbol font `operators' in version `normal' (Font) OT1/cmr/m/n --> OT1/lmr/m/n on input line 22. LaTeX Font Info: Overwriting symbol font `letters' in version `normal' (Font) OML/cmm/m/it --> OML/lmm/m/it on input line 23. LaTeX Font Info: Overwriting symbol font `symbols' in version `normal' (Font) OMS/cmsy/m/n --> OMS/lmsy/m/n on input line 24. LaTeX Font Info: Overwriting symbol font `largesymbols' in version `normal' (Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 25. LaTeX Font Info: Overwriting symbol font `operators' in version `bold' (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 26. LaTeX Font Info: Overwriting symbol font `letters' in version `bold' (Font) OML/cmm/b/it --> OML/lmm/b/it on input line 27. LaTeX Font Info: Overwriting symbol font `symbols' in version `bold' (Font) OMS/cmsy/b/n --> OMS/lmsy/b/n on input line 28. LaTeX Font Info: Overwriting symbol font `largesymbols' in version `bold' (Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 29. LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal' (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 31. LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal' (Font) OT1/cmss/m/n --> OT1/lmss/m/n on input line 32. LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal' (Font) OT1/cmr/m/it --> OT1/lmr/m/it on input line 33. LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal' (Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 34. LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `bold' (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 35. LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold' (Font) OT1/cmss/bx/n --> OT1/lmss/bx/n on input line 36. LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold' (Font) OT1/cmr/bx/it --> OT1/lmr/bx/it on input line 37. LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold' (Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 38. ) (fontenc.sty Package: fontenc 2017/04/05 v2.0i Standard LaTeX package (t1enc.def File: t1enc.def 2017/04/05 v2.0i Standard LaTeX file LaTeX Font Info: Redeclaring font encoding T1 on input line 48. )) (inputenc.sty Package: inputenc 2015/03/17 v1.2c Input encoding file \inpenc@prehook=\toks14 \inpenc@posthook=\toks15 (utf8.def File: utf8.def 2017/01/28 v1.1t UTF-8 support for inputenc Now handling font encoding OML ... ... no UTF-8 mapping file for font encoding OML Now handling font encoding T1 ... ... processing UTF-8 mapping file for font encoding T1 (t1enc.dfu File: t1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc defining Unicode char U+00A0 (decimal 160) defining Unicode char U+00A1 (decimal 161) defining Unicode char U+00A3 (decimal 163) ... ) Now handling font encoding OT1 ... ... processing UTF-8 mapping file for font encoding OT1 (ot1enc.dfu File: ot1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc defining Unicode char U+00A0 (decimal 160) defining Unicode char U+00A1 (decimal 161) defining Unicode char U+00A3 (decimal 163) ... ) Now handling font encoding OMS ... ... processing UTF-8 mapping file for font encoding OMS (omsenc.dfu File: omsenc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc defining Unicode char U+00A7 (decimal 167) defining Unicode char U+00B6 (decimal 182) defining Unicode char U+00B7 (decimal 183) defining Unicode char U+2020 (decimal 8224) defining Unicode char U+2021 (decimal 8225) defining Unicode char U+2022 (decimal 8226) ) Now handling font encoding OMX ... ... no UTF-8 mapping file for font encoding OMX Now handling font encoding U ... ... no UTF-8 mapping file for font encoding U defining Unicode char U+00A9 (decimal 169) defining Unicode char U+00AA (decimal 170) defining Unicode char U+00AE (decimal 174) defining Unicode char U+00BA (decimal 186) defining Unicode char U+02C6 (decimal 710) defining Unicode char U+02DC (decimal 732) defining Unicode char U+200C (decimal 8204) defining Unicode char U+2026 (decimal 8230) defining Unicode char U+2122 (decimal 8482) defining Unicode char U+2423 (decimal 9251) )) (authblk.sty Package: authblk 2001/02/27 1.3 (PWD) \affilsep=\skip43 \@affilsep=\skip44 \c@Maxaffil=\count87 \c@authors=\count88 \c@affil=\count89 ) No file manuscript-template.aux. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 15. LaTeX Font Info: ... okay on input line 15. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 15. LaTeX Font Info: ... okay on input line 15. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 15. LaTeX Font Info: ... okay on input line 15. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 15. LaTeX Font Info: ... okay on input line 15. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 15. LaTeX Font Info: ... okay on input line 15. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 15. LaTeX Font Info: ... okay on input line 15. LaTeX Font Info: Try loading font information for T1+lmr on input line 15. (t1lmr.fd File: t1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern ) ! Undefined control sequence. \Affilfont ->\normalshape \itshape \small l.16 \maketitle The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. [1 ] (manuscript-template.aux) ) This is TexpadTeX (based on TeX Version 3.14159265 with e-TeX extensions) running in extended mode embedded in Texpad 754 (preloaded format=latex 2021.3.29) 9 APR 2023 13:32 ** (manuscript-template.tex LaTeX2e <2017-04-15> Babel <3.16> and hyphenation patterns for 84 language(s) loaded. (article.cls Document Class: article 2014/09/29 v1.4h Standard LaTeX document class (size10.clo File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option) ) \c@part=\count79 \c@section=\count80 \c@subsection=\count81 \c@subsubsection=\count82 \c@paragraph=\count83 \c@subparagraph=\count84 \c@figure=\count85 \c@table=\count86 \abovecaptionskip=\skip41 \belowcaptionskip=\skip42 \bibindent=\dimen102 ) (lmodern.sty Package: lmodern 2009/10/30 v1.6 Latin Modern Fonts LaTeX Font Info: Overwriting symbol font `operators' in version `normal' (Font) OT1/cmr/m/n --> OT1/lmr/m/n on input line 22. LaTeX Font Info: Overwriting symbol font `letters' in version `normal' (Font) OML/cmm/m/it --> OML/lmm/m/it on input line 23. LaTeX Font Info: Overwriting symbol font `symbols' in version `normal' (Font) OMS/cmsy/m/n --> OMS/lmsy/m/n on input line 24. LaTeX Font Info: Overwriting symbol font `largesymbols' in version `normal' (Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 25. LaTeX Font Info: Overwriting symbol font `operators' in version `bold' (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 26. LaTeX Font Info: Overwriting symbol font `letters' in version `bold' (Font) OML/cmm/b/it --> OML/lmm/b/it on input line 27. LaTeX Font Info: Overwriting symbol font `symbols' in version `bold' (Font) OMS/cmsy/b/n --> OMS/lmsy/b/n on input line 28. LaTeX Font Info: Overwriting symbol font `largesymbols' in version `bold' (Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 29. LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal' (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 31. LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal' (Font) OT1/cmss/m/n --> OT1/lmss/m/n on input line 32. LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal' (Font) OT1/cmr/m/it --> OT1/lmr/m/it on input line 33. LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal' (Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 34. LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `bold' (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 35. LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold' (Font) OT1/cmss/bx/n --> OT1/lmss/bx/n on input line 36. LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold' (Font) OT1/cmr/bx/it --> OT1/lmr/bx/it on input line 37. LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold' (Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 38. ) (fontenc.sty Package: fontenc 2017/04/05 v2.0i Standard LaTeX package (t1enc.def File: t1enc.def 2017/04/05 v2.0i Standard LaTeX file LaTeX Font Info: Redeclaring font encoding T1 on input line 48. )) (inputenc.sty Package: inputenc 2015/03/17 v1.2c Input encoding file \inpenc@prehook=\toks14 \inpenc@posthook=\toks15 (utf8.def File: utf8.def 2017/01/28 v1.1t UTF-8 support for inputenc Now handling font encoding OML ... ... no UTF-8 mapping file for font encoding OML Now handling font encoding T1 ... ... processing UTF-8 mapping file for font encoding T1 (t1enc.dfu File: t1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc defining Unicode char U+00A0 (decimal 160) defining Unicode char U+00A1 (decimal 161) defining Unicode char U+00A3 (decimal 163) ... ) Now handling font encoding OT1 ... ... processing UTF-8 mapping file for font encoding OT1 (ot1enc.dfu File: ot1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc defining Unicode char U+00A0 (decimal 160) defining Unicode char U+00A1 (decimal 161) defining Unicode char U+00A3 (decimal 163) ... ) Now handling font encoding OMS ... ... processing UTF-8 mapping file for font encoding OMS (omsenc.dfu File: omsenc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc defining Unicode char U+00A7 (decimal 167) defining Unicode char U+00B6 (decimal 182) defining Unicode char U+00B7 (decimal 183) defining Unicode char U+2020 (decimal 8224) defining Unicode char U+2021 (decimal 8225) defining Unicode char U+2022 (decimal 8226) ) Now handling font encoding OMX ... ... no UTF-8 mapping file for font encoding OMX Now handling font encoding U ... ... no UTF-8 mapping file for font encoding U defining Unicode char U+00A9 (decimal 169) defining Unicode char U+00AA (decimal 170) defining Unicode char U+00AE (decimal 174) defining Unicode char U+00BA (decimal 186) defining Unicode char U+02C6 (decimal 710) defining Unicode char U+02DC (decimal 732) defining Unicode char U+200C (decimal 8204) defining Unicode char U+2026 (decimal 8230) defining Unicode char U+2122 (decimal 8482) defining Unicode char U+2423 (decimal 9251) )) (authblk.sty Package: authblk 2001/02/27 1.3 (PWD) \affilsep=\skip43 \@affilsep=\skip44 \c@Maxaffil=\count87 \c@authors=\count88 \c@affil=\count89 ) (manuscript-template.aux) LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 15. LaTeX Font Info: ... okay on input line 15. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 15. LaTeX Font Info: ... okay on input line 15. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 15. LaTeX Font Info: ... okay on input line 15. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 15. LaTeX Font Info: ... okay on input line 15. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 15. LaTeX Font Info: ... okay on input line 15. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 15. LaTeX Font Info: ... okay on input line 15. LaTeX Font Info: Try loading font information for T1+lmr on input line 15. (t1lmr.fd File: t1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern ) ! Undefined control sequence. \Affilfont ->\normalshape \itshape \small l.16 \maketitle The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. [1 ] (manuscript-template.aux) ) This is TexpadTeX (based on TeX Version 3.14159265 with e-TeX extensions) running in extended mode embedded in Texpad 754 (preloaded format=latex 2021.3.29) 9 APR 2023 13:32 ** (manuscript-template.tex LaTeX2e <2017-04-15> Babel <3.16> and hyphenation patterns for 84 language(s) loaded. (article.cls Document Class: article 2014/09/29 v1.4h Standard LaTeX document class (size10.clo File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option) ) \c@part=\count79 \c@section=\count80 \c@subsection=\count81 \c@subsubsection=\count82 \c@paragraph=\count83 \c@subparagraph=\count84 \c@figure=\count85 \c@table=\count86 \abovecaptionskip=\skip41 \belowcaptionskip=\skip42 \bibindent=\dimen102 ) (lmodern.sty Package: lmodern 2009/10/30 v1.6 Latin Modern Fonts LaTeX Font Info: Overwriting symbol font `operators' in version `normal' (Font) OT1/cmr/m/n --> OT1/lmr/m/n on input line 22. LaTeX Font Info: Overwriting symbol font `letters' in version `normal' (Font) OML/cmm/m/it --> OML/lmm/m/it on input line 23. LaTeX Font Info: Overwriting symbol font `symbols' in version `normal' (Font) OMS/cmsy/m/n --> OMS/lmsy/m/n on input line 24. LaTeX Font Info: Overwriting symbol font `largesymbols' in version `normal' (Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 25. LaTeX Font Info: Overwriting symbol font `operators' in version `bold' (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 26. LaTeX Font Info: Overwriting symbol font `letters' in version `bold' (Font) OML/cmm/b/it --> OML/lmm/b/it on input line 27. LaTeX Font Info: Overwriting symbol font `symbols' in version `bold' (Font) OMS/cmsy/b/n --> OMS/lmsy/b/n on input line 28. LaTeX Font Info: Overwriting symbol font `largesymbols' in version `bold' (Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 29. LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal' (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 31. LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal' (Font) OT1/cmss/m/n --> OT1/lmss/m/n on input line 32. LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal' (Font) OT1/cmr/m/it --> OT1/lmr/m/it on input line 33. LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal' (Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 34. LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `bold' (Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 35. LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold' (Font) OT1/cmss/bx/n --> OT1/lmss/bx/n on input line 36. LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold' (Font) OT1/cmr/bx/it --> OT1/lmr/bx/it on input line 37. LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold' (Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 38. ) (fontenc.sty Package: fontenc 2017/04/05 v2.0i Standard LaTeX package (t1enc.def File: t1enc.def 2017/04/05 v2.0i Standard LaTeX file LaTeX Font Info: Redeclaring font encoding T1 on input line 48. )) (inputenc.sty Package: inputenc 2015/03/17 v1.2c Input encoding file \inpenc@prehook=\toks14 \inpenc@posthook=\toks15 (utf8.def File: utf8.def 2017/01/28 v1.1t UTF-8 support for inputenc Now handling font encoding OML ... ... no UTF-8 mapping file for font encoding OML Now handling font encoding T1 ... ... processing UTF-8 mapping file for font encoding T1 (t1enc.dfu File: t1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc defining Unicode char U+00A0 (decimal 160) defining Unicode char U+00A1 (decimal 161) defining Unicode char U+00A3 (decimal 163) ... ) Now handling font encoding OT1 ... ... processing UTF-8 mapping file for font encoding OT1 (ot1enc.dfu File: ot1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc defining Unicode char U+00A0 (decimal 160) defining Unicode char U+00A1 (decimal 161) defining Unicode char U+00A3 (decimal 163) ... ) Now handling font encoding OMS ... ... processing UTF-8 mapping file for font encoding OMS (omsenc.dfu File: omsenc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc defining Unicode char U+00A7 (decimal 167) defining Unicode char U+00B6 (decimal 182) defining Unicode char U+00B7 (decimal 183) defining Unicode char U+2020 (decimal 8224) defining Unicode char U+2021 (decimal 8225) defining Unicode char U+2022 (decimal 8226) ) Now handling font encoding OMX ... ... no UTF-8 mapping file for font encoding OMX Now handling font encoding U ... ... no UTF-8 mapping file for font encoding U defining Unicode char U+00A9 (decimal 169) defining Unicode char U+00AA (decimal 170) defining Unicode char U+00AE (decimal 174) defining Unicode char U+00BA (decimal 186) defining Unicode char U+02C6 (decimal 710) defining Unicode char U+02DC (decimal 732) defining Unicode char U+200C (decimal 8204) defining Unicode char U+2026 (decimal 8230) defining Unicode char U+2122 (decimal 8482) defining Unicode char U+2423 (decimal 9251) )) (authblk.sty Package: authblk 2001/02/27 1.3 (PWD) \affilsep=\skip43 \@affilsep=\skip44 \c@Maxaffil=\count87 \c@authors=\count88 \c@affil=\count89 ) (manuscript-template.aux) LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 15. LaTeX Font Info: ... okay on input line 15. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 15. LaTeX Font Info: ... okay on input line 15. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 15. LaTeX Font Info: ... okay on input line 15. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 15. LaTeX Font Info: ... okay on input line 15. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 15. LaTeX Font Info: ... okay on input line 15. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 15. LaTeX Font Info: ... okay on input line 15. LaTeX Font Info: Try loading font information for T1+lmr on input line 15. (t1lmr.fd File: t1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern ) ! Undefined control sequence. \Affilfont ->\normalshape \itshape \small l.16 \maketitle The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. [1 ] (manuscript-template.aux) ) (I had to remove many defining Unicode char ... lines as the log was too long.)



