Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to print boldface typewriter font in LaTeX?

1,033 views
Skip to first unread message

Woodhams

unread,
Jul 3, 1995, 3:00:00 AM7/3/95
to
Surely this should be in the FAQ? I looked but couldn't see it.

How do I produce boldface typewritter font in LaTeX? I presume it is
a matter of loading a new font:

\newfont{\ttbf}{font name here}

but what is the font likely to be called? Is there an easy way to look
at all the available fonts?

I am runing Linux (Slackware 1.2) - I am not certain what TeX
distribution this has. Metafont is included.

Michael W.


Andreas Barth

unread,
Jul 3, 1995, 3:00:00 AM7/3/95
to

As far as I know there is no boldface typwriter font among the computer
moderns (could someone correct me please if I am wrong), so you should
use something different.

If you have ghostscript and gsftopk installed you may use courier bold.
The .tfm and .vf files should reside in /usr/TeX/lib/texmf/fonts/adobe/courier/{tfm|vf}
or some similar directory. (In doubt use find / -name pcrb.tfm -print etc.)
If you have a copy of windows or OS/2 you should have the type1 sources,
that gsftopk converts (via ghostscript) to the .pk format.

Good luck,

Andy

P.S. You can compile any font into your document LaTeX finds a .tfm file.
To priview or print a font you need additionally a .pk file and if it
uses an other encoding sceme than TeX a .vf file that you previewer finds
or causes MakeTeXPK to produce (from metafont, type1, truetype or other
sources). So if you want to know about the available fonts look in
the configured paths or use find.

Timothy Murphy

unread,
Jul 3, 1995, 3:00:00 AM7/3/95
to
m...@ccu1.auckland.ac.nz (Woodhams) writes:

>How do I produce boldface typewritter font in LaTeX? I presume it is
>a matter of loading a new font:

>\newfont{\ttbf}{font name here}

>but what is the font likely to be called? Is there an easy way to look
>at all the available fonts?

I assume you are using LaTeX2e.

(1) In principle what you want to say is something like

\texttt{...\textbf{...}...}

(2) This will call in the font in the family cmtt in "series bx",
as defined in OT1cmtt.fd .
When we look there, we see that in fact this font is substituted for by (?)
the standard upright font:

\DeclareFontShape{OT1}{cmtt}{bx}{n}
{<->sub * cmtt/m/n}{}

(3) This can be over-written in your file -- no problem about that --
provided you can find an appropriate font.

On my system at least I have fonts cmbtt8, cmbtt9, cmbtt10 --
these should surely do.
[I think they are part of the standard CM distribution.]

I don't have the tfm files, so will have to create them:

% mf "\mode=ljfour; mag=1; input cmtt10"

and similarly for the other 2.
(Use any mode you like;
it should be possible to use nullmode,
but unfortunately there is a bug in it.)

Then put the resulting tfm files in the appropriate place.

(4) Now over-write the .fd command in your file, eg

=============================
\documentclass{article}

\DeclareFontShape{OT1}{cmtt}{bx}{n}
{
<5> <6> <7> <8> <9>
<10> <10.95> <12> <14.4> <17.28> <20.74> <24.88> cmbtt10
}{}
\DeclareFontShape{OT1}{cmtt}{b}{n}
{<->sub * cmtt/bx/n}{}

\begin{document}

\texttt{This is the \textbf{test}}

\end{document}
=============================

(5) Now when you run xdvi(k) or dvips(k)
the appropriate PK file should be created by MakeTeXPK,
and you are done.


--
Timothy Murphy
e-mail: t...@maths.tcd.ie
tel: +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland

Volker Kuhlmann

unread,
Jul 4, 1995, 3:00:00 AM7/4/95
to
Woodhams (m...@ccu1.auckland.ac.nz) wrote:
: Surely this should be in the FAQ? I looked but couldn't see it.
It shouldn't be in the FAQ. It is in the manual, and in the guides which
come with LaTeX2e.

: How do I produce boldface typewritter font in LaTeX? I presume it is

: a matter of loading a new font:

\texttt{\textbf{ text }}
The order is not important. Your system must have such a font available,
which is unlikely. If there is no .fd file (font definition) for this font,
or, which is likely in this case, the font definition loaded does not
contain this combination, then LaTeX will substitute the closest available
font. For determining the availability of fonts, LaTeX only uses the .fd
files, those which are loaded first, and those which it can find next. It
does not check .tfm or .pk files.

The above is valid for LaTeX2e, not for LaTeX209 which is hopelessly out of
date by now.

Note: The default font set, computer modern, has no bold tt font. metafont
will only help you if you create a metafont input file yourself, generating
the font you want. Your best bet might be to use postscript fonts (with
package psnfss), with ps fonts you can get all attribute combinations.

: I am runing Linux (Slackware 1.2) - I am not certain what TeX


: distribution this has. Metafont is included.

This is of no relevance.

Hope this helps,

Volker

--
gl...@appl2.hrz.uni-siegen.de (Volker Kuhlmann)

Timothy Murphy

unread,
Jul 4, 1995, 3:00:00 AM7/4/95
to
gl...@appl2.hrz.uni-siegen.de (Volker Kuhlmann) writes:

>Note: The default font set, computer modern, has no bold tt font. metafont
>will only help you if you create a metafont input file yourself, generating
>the font you want.

Actually, there are cmbtt*.mf files in .../cm/mf-extra at the CTANs.

0 new messages