I am trying to change the font size of the achemso document class, and I came across this snippet of code on the second answer here: Is it possible to use 12 pt font size in the achemso package?
\let\titlefont\undefined
\makeatletter
\let\l@addto@macro\relax
\makeatother
\usepackage[fontsize=10pt]{scrextend}
It accomplishes the goal just fine, but I want to understand what the various lines are doing. I get that \let\titlefont\undefined is un-defining the title font of KOMA-script to avoid clash with achemso. I'm also okay with the \makeatletter \makeatother lines and the \usepackage line. But what is the \let\l@addto@macro\relax line doing? It seems to work with or without it. I tried researching \l@addto@macro, but all I could find is information on \g@addto@macro; what's the difference?
\g@addto@macrochanges the definition of the macro globally, while\l@addto@macrodoes so locally. Usage looks like this\newcommand\foo{bar}\l@addto@macro\foo{baz}and then the replacement text of\fooisbarbaz. – Skillmon Sep 13 '23 at 20:35\relaxto the\letcommand for just this document (since it was local and not global)? Am I understanding that correctly? Many thanks! – the_chemist Sep 13 '23 at 20:47\letacts on\l@addto@macroturning it into\relax(which is roughly as good as undefining it). – Skillmon Sep 13 '23 at 20:58\l@addto@macrois a macro with two arguments and that redefinition would leave the two arguments in the input stream. – egreg Sep 13 '23 at 20:59scrextenddefined\l@addto@macrowith\newcommandand was erring because it was already defined. – Skillmon Sep 13 '23 at 21:08scrextenduses\l@addto@macroonly inside the definition of\deffootnote. And doesn't define it. One gets an error if\deffootnoteis used, but undefining\l@addto@macrois not the solution. – egreg Sep 13 '23 at 21:14scrextendrequiresscrkbasewhich requiresscrbasewhich defines\l@addto@macro(the current version uses\def, but I have no idea whether that's always been the case). – Skillmon Sep 13 '23 at 21:25scrextendwas deployed) to 2023. – egreg Sep 13 '23 at 21:40scrbaseand there it was already a\defplus a check if it's defined whether the meaning matches what KOMA expects. So all this\let-code ever could've done was throw a warning that KOMA redefines it because the meaning of\l@addto@macrois wrong... Indeed not that useful :) – Skillmon Sep 14 '23 at 07:43