[tex-eplain] boldface greek symbols

Daniel H. Luecking luecking at uark.edu
Sun Aug 27 22:41:34 CEST 2023


One could copy the definitions of the Greek letters in plain.tex
with appropriate modifications. These look like
\mathchardef\alpha="010B
\mathchardef\beta="010C
...etc.
where, e.g., the hexadecimal number "010B means
0 : it is an ordinary symbol
1 : it comes from family 1 (cmmi)
0B: alpha is in slot "0B = 11

One need only change the 1 to the number of the new family for cmmib.
We can do this by hand, or do the following to let TeX do some of the work:

\catcode`\@=\catcode`a
% Load necessary fonts
\font\tenmib=cmmib10
\font\sevenmib=cmmib7
\font\fivemib=cmmib5

% set up a new math family and a means to switch to it
\newfam  \mibfam
\textfont\mibfam=\tenmib
\scriptfont\mibfam=\sevenmib
\scriptscriptfont\mibfam=\fivemib
\def\mib{\fam\mibfam\tenmib}
%
% plain.tex says \mathchardef\mu="0116
% We need to change that first 1 to whatever family \mibfam is
% This amounts to adding a multiple of (hex) 0100 = (dec) 256
%
\newcount\familyshift

\familyshift=\mibfam
% \showthe \familyshift % this is 8 in plain TeX
\advance \familyshift-1
\multiply\familyshift by "100
% \showthe \familyshift % this is now 7 in plain TeX
%
% Calculations for a bold \mu:
\count@=\mu % temporary count equals "0116
\advance\count@\familyshift  % now equals "0816
\mathchardef\boldmu\count@  % \boldmu is slot "16 in family 8.

Example:
$\mu\boldmu A_\boldmu {\mib A}_\mu$
\bye

Daniel H. Luecking [luecking at uark.edu]
Department of Mathematical Sciences
1 University of Arkansas
Fayetteville, AR, USA 72701-1201
________________________________
From: tex-eplain <tex-eplain-bounces+luecking=uark.edu at tug.org> on behalf of Gérald Tenenbaum <gerald.tenenbaum at univ-lorraine.fr>
Sent: Sunday, August 27, 2023 12:57 PM
To: Laurence.Finston at gmx.net <Laurence.Finston at gmx.net>
Cc: Eplain <tex-eplain at tug.org>
Subject: Re: [tex-eplain] boldface greek symbols

Thanks.
However it does not seem to work with \vartheta :

\input eplain

\font\tengp=cmmib10
\newfam\gpfam
\textfont\gpfam=\tengp
\def\gp{\fam\gpfam\textfont1=\tengp}
\def\gth{\hbox{$\gp\vartheta$}}
%$\gth\neq\vartheta$
\bigskip

\newfam\gbfam
\font\gbten=cmmib10
\font\gbeight=cmmib10 scaled 800
\font\gbseven=cmmib10 scaled 700
\textfont\gbfam=\gbten
\scriptfont\gbfam=\gbeight
\scriptscriptfont\gbfam=\gbseven
\def\gb{\fam\gbfam\gbten}
\def\grth{{\gb\vartheta}}

$\grth\neq\gth$

Laurence.Finston at gmx.net<mailto:Laurence.Finston at gmx.net> a écrit le 27/8/23 à 18:09 :
> This is wrong.  You're resetting \textfont1.  You need to set \textfont\gpfam.

Like I said, \gbfam and \gbifam (in this case) are numbers:

\tracingonline=1
\showthe\gbifam
\showthe\gbfam

-->


