I am using 12pt fonts with what is essentially the article
class. (That is, I'm using a custom class which is parasitic on article.cls
.)
In order to set an appropriate headheight
for fancyhdr
using \geometry{}
, I test the font size at the end of the preamble using \AtEndPreamble{}
from etoolbox
. The height is then adjusted according to whether 10pt, 11pt or 12pt is being used.
This all works fine with the following code:
\documentclass[12pt]{article}
\usepackage{etoolbox}
\usepackage[T1]{fontenc}
\makeatletter
\AtEndPreamble{%
\PackageWarning{mine}{font size is \f@size}
}
\makeatother
\begin{document}
some text
\end{document}
The log contains:
Package mine Warning: font size is 12 on input line 13.
However, if I need to typeset Greek, I want to use:
\documentclass[12pt]{article}
\usepackage{etoolbox}
\usepackage[LGR,T1]{fontenc}
\makeatletter
\AtEndPreamble{%
\PackageWarning{mine}{font size is \f@size}
}
\makeatother
\begin{document}
some text
\end{document}
Only now the log contains:
Package mine Warning: font size is 10 on input line 13.
Why does loading the LGR encoding change the font size at all? And why does it change it even when T1 is the default encoding?
How can I prevent or work around this problem?
Note that I am aware that I could use XeTeX or LuaTeX or ConTeXt to avoid this. However, for better or worse, this question is about a (pdf)TeX solution.
If there is an alternative way of typesetting small amounts of Greek text using (pdf)TeX, that would be perfectly satisfactory. I use the above with utf8
and inputenc
which allows me to input the odd Greek phrase in unicode characters and have everything typeset nicely. Anything which supports that would work fine.
This question seemed related but I am using TeX Live and already have the relevant type1 fonts installed (e.g. /usr/local/texlive/2014/texmf-dist/fonts/type1/public/cbfonts/grmn1200.pfb
).
\AtEndPreamble
is a test in a class/package file which tests which font size has been selected in the document. It would defeat the purpose to hard code a value since in that case, I might as well just hard code theheadheight
.\normalsize
has been issued, which it is at\begin{document}
.