I took some templates/macros that use \Large/\small... to configure the font size of my title page. The problem is that when I change the font size of the rest of the document using \documentclass[12pt]{memoir} instead of \documentclass[10pt]{memoir}, then the font size of the title template is increased, breaking the layout.
I tried to use \fontsize{10}{12}\selectfont to force a smaller font for the page title, but the problem is that it does not reduce the font size of \Large/\small… They are still Large/small compared to the document 12pt instead of the current 10pt.
How can I simply change locally the font size in such a way that \Large, \small… size is updated to match the new local font size?
MWE:
\documentclass[a4paper,12pt]{memoir}
\begin{document}
\section{Simple text}
\noindent Hello\
{\small Hello $\leftarrow $ This one is smaller than previous line as expected}
\section{``Small'' text}
{\fontsize{10}{12}\selectfont \noindent Hello\
{\small Hello $\leftarrow $ I expect this one to be smaller than previous line\dots and its bigger}}
\end{document}
EDIT
Concerning the solution proposed in the comment, \relsize{} looks great for new text, but it won't actually change the macros \Large, \tiny… So this solution won't apply when I want to convert an existing document (tikz picture, pre-made template...). Also, using stuff like \Large allow people to use consistent sizes across the whole document: it would be quite easy to have many different \relsize{...} in a same document if one is not very cautious.
I tried the solution proposed by @muzimuzhi in the comments. It works very well on page title (it does reset the layout in page title indeed... but not sure why when I put it on a new page but not inside a page title it does not change the layout), but it does not work great when used inside an existing text. It adds a huge space (and can push the text in the margin), as highlighted in red:
MWE:
\documentclass[a4paper,12pt]{memoir}
\usepackage{lipsum}
\begin{document}
\section{Simple text}
\noindent Hello\
{\small Hello $\leftarrow $ This one is smaller than previous line as expected}
\lipsum[1]
\section{``Small'' text}
Text before: see the space (it even goes into the margin) {\makeatletter\let\newcommand\renewcommand\input{size10.clo} Hello\
{\small Hello $\leftarrow $ I expect this one to be smaller than previous line\dots and it does work now!}} Text after.
\end{document}


relsizepackage is interesting for you (you could, instead of using\Larger, etc. use\relscale{1.2}to make the current font 20% larger than the current size). – Skillmon Jun 14 '21 at 19:59\fontsize{10}{12}\selectfont, you can reload the corresponding font-size config filesize10.clo. Note it not only changes commands like\large, but also lengths for page geometry or spacing. All the changes will be local. – muzimuzhi Z Jun 14 '21 at 20:19{\makeatletter\let\newcommand\renewcommand\input{size10.clo} my text}outside of the page title it seems that the geometry is not changed: any idea why? Also, when used inside an existing text, it adds a huge space before (see my edit). Any idea how to make it work also for inline texts?[1] https://tex.stackexchange.com/questions/15835/switching-to-different-font-sizes-locally
– tobiasBora Jun 15 '21 at 07:59\Largein existing macros/templates, then\Largeis not always proportional to the normal font size: for instance in memoir, in 10pt normal size, Large is 1.4 larger, but in 12pt, Large is 1.54 larger so we can't define a single value for\relscale. Also, it is easier to have many values of\relscalein a document, and it will likely break consistency (even if this last issue can be mitigated by defining macros fixing the scale). https://www.sascha-frank.com/latex-font-size.html – tobiasBora Jun 15 '21 at 08:06\Largemacros working for the new size? It sounds like a lot of work, especially when there are many different cases (for instance the memoir class has 12*12=144 values to configure https://www.sascha-frank.com/latex-font-size.html) There is no package that does that for me already? – tobiasBora Jun 15 '21 at 08:11\Largeand the class will have defined that to be a suitable size based on the global size option. – David Carlisle Jun 15 '21 at 08:34size10.cloassumes it will be included in vertical mode, in which the space tokens converted from non-consecutive newlines are all ignored. But in your casesize10.clois included in horizontal mode, hence all the space characters take effect. Perhaps you have to copy-and-paste the font-size macros fromsize10.clo... This is even less recommended. – muzimuzhi Z Jun 15 '21 at 10:14Also, using stuff like \Large allow people to use consistent sizes across the whole document:But you you seem to be asking for a solution which changes these macros in ways which make them inconsistent. So what would count as a satisfactory solution? – cfr Mar 29 '24 at 04:19\Largeprovides an absolute font size, and I wanted to make it relative to the current font size in use, which makes sense in some cases (if I decide that my text should be slightly smaller, e.g. for a picture, while keeping the same ratio between small text and large text as in the main document). Just like css also provides the em unit to refer to the font size of tge parent container. – tobiasBora Mar 29 '24 at 09:08\relsize{1.12},\relsize{1.13}in differents parts of the document since it is a continuous functior… (and i might be too lazy to check the value I used in previous pictures or just forget I used it) while a relative\large, with discrete and predefined jumps makes it easier to always use the same value without worrying if I used 1.12 before or 1.13. – tobiasBora Mar 29 '24 at 09:17