This is TeX, Version 3.141592653 (TeX Live 2022/dev/Debian) (preloaded format=tex)
(./ttemp.tex
> 8.
l.32 \showthe\gbifam

?
> 9.
l.34 \showthe\gbfam

They are thus family 8 and 9, respectively and \textfont\gbifam and \textfont\gbfam are equivalent to \textfont8 and \textfont9, respectively.


Gesendet: Sonntag, 27. August 2023 um 17:48 Uhr
Von: Laurence.Finston at gmx.net<mailto:Laurence.Finston at gmx.net>
An: "Gérald Tenenbaum" <gerald.tenenbaum at univ-lorraine.fr><mailto:gerald.tenenbaum at univ-lorraine.fr>
Cc: "Eplain" <tex-eplain at tug.org><mailto:tex-eplain at tug.org>
Betreff: Aw: Re: [tex-eplain] boldface greek symbols
%% Normal italic:

\newfam\gbifam
\font\gbiten=cmmi10
\font\gbieight=cmmi10 scaled 800
\font\gbiseven=cmmi10 scaled 700
\def\gbi{\fam\gbifam\gbiten}
\textfont\gbifam=\gbiten
\scriptfont\gbifam=\gbieight
\scriptscriptfont\gbifam=\gbiseven

%% Bold italic:

\newfam\gbfam
\font\gbten=cmmib10
\font\gbeight=cmmib10 scaled 800
\font\gbseven=cmmib10 scaled 700
\textfont\gbfam=\gbten
\scriptfont\gbfam=\gbeight
\scriptscriptfont\gbfam=\gbseven
\def\gb{\fam\gbfam\gbten}

Normal Italic:  $\gbi{\Delta_\Omega}$

Bold Italic:  $\gb{\Delta_\Omega}$

\bye

See ttemp.dvi (attached)


Gesendet: Sonntag, 27. August 2023 um 17:19 Uhr
Von: Laurence.Finston at gmx.net<mailto:Laurence.Finston at gmx.net>
An: "Gérald Tenenbaum" <gerald.tenenbaum at univ-lorraine.fr><mailto:gerald.tenenbaum at univ-lorraine.fr>
Betreff: Aw: Re: [tex-eplain] boldface greek symbols
> \def\gp{\fam\gpfam\textfont1=\tengp}

This is wrong.  You're resetting \textfont1.  You need to set \textfont\gpfam.

If you create a new family, you shouldn't need to write macros for the individual characters.  They should be in the proper positions in the font, if the font is encoded using the conventions of plain TeX.

Gesendet: Sonntag, 27. August 2023 um 15:44 Uhr
Von: "Gérald Tenenbaum" <gerald.tenenbaum at univ-lorraine.fr><mailto:gerald.tenenbaum at univ-lorraine.fr>
An: Laurence.Finston at gmx.net<mailto:Laurence.Finston at gmx.net>
Cc: "Eplain" <tex-eplain at tug.org><mailto:tex-eplain at tug.org>
Betreff: Re: [tex-eplain] boldface greek symbols
Thank you.

Here is indeed a working example

\input eplain
\font\tengp=cmmib10
\newfam\gpfam
\textfont\gpfam=\tengp
\def\gp{\fam\gpfam\textfont1=\tengp}
\def\gth{\hbox{$\gp\vartheta$}}
$\gth\neq\vartheta$
\end

However this would require distinct definitions for the same letter in distinct sizes.
The behavior therefore radically departs from standard use in which you can do, for instance,

\font\tenscaln=eusm10
\font\sevenscaln=eusm10 scaled 700
\newfam\scalnfam\textfont\scalnfam=\tenscaln\scriptfont\scalnfam=\sevenscaln
\def\scaln{\fam\scalnfam\tenscaln}%
\def\scal{\scaln}
\def\A{{\scaln A}}
\def\B{{\scaln B}}
$\A_\B$

Regards,

Gérald

Laurence.Finston at gmx.net<mailto:Laurence.Finston at gmx.net> a écrit le 27/8/23 à 15:13 :
First, you define a new family using \newfam.  This takes care of the problem that Philip brought up, because your new \boldgreek or \bg or whatever macro will change the family within its scope.  I think you can have 11 families or so and plain tex only uses 7 or something.  I don't remember the details.  It would be like this:

\newfam\boldgreekfam
\def\boldgreek{\fam\boldgreekfam\tenboldgreek}

\newfam just assigns a number.  If you know the number, you could use it instead of \boldgreekfam, but it's better not to.

Then you set \textfont, \scriptfont and \scriptscriptfont.  You might need to use scaling if this font isn't available in the sizes you need.
For example, \font\fiveboldgreek=cmboldgreek10 scaled 700.

I haven't tested this, so you may have to fiddle with it and/or refer to _The TeXbook_ (never a bad idea).

That is my attempt to answer your question.  My opinion is that it might be difficult to distinguish bold Greek characters in subscripts from ordinary Greek characters and that \bf and \rm are meant to be the exceptions rather than the rule.  However, to each his/her own.

If you have any problems, I'll be happy to try to make a working example.


Gesendet: Sonntag, 27. August 2023 um 12:44 Uhr
Von: "Gérald Tenenbaum" <gerald.tenenbaum at univ-lorraine.fr><mailto:gerald.tenenbaum at univ-lorraine.fr>
An: Laurence.Finston at gmx.net<mailto:Laurence.Finston at gmx.net>
Cc: "Eplain" <tex-eplain at tug.org><mailto:tex-eplain at tug.org>
Betreff: Re: Aw: Re: [tex-eplain] boldface greek symbols
So how would it work with bold greek?
When I tried this I get an error until I insert \hboxes

Laurence.Finston at gmx.net<mailto:Laurence.Finston at gmx.net> a écrit le 27/8/23 à 12:12 :
> Can't one design a setting working like \bf or \it ?

Sure.  This is how \bf is defined in plain.tex:

\newfam\bffam \def\bf{\fam\bffam\tenbf} % \bf is family 6
\textfont\bffam=\tenbf \scriptfont\bffam=\sevenbf
\scriptscriptfont\bffam=\fivebf


Gesendet: Sonntag, 27. August 2023 um 11:41 Uhr
Von: "Gérald Tenenbaum" <gerald.tenenbaum at univ-lorraine.fr><mailto:gerald.tenenbaum at univ-lorraine.fr>
An: "Philip Taylor (Hellenic Institute)" <P.Taylor at Hellenic-Institute.Uk><mailto:P.Taylor at Hellenic-Institute.Uk>
Cc: "Eplain" <tex-eplain at tug.org><mailto:tex-eplain at tug.org>
Betreff: Re: [tex-eplain] boldface greek symbols
Thanks.
Yes it suffices, but I also need these boldface letters in subscripts.
I am puzzled by the necessity of using \hbox. Can't one design a setting working like \bf or \it ?
Regards,

Gérald

Philip Taylor (Hellenic Institute) a écrit le 27/8/23 à 11:21 :
You don't appear to be using \gpfam, Gérald — will not the following suffice ?

\font \tengp = cmmib10
\def \gp {\textfont 1 = \tengp}
\def \gth {\hbox {$\gp \vartheta $}}
$\gth \neq \vartheta $
\end

--
Philip Taylor

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/tex-eplain/attachments/20230827/12fb800d/attachment-0001.htm>


More information about the tex-eplain mailing list.