# Typewriter text in sections with ACM “sig-alternate” document class

I would like to put a \texttt{} block in a section, e.g.

\section{Algorithm \texttt{FSG}}


But the problem of this approach is that the text inside the\texttt{} block does not inherit the size and boldness of the surrounding text, at least with the ACM sig-alternate document class. How could I solve this problem?

-
The Computer Modern Typewriter font doesn't have a boldface version; the size, however, is inherited. – egreg Dec 21 '12 at 17:16
How can I specify that a block of text has to be displayed in Computer Modern Typewriter? – akappa Dec 21 '12 at 17:18
Well, if you don't change the font setup, saying \texttt{something} typesets "something" in CM Typewriter. – egreg Dec 21 '12 at 17:19
Oh, I see. Well, I am using ACM's sig-alternate documentclass, but I am not saying a thing about fonts and stuff like that. The size of the typewritten text, however is noticeably smaller than the rest of the section title. – akappa Dec 21 '12 at 17:22
That's a problem with the sig-alternate class that's written in what I wouldn't define good LaTeX programming. :( – egreg Dec 21 '12 at 17:27

Unfortunately the sig-alternate class uses a peculiar1 way to set the document fonts.

In particular, the \texttt macro selects the font family aett (which belongs to a definitely obsolete package) at size 9pt, independent of context. So you have two problems.

1. Use a boldface version of the Typewriter font.

2. Increase the font size in section titles.

## Solution to problem 1

\DeclareRobustCommand{\ttfamily}{\fontencoding{T1}\fontfamily{lmtt}\selectfont}


## Solution to problem 2

\DeclareRobustCommand\sectt[1]{{\fontsize{13}{12}\bfseries\ttfamily#1}}


## Example document

\documentclass{sig-alternate}

\DeclareRobustCommand{\ttfamily}{\fontfamily{lmtt}\selectfont}
\DeclareRobustCommand\sectt[1]{{\fontsize{13}{12}\bfseries\ttfamily#1}}

\begin{document}

\section{Algorithm \protect\sectt{FSG}}
Algorithm \texttt{FSG}

\end{document}


Due to how the class is written, you won't be able to make a table of contents if a command such as \sectt appears in a section title. But this would happen also with \sqrt and other seemingly innocuous commands