> [...] is it possible to switch the ``mathematical fonts'' to > computer modern fonts shipped by TeX and how?
You can tell eqn which fonts to use with the "gfont", "grfont", and "gbfont" commands (see eqn manual page). > [...] to just typeset formulas in CM fonts and let other parts > in Times. I strongly recommend against doing this (using Computer Modern for the math and Times for the body text). This is what the "times" package for LaTeX did, and the results were never very good. (Now LaTeX has the "txfonts" package, which sets both math and body text in Times (and has greek characters that integrate quite nicely with the rest) and results in a much more pleasing appearance.) Computer Modern and Times are just too different to work well together. (Of course, if you're just talking about using individual characters from Computer Modern which are not available in other fonts, then I agree that having a character from another font is better than not having the character at all.) It's actually quite straightforward to make Computer Modern available to groff once you understand how the different parts work together. Here's a step-by-step description of what to do. I just tried this out, and unless I've forgotten to write something down, this should mostly work as-is. (Nevertheless, you may need to experiment and improvise at some places). Recipe: Chose appropriate directories for the font description and font files. For the following discussion I will refer to them as GROFF_FONT_PATH (usually something like /usr/share/groff/current/font, but I have mine in $HOME/lib/roff/font) PSDITDIR (this will then be $GROFF_FONT_PATH/devps) PFADIR (for the font files themselves) AFMDIR (for the font metrics) If you have a non-standard $PSDITDIR, also copy the "DESC", "prologue", and "download" files and the "generate" subdirectory into it. Obtain the computer modern fonts. You'll probably get a pfb and an afm file for each. Put the afm files into $AFMDIR. Convert the pfb files to pfa using "pfatops" from the groff distribution. Put the pfa files into $PFADIR. Add an appropriate line in your $PSDITDIR/download file for each font (pointing to the file in $PFADIR). Generate the font description files using "afmtodit" from the groff distribution. For example, afmtodit -e $PSDITDIR/generate/text.enc -d $PSDITDIR/DESC \ $AFMDIR/CMR10.afm $PSDITDIR/generate/textmap $PSDITDIR/CMR10 afmtodit -i 50 -e $PSDITDIR/generate/text.enc -d $PSDITDIR/DESC \ $AFMDIR/CMTI10.afm $PSDITDIR/generate/textmap $PSDITDIR/CMTI10 afmtodit -s -d $PSDITDIR/DESC \ $AFMDIR/CMSY10.afm $PSDITDIR/generate/symbolmap $PSDITDIR/CMSY10 afmtodit -s -d $PSDITDIR/DESC \ $AFMDIR/CMEX10.afm $PSDITDIR/generate/symbolmap $PSDITDIR/CMEX10 afmtodit -s -i 50 -e $PSDITDIR/generate/text.enc -d $PSDITDIR/DESC \ $AFMDIR/CMMI10.afm $PSDITDIR/generate/mathitalicmap $PSDITDIR/CMMI10 where mathitalicmap consists of the latin and greek letters (copy and paste from textmap and lgreekmap, and consider that some greek letters must be mapped to latin lookalikes: *o->o, *A->A, *B->B, *E->E, *Y->H, *I->I, *K->K, *M->M, *N->N, *O->O, *R->P, *T->T, *C->X, *Z->Z ). Create a file containing eqn definitions for use with Computer Modern fonts, say $CMEQNRC. You can source this file at the beginning of your document (you'll need to use soelim to make sure eqn sees the definitions), or you can explicitly tell eqn where to look for eqnrc with the -M flag (then, $CMEQNRC has to be named eqnrc). In this file, override some of the definitions of the groff distribution eqnrc, for example, sdefine inf %\[if]% (the infinity symbol in Computer Modern already has the appropriate size). Now, tweak the font description files. For example: * In CMR, alias "pl" to "+" and "eq" to "=" ("mi" is already aliased to "\-" in CMSY). * Create appropriate names for the symbols which exist in text and display sizes. For example, in $PSDITDIR/CMEX10, put something like "sumtext" in the first column for glyph "summationtext", and "sumdisp" in the first column for glyph "summationdisplay". Then in your $CMEQNRC, sdefine sum %{type "operator" vcenter \[sumtext]}% and in your macro definitions or in your document before a displayed equation .tr \[sumtext]\[sumdisp] and before a text equation .tr \[sumtext]\[sumtext] * Give appropriate names to the different-sized parentheses in $PSDITDIR/CMEX10, for example, parenleft0 [...] parenleftbig parenleft1 [...] parenleftBig parenleft2 [...] parenleftbigg parenleft3 [...] parenleftBigg [etc.] * Adjust subscript corrections for letters such as T, F, etc. in CMMI. * Tweak metrics for parenthesis-parts in $PSDITDIR/CMEX10. The parenthesis-parts are rounded instead of flat where they will connect to other parts, and you have to tell groff to imagine that they're slightly shorter so it'll overlap them a bit when stacking them up, otherwise you'll get a small indentation at each junction. (See right parenthesis around vector b in the attached pdf.) etc. And now the hard part: how can we convince eqn to use different fonts for different parts of equations, e.g., CMMI10 for body-size text and CMMI7 for subscripts? I don't know.
.\" eqn .\" ---------------------------------------------------------------- .fp 1 R CMR10 .fp 2 I CMTI10 .fp 3 MI CMMI10 .fp 4 SY CMSY10 .fp 5 SX CMEX10 .\" ---------------------------------------------------------------- .EQ delim $$ gfont MI sdefine inf %\[if]% sdefine sum %{type "operator" vcenter \[sumtext]}% sdefine int %{type "operator" vcenter \[inttext]}% sdefine dd % roman d % .EN .\" ---------------------------------------------------------------- .de EQ .br .tr \[inttext]\[intdisp] .tr \[sumtext]\[sumdisp] .nr EQ +1 .di XX .. .de EN .br .di .ne .8v+\\n(dnu .sp .8v .ta \\n(.lu/2uC (\\n(EQ)\t\\*(10 .sp .8v .tr \[sumtext]\[sumtext] .tr \[inttext]\[inttext] .. .de PP .br .. .\" ---------------------------------------------------------------- .po 3c .ll 21c-6c .sp 4c .ps 10 .vs 12 .\" ---------------------------------------------------------------- .ft 2 Hello .ft 1 world. .PP Plus, minus, and equal signs (should be properly aligned): .br $ alpha sup 2 + beta sup 2 = gamma sup 2 $ .br $ alpha sup 2 - beta sup 2 = gamma sup 2 $ .PP Inline equations: $ exp (x) = sum sub {i=0} sup inf x sup i back 10 / i ! , fwd 200 Gamma ( z ) = int sub 0 sup inf t sup {z - 1} e sup {- t} ^dd t . $ .PP Displayed equations: .EQ exp (x) = sum from {i^=^0} to inf { x sup i } over { i ! } , fwd 200 Gamma ( z ) = int sub 0 sup inf t sup {z - 1} e sup {- t} ^dd t . .EN .PP Large parentheses: $ left ( matrix { col { a sub 11 above a sub 21 } col { a sub 12 above a sub 22 } col { a sub 13 above a sub 23 } } right ) left ( pile { b sub 1 above b sub 2 above b sub 3 } right ) = left ( pile { c sub 1 above c sub 2 } right ) $ .PP By default, capital greek letters are found in the upright font first, .br $ Alpha Beta Gamma Delta Epsilon Zeta Eta Theta Iota Kappa Lambda Mu Nu Xi Omicron Pi Rho Sigma Tau Upsilon Phi Chi Psi Omega alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu nu xi omicron pi rho sigma tau upsilon phi chi psi omega , $ .br use the keyword \(lqitalic\(rq to specifically select one from the italic font: .EQ sdefine ab % sub { alpha beta } % R ab - 1 over 2 g ab R + italic Lambda g ab = { 8 pi kappa } over { c sup 2 } T ab .EN .\" ----------------------------------------------------------------
cm-fonts.pdf
Description: Adobe PDF document