olsak / OpTeX

OpTeX - LuaTeX format with extended Plain TeX macros
http://petr.olsak.net/optex/
35 stars 14 forks source link

\boldify does not work properly #27

Closed gromadan closed 3 years ago

gromadan commented 3 years ago

The macro \boldify does not seem to work properly. If you write

{\boldify A$A\it A$}

then the middle A is not bold. However, boldifying section titles works as the following already works fine

{\scalemain\typoscale[1000/1000]\boldify A $A\it A$}

Nevertheless, this stops working if you choose some other font family. Consider, for instance,

\fontfam[libertine]
\title Title $T$
\bye
gromadan commented 3 years ago

By the way, I am also not sure if it is desirable that \boldify turns everything in math except for the default math font into sans serif bold. For instance, you may use the notation $\phi_{\rm Alice}$ for something, where the name Alice is normally typeset by upright serif font, but then the boldified version $\boldify\phi_{\rm Alice}$ typesets Alice with the sans serif font.

olsak commented 3 years ago

Thanks for reporting. The issue {\boldify A$A\ir A$} and the issue $\phi_{\rm Alice}$ is (hopefully) corrected by my last commit. The issue \fontafm[libertine] is more complicated. The font is more bold (say semi-bold). Cf.:

\fontfam[libertine]
\let\realit=\it
\tit Title $T$ {\realit T}
\bye

The problem is that only few UnicodeMath fonts have its full bold variant (I know only KPfonts ans StixMath). So the macro \boldmath must load "faked-bold" Unicode math font. I used "embolden1.7". It seems to be not so "faked" but it is not fully bold, of course. This is compromise. You can elaborate with this coefficient in the \_boldunimath macro. Sorry, I don't know better (and simple) solution when fonts are missing.

gromadan commented 3 years ago

Great, thanks. With the fake bold, I can see there literally no difference. But the problem is on my side probably – it seems that I have an old version of LuaTEX, which does not have embolden at all yet. (Unfortunately, it does not raise any error or warning.)