12

The fontsize commands for fontsizes smaller than \normalsize stretch the aspect ratio of the letters or stretch the letters itself plus their spacing instead of properly scaling the text in width and height (with respect to \normalsize) - an effect that becomes really extreme for \scriptsize and especially \tiny.

The following minimal example shows the basic problem and a possible solution/workaround to it (to which I need an improved, global turn on / turn off - solution):

 \documentclass[12pt,a4paper,ngerman]{scrbook}
 \usepackage[T1]{fontenc}
 \usepackage{lmodern}
 \usepackage[utf8]{inputenc}
 \usepackage{amsmath,amsfonts,amssymb,amsxtra}
 \usepackage[ngerman]{babel}
 \usepackage{graphicx}

 \newcommand{\tinyb}[1]{\scalebox{0.5}{{\normalsize #1}}}
 %\newcommand{\scriptsizeb}[1]{\scalebox{0.66667}{{\normalsize #1}}}

 \begin{document}
 \begin{itemize}
      \item {\tiny{Tiny tiny Tiny TINY tiny (original \textbackslash tiny)}} \hspace{.2cm} {\tinyb{Tiny tiny Tiny TINY tiny (custom \textbackslash tinyb)}}
      \item {\tinyb{Tiny tiny Tiny TINY tiny (custom \textbackslash tinyb)}}
      \item {\normalsize{Tiny tiny Tiny TINY tiny (original \textbackslash normalsize)}}
      \item {\tiny{$U_{\infty}=f\cdot a\cdot \frac{\alpha}{\beta}$ (original \textbackslash tiny)}} \hspace{.2cm} {\tinyb{$U_{\infty}=f\cdot a\cdot \frac{\alpha}{\beta}$ (custom \textbackslash tinyb)}}
      \item {\tinyb{$U_{\infty}=f\cdot a\cdot \frac{\alpha}{\beta}$ (custom \textbackslash tinyb)}}
      %\item {\scriptsize{Scriptsize SCRIPTSIZE (original \textbackslash scriptsize)}} \hspace{.2cm} {\scriptsizeb{Scriptsize SCRIPTSIZE (custom \textbackslash scriptsizeb)}}
      %\item {\scriptsizeb{Scriptsize SCRIPTSIZE (custom \textbackslash scriptsizeb)}}
 \end{itemize}
 \end{document}

The result will look like this: Ugly stretching of \tiny text in LaTeX

You will notice that the original \tiny stretches the textwidth extremly, while the workaround with \tinyb uses the scalebox command from the graphicx-package and scales both - height and width of the text - exactly by 50 percent. The fontheight of both styles (\tiny and \tinyb) are exactly identical. Especially in the equation \tiny looks pretty ugly stretched, which is a big problem in small figure's legends or annotations, where only very few letters fit into the legend, even when using \tiny.

The solution with \tinyb (scalebox trick) isn't sufficient for me because I won't be able to change settings globally. I can only change a certain textpattern to \tinyb locally and things like line breaks etc. won't work. It is not a turn on / turn off solution like \tiny or \normalsize, which is what I want: For example I want to use tikzfigures / pgfplots and change the annotation style of all axis legend entries, ticks and graph annotations to \tinyb with only one command but as \tinyb uses a scalebox (which uses a \mbox) I can only use it in specific command lines and code like

\begin{tikzpicture}
\tinyb
\begin{axis}[...
...
xlabel={frequency (Hz) $U_{\infty}$ $\frac{\alpha}{\beta}$},
ylabel={frequency (Hz) $U_{\infty}$ $\frac{\alpha}{\beta}$},
...
\end{axis}
\end{tikzpicture}

won't work (while the same code with \tiny instead of \tinyb would work and change every annotation, label, ticklabel etc. to \tiny)! So I need to redefine \tiny in a way that it behaves like \tinyb or create a newcommand \tinyc that behaves like \tiny but looks like \tinyb. But I could't find out how to change the streching behaviour for different fontsizes. Basically I want that LaTeX properly scales the text in width and height as it would look for \normalsize - specificly for the \tiny and \scriptsize command because the stretching effect is extreme there... and I need a command for that, which must be defined globally and can be set on and off easily for whole sections.

Does anyone know how to do it?

I guess there must be an easy solution, maybe with some packages that allow changing of letterspacing and/or kerning but I actually don't know the right search term for the problem that the letters seem to be stretched with respect to their width... (neither letterspacing nor kerning seem to fit to the problem)

naphaneal
  • 2,614
phw
  • 343
  • 8
    latex fontsize commands typically don't stretch at all, or if they do they stretch uniformly. For some font families (including computer modern and latin modern) the font designer has provided the font at several design sizes so the small fonts are not scaled versions of the large ones, but glyphs designed to be read at a small size. – David Carlisle Sep 06 '16 at 12:32
  • 2
    note the font size commands do not take an argument, the usage should be \tiny abc not \tiny{abc} – David Carlisle Sep 06 '16 at 12:35
  • 7
    I think the very premise of your posting -- "The fontsize commands for fontsizes smaller than \normalsize stretch the aspect ratio of the letters or stretch the letters itself plus their spacing instead of properly scaling the text in width and height (with respect to \normalsize)" [emphasis added] is wrong -- at least for Computer Modern fonts, which are optically rather than mechanically sized. Optical sizing is not "stretching letters plus their spacing". – Mico Sep 06 '16 at 14:14
  • 1
    @DavidCarlisle and @Mico : Thanks for explaining these aspects to me. I am now aware that the behaviour of \tiny is absolutly intended and probably very useful (for legibility). Anyway I am looking for a solution as I can live with the tradeoff to use a less legible tiny font (as shown in my example with \tinyb) in order to be able to annotate legends properly (needing enough horizontal space for that...), especially while knowing that most documents are read as pdf on a large, high res. screens with +177% or even more in pdf zoom... and one click or touch to zoom even more in detail... – phw Sep 07 '16 at 11:57

4 Answers4

17

You should look up what "optical sizing" of fonts entails. (Computer Modern is an example of a font family with optically sized letters at various font sizes.) Letters that are sized optically for \tiny are not ordinary letters reduced linearly by 50%, and they are not simply horizontally stretched either. Instead, they are individually re-drawn, with proportionately thicker strokes, and they are spaced more loosely, all so that they remain legible even though they're only half as tall as \normalsize letters. Conversely, optically-sized \huge letters are deliberately drawn with thinner strokes, and they are spaced more tightly, all so that they don't look too "heavy" even though the height of \huge letters is more than twice that of \normalsize.

The following table shows various words typeset at their "native" 10pt size on the left and linearly enlarged or reduced from having been typeset at \tiny, \scriptsize, \footnotesize, etc through \huge sizes. Note that the letters in the resized words look progressively thinner and are spaced more tightly as you move down the right-hand column of the table.

enter image description here

\documentclass{article}
\usepackage{graphicx,lmodern}
\begin{document}
\begin{tabular}{rl}
basic 10pt    & scaled \\
\hline
five    & \scalebox{2}{\tiny five}\\
seven   & \scalebox{1.429}{\scriptsize seven}\\
eight   & \scalebox{1.25}{\footnotesize eight}\\
twelve  & \scalebox{0.833}{\large twelve}\\
fourteen& \scalebox{0.694}{\Large fourteen}\\
twenty  & \scalebox{0.482}{\huge twenty}\\
\end{tabular}
\end{document} 

Addendum: Another way to think about what optical scaling does is to superimpose words natively set at \normalsize with the same words, linearly scaled from their optically sized \tiny, \scriptsize, etc through \huge versions. In the following screenshot, the native-\normalsize letters are rendered in black and the rescaled optically sized words are rendered in red. Observe that optical sizing entails (a) changing the widths of the strokes used for various glyphs as well as (b) changing the kerning between letters in word. It's far more sophisticated than performing a horizontal stretch.

enter image description here

\documentclass{article}
\usepackage{lmodern,graphicx,xcolor}
\begin{document}
\obeylines
five\kern-15.6pt\textcolor{red}{\scalebox{2}{\tiny five}}
seven\kern-23.45pt\textcolor{red}{\scalebox{1.429}{\scriptsize seven}}
eight\kern-21.4pt\textcolor{red}{\scalebox{1.25}{\footnotesize eight}}
twelve\kern-27.18pt\textcolor{red}{\scalebox{0.833}{\large twelve}}
fourteen\kern-35.8pt\textcolor{red}{\scalebox{0.694}{\Large fourteen}}
twenty\kern-29.05pt\textcolor{red}{\scalebox{0.482}{\huge twenty}}
\end{document}
Mico
  • 506,678
  • Thank you very much for shedding light on this topic. I already guesses that it is some 'problem' like that. Anyway: in my specific case (\tiny and \scriptsize are typically only used for graphic legends and/or annotations and/or labels, which need to be as small as possible with respect to their width, if I want to place more than one or two words or math symbols and still be able to see the rest of the actual graphs). Is there a solution that would behave exactly like \tiny (and working in math mode) but use a shrinked width, until overwritten by another command such as \normalsize? – phw Sep 07 '16 at 05:43
  • 1
    @phw - By using either \scriptsize or \tiny for the caption and annotation items, you're already making sure that such items take up a lot less space than they would at \footnotesize, let alone \normalsize. For Computer Modern, the fonts that are selected for \tiny and \scriptsize material are optimized -- after all, that's what optical scaling is all about -- for legibility at those sizes. Any space gains you may achieve by using non-optimized fonts at these sizes will almost certainly be outweighed by a noticeable loss of legibility. In short, do be aware of this trade-off. – Mico Sep 07 '16 at 10:37
  • You're right of course. But indeed I want to show several figures with graphs (e.g. side by side figures), which have individual legends. And the space available for the text in the legend is really really short, even when using \footnotesize. I noticed that the gain of "width" when using \tiny compared to \footnotesize is not that much, as tiny really looks stretched in width (for the purpose of legibility, I know). So I am looking for a proper solution as described, anyway - beeing aware of all this; especially beeing aware of high res. screens and the ability to read pdfs at +150%... – phw Sep 07 '16 at 11:46
  • 1
    @phw - If space for the captions and legends is truly so limited in your document, your first priority should be to make the captions and legends more concise, say, by omitting all material that's not absolutely essential. Remember the saying from Hamlet, "Brevity is the soul of wit." Be brief, and write down only what absolutely needs to be expressed, rather than find a suboptimal scaling of fonts... Your readers will be most grateful for this act of kindness. – Mico Sep 07 '16 at 13:31
6

As has been explained in comments and other answers, it is not latex that is scaling the fonts, it is just choosing the fonts designed for that size.

If you do not like the font choice you can change it here I specify that the 10pt font is to be used scaled for all sizes (I just did roman and math italic, you may need to do more) In general such scaling is considered to make a poorer less legible result than using optically scaled fonts at their design size, but all these things are a subjective choice.

enter image description here

\documentclass[12pt,a4paper,ngerman]{scrbook}
 \usepackage[T1]{fontenc}
 \usepackage{lmodern}
 \usepackage[utf8]{inputenc}
 \usepackage{amsmath,amsfonts,amssymb,amsxtra}
 \usepackage[ngerman]{babel}
 \usepackage{graphicx}

 \newcommand{\tinyb}[1]{\scalebox{0.5}{{\normalsize #1}}}
 %\newcommand{\scriptsizeb}[1]{\scalebox{0.66667}{{\normalsize #1}}}
\DeclareFontFamily{T1}{lmr}{}
\DeclareFontShape{T1}{lmr}{m}{n}%
     {<->    ec-lmr10
      }{}

\DeclareFontFamily{OML}{lmm}{\skewchar\font127 }
\DeclareFontShape{OML}{lmm}{m}{it}%
     {<->  lmmi10
      }{}

 \begin{document}
 \begin{itemize}
      \item {\tiny Tiny tiny Tiny TINY tiny (original \textbackslash tiny)} \hspace{.2cm} {\tinyb{Tiny tiny Tiny TINY tiny (custom \textbackslash tinyb)}}
      \item {\tinyb{Tiny tiny Tiny TINY tiny (custom \textbackslash tinyb)}}
      \item {\normalsize Tiny tiny Tiny TINY tiny (original \textbackslash normalsize)}
      \item {\tiny{$U_{\infty}=f\cdot a\cdot \frac{\alpha}{\beta}$ (original \textbackslash tiny)}} \hspace{.2cm} {\tinyb{$U_{\infty}=f\cdot a\cdot \frac{\alpha}{\beta}$ (custom \textbackslash tinyb)}}
      \item {\tinyb{$U_{\infty}=f\cdot a\cdot \frac{\alpha}{\beta}$ (custom \textbackslash tinyb)}}
      %\item {\scriptsizeScriptsize SCRIPTSIZE (original \textbackslash scriptsize)} \hspace{.2cm} {\scriptsizeb{Scriptsize SCRIPTSIZE (custom \textbackslash scriptsizeb)}}
      %\item {\scriptsizeb{Scriptsize SCRIPTSIZE (custom \textbackslash scriptsizeb)}}
 \end{itemize}
 \end{document}
David Carlisle
  • 757,742
  • 1
    I'm not sure that legibility is exactly subjective. Wouldn't it be better to use a font designed to be one-size-fits-all? While such fonts are not generally considered such high quality, if you don't want that quality, then the compromises the designer makes to allow for scaling (if the font is well-designed) would be an advantage. – cfr Sep 06 '16 at 18:38
  • 2
    @cfr probably yes, although the code here is more intended of how to get the requested effect without using scalebox rather than a demonstration of something to be recommended in a document, and in general it is not unreasonable to use modified .fd declarations to get different choices in fonts at certain sizes, even if the extreme of using 10pt font everywhere is not used. – David Carlisle Sep 06 '16 at 18:51
  • Indeed, I think it can sometimes work well and be quite reasonable. I just find 10pt Latin Modern scaled to \tiny almost illegible. After all, it was really not designed for that! – cfr Sep 06 '16 at 19:16
  • Thanks for your response. The solution at which I was aiming at in my original post would work in math mode and text mode and provide alternative commands (e.g. \tinyb or \scriptsizeb) that are usable in an identical way like \tiny or \scriptsize: turn on or turn off until overwritten by another command such as \normalsize, so the specific commands are not allowed to involve an \mbox or similar. Is that possible somehow? The provided solution is the same like in my own example, right?: I would have to use \tinybwith brackets {}, in which only the command affected the fontsize. – phw Sep 07 '16 at 05:34
  • @phw odd response;-) the redefinitions above do of course affect math mode as well as text mode, and address the issue that took up by far the largest part of your question which was the misunderstanding that latex scales the fonts and stretches them horizontally. – David Carlisle Sep 07 '16 at 06:42
  • Maybe I got something wrong: In your example (picture), when using \tiny in Math mode, the result looks exactly like in my own example (a lot wider than with the \tinybmacro). That's what I meaned with "the solution should work in math mode". Is it possible to introduce an alternative command, without overwriting the global fontsettings for the whole document? I mean alternative commands, e.g. \tinyb and \scriptsizeb, which alter the font style (lmr-10 based shrink) until overwritten by a command like \normalsize instead of forcing lmr-10 style for the whole document in general? – phw Sep 07 '16 at 07:13
  • 1
    @phw you can not use size change commands in math mode, but if you use math at the small size, it is affected. Yes of course you could define a new font family lmr2 say instead of lmr and then just copy the lm fd files, to lm2 fd files, changing the definitions as you go, then just switch via \fontfamily{lmr2}\selectfont – David Carlisle Sep 07 '16 at 07:47
5

Perhaps something like this, with the use of \DeclareFontShape, to tell LaTeX to always use the the 10pt font to construct everything else.

EDITED to employ the otherwise unused "bold-scshape" as the placeholder for the fixed-width version of the font (which is invoked in the tinyb environment).

RE-EDITED to make math font of fixed shape in tinyb environment. Originally, it substituted the fixed shape operators in non-tinyb math, as well. THis was remedied by declaring a new math version to be invoked in the tinyb environment only.

Shown for LMODERN (a scalable T1 encoded font)

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{lmodern}
%%% TEXT FONT FIX
\rmfamily
\DeclareFontShape{T1}{lmr}{bx}{sc}{<-> cmr10}{}% USE BOLD SCSHAPE NOT OTHERWISE DEFINED
%%% MATH FONT FIX
\DeclareFontFamily{OML}{zlmm}{}
\DeclareFontShape{OML}{zlmm}{m}{it}{<-> lmmi10}{}
\DeclareFontShape{OML}{zlmm}{b}{it}{<->ssub * zlmm/m/it}{}
\DeclareFontShape{OML}{zlmm}{bx}{it}{<->ssub * zlmm/m/it}{}

\DeclareMathVersion{Tinyb}
\SetSymbolFont{operators}{Tinyb}{T1}{lmr}{bx}{sc}
\SetSymbolFont{letters}{Tinyb}{OML}{zlmm}{m}{it}
%%%
\newenvironment{tinyb}{\bgroup\tiny\bfseries\scshape\mathversion{Tinyb}}{\egroup} % edit: now with \tiny included
\begin{document}
\newcommand\mytext[1]{\normalsize This is a test #1\par
  \small \scalebox{1.11}{This is a test} This is a test \par
  \footnotesize \scalebox{1.25}{This is a test} This is a test \par
  \scriptsize \scalebox{1.425}{This is a test} This is a test \par
  \tiny \scalebox{2}{This is a test} This is a test\par\normalsize
}
\newcommand\mymath{\normalsize$y = mx + b - 3f^2 + \sin (\omega x - \tau)$\par
  \tiny$y = mx + b - 3f^2 + \sin (\omega x - \tau)$\par\normalsize}

\mytext{of the normal}

\begin{tinyb}
\mytext{of the fixed scale}
\end{tinyb}

\mymath

\begin{tinyb}
\mymath
\end{tinyb}
\end{document}

enter image description here

The OP seems very much to not want to use a tinyb environment, but rather a \tinyb macro. Here is a possibility that suffers one shortcoming...and that is any font size changing command will place the font in \mdseries\upshape mode, as well.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{lmodern}
%%% TEXT FONT FIX
\rmfamily
\DeclareFontShape{T1}{lmr}{bx}{sc}{<-> cmr10}{}% USE BOLD SCSHAPE NOT OTHERWISE DEFINED
%%% MATH FONT FIX
\DeclareFontFamily{OML}{zlmm}{}
\DeclareFontShape{OML}{zlmm}{m}{it}{<-> lmmi10}{}
\DeclareFontShape{OML}{zlmm}{b}{it}{<->ssub * zlmm/m/it}{}
\DeclareFontShape{OML}{zlmm}{bx}{it}{<->ssub * zlmm/m/it}{}

\DeclareMathVersion{Tinyb}
\SetSymbolFont{operators}{Tinyb}{T1}{lmr}{bx}{sc}
\SetSymbolFont{letters}{Tinyb}{OML}{zlmm}{m}{it}
%%%
\def\invokemode{\bfseries\scshape\mathversion{Tinyb}}
\def\restoremode{\mdseries\upshape\mathversion{normal}}
\newcommand\adapt[1]{%
  \expandafter\let\csname sv#1\expandafter\endcsname\csname#1\endcsname%
  \expandafter\def\csname#1\endcsname{\restoremode\csname sv#1\endcsname}
  \expandafter\def\csname#1b\endcsname{\invokemode\csname sv#1\endcsname}
}
\adapt{tiny}\adapt{scriptsize}\adapt{footnotesize}\adapt{small}\adapt{normalsize}
\adapt{large}\adapt{Large}\adapt{LARGE}\adapt{huge}\adapt{Huge}
\begin{document}
 \tiny Hello World \par 
 \tinyb Hello World \par 
 \tiny Hello World \par 
 \tiny $a^{2} + b^{2} = c^{2}$ \par 
 \tinyb $a^{2} + b^{2} = c^{2}$ \par 
 \tiny $a^{2} + b^{2} = c^{2}$ 
\end{document}

enter image description here

phw
  • 343
  • Is it possible to alter the command that only \tiny and \scriptsize are based on lmr12 and that it also works in math mode - as it is not a bad thing that there is an individual redrawn font for each fontsize in general (especially for prose text!). But in my specific case (\tiny and \scriptsize are typically only used for graphic legends and/or annotations and/or labels, which need to be as small as possible with respect to their width, if I want to place more than one or two words/symbols and still be able to see the rest of the graph). – phw Sep 07 '16 at 05:30
  • The perfect solution at which I was aiming at in my original post would work in math mode and text mode and would provide alternative commands (e.g. \tinyb or \scriptsizeb) that are usable in an identical way like \tiny or \scriptsize: turn on or turn off until overwritten by another command such as \normalsize, so the specific commands do not have to involve an \mbox or similar. Is that possible somehow? – phw Sep 07 '16 at 05:30
  • @phw I have accomplished it for the text font (see edit). I am still contemplating the math font. – Steven B. Segletes Sep 07 '16 at 10:19
  • Thanks so far, this goes exactly in the direction I aimed to. But I didn't fully understand your command, especially I am wondering why I am getting warnings about missing fonts, when using your minimal example: LaTeX Font Warning: Font shape T1/lmr/m/n undefined (Font) using T1/cmr/m/n' instead on input line 8. LaTeX Font Warning: Font shape T1/lmr/bx/n undefined (Font) using T1/lmr/m/n instead on input line 17. LaTeX Font Warning: Some font shapes were not available, defaults substituted. – phw Sep 07 '16 at 12:24
  • @phw I believe I have a fix for the math issue, as well. – Steven B. Segletes Sep 07 '16 at 15:14
  • Unfortunately there are still some things that don't work as I hoped, e.g. use your code (preamble) and then try: \begin{document} \par \tiny Hello World \par \tinyb Hello World \par \tiny Hello World \par \tiny $a^{2} + b^{2} = c^{2}$ \par \tinyb $a^{2} + b^{2} = c^{2}$ \par \tiny $a^{2} + b^{2} = c^{2}$ \end{document}

    The environment does not seem to work properly, yet. At the moment the \tiny command won't be able to alter the effect of \tinyb - so the implementation enforces the usage \begin(tinyb) \end(tinyb)

    – phw Sep 08 '16 at 15:11
  • @phw Yes, it is an environment, not a macro, and therefore needs an \end{tinyb} – Steven B. Segletes Sep 08 '16 at 15:28
  • @phw Please see my revision. The environment version is, however, better, as it suffers no ill side effects. – Steven B. Segletes Sep 08 '16 at 17:58
  • Thank you. I'll try it. Side effects - such as? The reason why I mentioned the environment thing is that simple commands like \tiny work, even if I am placing \tiny outside a tikzpicture environment (they affect all labels, ticks, legend entries within the tikzspicture environment). When I am using \begin{tinyb} and \end{tinyb} around the tikzfigure environment, no effects will be noticed (in fact the font type will switch to CMR10 - as I noticed by inspection with Adobe Acrobat, but the fontsizes will just remain normalsize). Is that behavior intended? – phw Sep 09 '16 at 05:20
  • One other question is: Is it correct that your workaround only works if using CMR10 as a replacement? I can't change to LMR12 or something like that as the base font, right? – phw Sep 09 '16 at 05:21
  • @phw side effects such as mentioned with my alternate answer: \itshape...\tiny xyz will set xyz in \upshape, since the revised \tiny resets the font shape and series. This is not what \tiny should be doing. It may work for other fonts, but I am not enough of an expert to guarantee it. You should try and see. – Steven B. Segletes Sep 09 '16 at 10:48
  • Is that behavior intended? Oops, I think a \tiny needs to be added to the tinyb environment definition as, currently, it changes everything needed except the font size! – Steven B. Segletes Sep 09 '16 at 10:53
  • You mean \newenvironment{tinyb}{\bgroup\bfseries\scshape\mathversion{Tinyb}}{\egroup} in this code line \tiny should be added - or where exactly? – phw Sep 09 '16 at 13:38
  • @phw Yes, something like \newenvironment{tinyb}{\bgroup\tiny\bfseries\scshape\mathversion{‌​Tinyb}}{\egroup} – Steven B. Segletes Sep 09 '16 at 15:50
  • Thanks a lot for your help Steven. I realized that the task was not that easy to accomplish and your solution does not 'exactly' what I originally asked for but it works with some minor drawbacks. It is not the cleanest solution as one, for instance, couldn't switch to another font without having to adjust the script, etc., but I like it anyway. Thanks so far! I have also to admit that all the others are truly right with their objections that \tinyis exactly in that way as it is meant to be for legibility reasons and one should better consider to avoid what I am trying to do :-) – phw Sep 13 '16 at 05:58
  • @Steven B. Segletes I have the same issue as the OP. \tiny looks bad. I also need a macro to set something like "label style={font=\tinyb}" Your code should work but i am wondering if it does change anything of the other font-settings as the code seems to ber ver ylong and i don't understand everything. So ist just provide a new macro without any other changes in the other fonts like \normalsize? I was also wondering where you use the \scalebox to make the font smaller – SRel Aug 26 '18 at 20:34
  • I used the code and accented characters are not printed. What sould I do ? – Flowt Aug 18 '23 at 16:24
  • @Flowt I cannot see why accented characters would not print. – Steven B. Segletes Aug 18 '23 at 17:05
  • @StevenB.Segletes I don't know why it does this but if you take your first code, replace every This is a test by for e.g. This is a testéàèù, then the accented characters do not print. – Flowt Aug 20 '23 at 14:21
  • I think the issue is the cmr font. Try \DeclareFontShape{T1}{lmr}{bx}{sc}{<-> ec-lmr10}{} instead of \DeclareFontShape{T1}{lmr}{bx}{sc}{<-> cmr10}{} – Steven B. Segletes Aug 20 '23 at 16:57
2

Edited to add: If zooming by the user is an allowed solution, an extreme example is at How to get an even smaller font?. Just make the scale factor an inverse of the zoom (and use a scalable font, of course).

Or even better: An experiment:

Some ordinary text, actual size:

actual size

Zooming in to the notes:

first InfoDot

And then the notes to the notes (this is x19462% magnification):

Second InfoDot

Conclusion: TeX is brilliant!

This method uses nested minipages, where the linewidth adjusts to the outer minipage's width. But the baselineskip doesn't auto-adjust (for obvious reasons: original design), so is adjusted manually.

Nesting is unlimited, I presume (well, the wavelength of visible light is a constraint). Next potential step is a TikZ-path version following the inside contours of a letter.

MWE:

\documentclass{article}
\usepackage{fontspec}
\usepackage{xcolor}
\usepackage{lipsum}
\setmainfont{Noto Serif}
\newfontface\ftsmall[Scale=0.25,Colour=blue]{Noto Serif}
\newfontface\ftvsmall[Scale=0.02,Colour=red]{Noto Serif}
\begin{document}
\begin{enumerate}
\item Here is some text, with some notes $\to$
\begin{minipage}{0.1\linewidth}
x\baselineskip2pt
{\ftsmall{\tiny \lipsum[2] And here is another InfoDot:}}
\begin{minipage}{0.1\linewidth}
{\ftsmall{\tiny y}}\par\baselineskip0.2pt
{\ftvsmall{\tiny \lipsum[3] And that is the end of the demonstration.}} 
\end{minipage}
\end{minipage}
\end{enumerate}
\end{document}

=== Original post:

For text, generally sans-serif seems easier to read at smaller sizes than serif. Verdana was designed for small size readability. Scaling the font does not add any value in this context.

sans for small

For maths, the experimental mathspec package, using fontspec in the background, might be worth a look. It has too many options and switches for a quick mastery in one post though, so would repay careful study. An alternative is unicode-math, which also uses fontspec but in a different way. The nub of the question seems to be about scalable fonts.

Here is mathspec, with a random font and default settings:

maths tryout

An abundance of fonts to choose from, in combinations of various subsets, does not make the task easier.

MWE:

\documentclass{article}
%\usepackage{fontspec}
\usepackage[MnSymbol]{mathspec}
\setmainfont{Noto Serif}
\setmathsfont(Digits,Latin){Noto Serif}%TeX Gyre Termes Math}
\setmathsfont(Greek){FreeSerif}
\setmathrm{TeX Gyre Bonum Math}%Symbola}%Cambria Math}%TeX Gyre Schola Math}
%STIX Math}%Quivira}%Noto Sans Symbols}%Libertinus Math}%Hayashi-Serif}%FreeSerif}%DejaVu Math}%Arial Unicode MS}%Minion Pro}%Cambria Math}%GFS Porson}
\usepackage{xcolor}
\newfontface\ftsmall[Scale=0.5,Colour=blue]{Noto Serif}
\newfontface\ftverdana{Verdana}
\newfontface\ftvsmall[Scale=0.5,Colour=blue]{Verdana}
\begin{document}
Noto Serif
\begin{tabular}{rl}
\tiny abc wqerty & \ftsmall\tiny abc wqerty \\
\scriptsize  abc wqerty &  \ftsmall\scriptsize abc wqerty \\
\footnotesize  abc wqerty & \ftsmall\footnotesize abc wqerty \\
\small  abc wqerty & \ftsmall\small abc wqerty \\
\normalsize  abc wqerty & \ftsmall\normalsize abc wqerty \\
\large abc wqerty & \ftsmall\large abc wqerty \\
\Large abc wqerty & \ftsmall\Large abc wqerty \\
\LARGE abc wqerty & \ftsmall\LARGE abc wqerty \\
\huge abc wqerty & \ftsmall\huge abc wqerty \\
\Huge abc wqerty & \ftsmall\Huge abc wqerty \\
\end{tabular}

