LaTeX LaTeX Font Change in Section Title

Click For Summary
To format a section title in LaTeX with "Func1" in typewriter font, use the command \texttt{}. The correct syntax for the title would be "Pseudocode for the {\tt Func1} Function." Users noted that the verbatim command does not work for this purpose. There was some lighthearted discussion about typographical errors related to the command. Overall, \texttt{} is the recommended solution for indicating programming code in section titles.
thegreenlaser
Messages
524
Reaction score
16
I want to have a section title to the effect of "Pseudocode for the Func1 Function," but I would like "Func1" to be in typewriter font to indicate that I'm referencing programming code. Is there any good way to do this? The verbatim and verb commands don't seem to work.

Thanks.
 
Physics news on Phys.org
Code:
\textt{}
 
It seems that
Code:
\texttt{}
is actually the correct command that doesn't give errors, but yes, that works. Thanks!
 
You can do
Code:
Pseudocode for the {\tt Func1} Function
If ttyping the righttt number of t's is a problem :smile:
 
thegreenlaser said:
It seems that
Code:
\texttt{}
is actually the correct command that doesn't give errors, but yes, that works. Thanks!

Oops...that's what auto-complete of TeX statements get you. Sorry about that.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 36 ·
2
Replies
36
Views
2K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
1K
Replies
5
Views
3K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K