\ftverdana
Verdana
\begin{tabular}{rl}
\tiny abc wqerty & \ftvsmall\tiny abc wqerty \\
\scriptsize  abc wqerty &  \ftvsmall\scriptsize abc wqerty \\
\footnotesize  abc wqerty & \ftvsmall\footnotesize abc wqerty \\
\small  abc wqerty & \ftvsmall\small abc wqerty \\
\normalsize  abc wqerty & \ftvsmall\normalsize abc wqerty \\
\large abc wqerty & \ftvsmall\large abc wqerty \\
\Large abc wqerty & \ftvsmall\Large abc wqerty \\
\LARGE abc wqerty & \ftvsmall\LARGE abc wqerty \\
\huge abc wqerty & \ftvsmall\huge abc wqerty \\
\Huge abc wqerty & \ftvsmall\Huge abc wqerty \\
\end{tabular}

\newpage
\normalfont
Maths
\begin{tabular}{r}
\tiny $U_{\infty}=f\cdot a\cdot \frac{\alpha}{\beta}$ \\
\scriptsize $U_{\infty}=f\cdot a\cdot \frac{\alpha}{\beta}$ \\
\footnotesize  $U_{\infty}=f\cdot a\cdot \frac{\alpha}{\beta}$ \\
\small   $U_{\infty}=f\cdot a\cdot \frac{\alpha}{\beta}$ \\
\normalsize  $U_{\infty}=f\cdot a\cdot \frac{\alpha}{\beta}$ \\
\large  $U_{\infty}=f\cdot a\cdot \frac{\alpha}{\beta}$ \\
\Large  $U_{\infty}=f\cdot a\cdot \frac{\alpha}{\beta}$ \\
\LARGE  $U_{\infty}=f\cdot a\cdot \frac{\alpha}{\beta}$ \\
\huge  $U_{\infty}=f\cdot a\cdot \frac{\alpha}{\beta}$ \\
\Huge  $U_{\infty}=f\cdot a\cdot \frac{\alpha}{\beta}$ \\
\end{tabular}

\begin{tabular}{r}
\tiny $a^{2} + b^{2} = c^{2}$ \\
\scriptsize $a^{2} + b^{2} = c^{2}$ \\
\footnotesize  $a^{2} + b^{2} = c^{2}$ \\
\small   $a^{2} + b^{2} = c^{2}$ \\
\normalsize  $a^{2} + b^{2} = c^{2}$ \\
\large  $a^{2} + b^{2} = c^{2}$ \\
\Large  $a^{2} + b^{2} = c^{2}$ \\
\LARGE  $a^{2} + b^{2} = c^{2}$ \\
\huge  $a^{2} + b^{2} = c^{2}$ \\
\Huge  $a^{2} + b^{2} = c^{2}$ \\
\end{tabular}




\end{document}
Cicada
  • 10,129