{typewriter} is the term used for a "monospaced" font, that is, a font in which all characters have the same width.
13
votes
4answers
4k views
Using \ttfamily with \bfseries (or how to enable bold in fixed-width font)
I'm using listings package, and I've added basicstyle=\ttfamily\footnotesize. However, when I do that, the keywords from the embedded source-code are not bold anymore.
I figured that \ttfamily ...
4
votes
1answer
37 views
Longtable monospace font
How do I format all the text in a longtable to monospace. Adding \texttt{ before or after the \begin{longtable} and a } at the end gives me a
Runaway argument?
{ \begin {longtable}{lll}
! Paragraph ...
4
votes
2answers
2k views
Which sans serif and monospace fonts suit Century Schoolbook?
I find the Century Schoolbook family very legible for online documentation. However, I am unsure what sans serif (for typesetting, e.g., LaTeX package names) and monospace (for typesetting code) ...
3
votes
2answers
1k views
Lyx is ignoring typewriter font setting for program listings
I'm using Lyx's Insert|Program Listing to insert a code listing into my document. Unfortunately, Lyx seems to ignore the Typewriter font selection I made in DocumentOptions under Fonts ⇒ ...
6
votes
3answers
115 views
verbatim and CJK
I'm not familiar with chinese characters and fonts. But I have to type some characters into a document. XeLaTeX may be an option, but I'm looking for a solution with pdflatex. Here is my MWE, which I ...
3
votes
1answer
87 views
2
votes
0answers
72 views
Broken display of 11pt typewriter text in Acrobat Reader [duplicate]
I set some all-caps words in my document as typewriter. Using scrartcl as documentclass, with a default fontsize of 11pt, yields a PDF that looks rather bad in Acrobat Reader. Here is an example:
...
2
votes
2answers
281 views
\ttfamily is too bold for me
I use the following settings for my listings:
\lstset{
%basicstyle=\ttfamily\tiny, % small
basicstyle=\ttfamily\scriptsize, % middle
}
But the font in the listings is too bold for me. I tried a ...
3
votes
1answer
99 views
Using same font for \texttt and \Verb
I would like to configure my document to use exactly the same font for \texttt and \Verb. I got as far as this, which still misses making \ttdefault smaller:
\documentclass{article}
...
4
votes
1answer
123 views
Libertine monospaced font seems to big
I'd like to write a document with the Libertine font (using the libertine package). I have a couple of code snippets in the text, and to me it seems like the Libertine Mono font that is used by the ...
7
votes
2answers
1k views
Typesetting single quotes
How can the single quote character be typeset as the ascii character ' in a LaTeX document?
For instance, consider the document:
\documentclass{standalone}
\usepackage[T1]{fontenc}
...
0
votes
1answer
210 views
Use verbatim inside \texttt
Why can't I use \begin{verbatim} inside \texttt?
\texttt{ \small \begin{verbatim}
iab <key> <expansion>
<key> is the string which should be expanded to <expansion>
...
7
votes
1answer
96 views
characters “>>” in LaTeX
I'm writing about programming language Haskell and I need to describe operators named >>= and >>. I wrap all references to names from the programming language in \texttt{ ... }, for ...
3
votes
2answers
127 views
Print $ inside \tt
How do I print a $ inside \tt?
I tried escaping with a backslash, but didn't work.
\tt{\$}
throws an error.
! Argument of \OT1\^ has an
extra }
Update
Sorry, the issue was not with $, but ...
2
votes
1answer
97 views
Why is the doi in biblatex a different font?
I am using biblatex-chicago (with \autocite) and a standard BibTeX file. For some reason, the DOI in my references is in a different font from the rest of the entry. Is this normal?
16
votes
3answers
2k views
How can I create a full-size circumflex in typewriter font?
I have some C source code and would like to show the circumflex or caret (^) in the way it is typically shown in source code -- as a full-size character. The source code will be appearing in ...
24
votes
3answers
844 views
What's a good typewriter template?
I'm searching for a template which makes a document look like it's written with a real typewriter. Ideally, this means it's not only in mono-spaced font, but the hyphenation is adjusted accordingly. ...
5
votes
2answers
378 views
Weird spacing with DejaVu Sans Mono with MiKTeX's XeLaTeX
\documentclass{article}
\usepackage{fontspec}
\setmainfont{DejaVu Serif}
\setsansfont{DejaVu Sans}
\setmonofont{DejaVu Sans Mono}
\begin{document}
Hello World!
\textsf{Hello World!}
...
2
votes
1answer
116 views
How to make all the entries in a table verbatim font
I have a large table in the tabular environment and I need to make all the text verbatim font. I know I can use \begin{verbatim}...\end{verbatim} for all the entries but they are just too much for me ...
5
votes
3answers
2k views
parameter passing to \verb|| environment
I happen to write the following code over and over again.
{\color{blue}\verb|>|} {\footnotesize\verb|HI|}
So, I came up with the following code to make it a command.
\newcommand{\result}[2]{%
...
6
votes
2answers
202 views
C++ operators ^=, <<=, >>= misinterpreted
I write a list of C/C++ operators of the following form : \texttt{operator+=}, \texttt{operator-=}, \texttt{operator*=}...
The problem is that \texttt{operator\^=}, \texttt{operator>>=}, ...
7
votes
1answer
126 views
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 ...
5
votes
2answers
164 views
How do I change the standard “math font”?
What I can tell, the font you get, it looks like the standard, "bookish" font, only tilted. How can I get a monospace font with a straight spine, e.g., the font you get with texttt?
I'm happy with ...
2
votes
1answer
93 views
issues after verbatim section
I'm havin an issue which I cannot solve. If I have a subsubsection containing text with a verbatim section in between, the first line after the verbatim section is not aligned properly. If I put a ...
2
votes
1answer
168 views
Typewriter quotation marks in texttt
I'd like to do the text
"conservative"
with the quotation marks into a \texttt. However, when I do so, the first quotation mark is removed. I'm using the LNCS documentclass, I'm not sure if this ...
3
votes
1answer
105 views
ttfamily usage (newline failing)
I'm unable to insert a new line while using \ttfamily.
Is there any reason why \ttfamily prevents to do that?
My problem (here's the code):
Let's consider an e-commerce web application whose address ...
1
vote
1answer
120 views
Hyphenate typewriter / avoid overfull \hboxes in code, using fontspec and XeTeX
I would like to avoid overfull \hboxes as a result of inline code, inserted with \textt{foo} or \ttfamily, e.g. in this MWE:
% compile with xelatex
\documentclass{article}
\usepackage[textwidth=4cm, ...
7
votes
1answer
349 views
not able to write bold characters using textbf
I'm working on latex and R (swaeave) and I am using utf8 encoding but when I use \textbf{dataset}, the text is not bold. Below is part of my code. But I am not sure what is reason behind it.
...
2
votes
1answer
175 views
Comma inside \texttt{} does’nt show up
I am trying to print a comma inside a \texttt{} tag, but it is not printing:
\documentclass{article}
\begin{document}
\texttt{foo, bar}
\end{document}
produces:
foo bar
not
foo, bar
How ...
13
votes
2answers
7k views
How to make a real apostrophe or single-quote in LaTeX
I am trying to incorporate programming examples in a LaTeX document.
The document renders nicely with pdflatex; however, the single quotes get transformed into U+2019, a right-single-quotation mark. ...
3
votes
1answer
86 views
Consecutive commas with ae package
How do I output two (or more) consecutive commas inside \texttt{} ?
,, displays a black square, \,\, displays nothing, \verb{,,} display three consecutive commas (what the heck!), \verb{\,\,} ...
0
votes
0answers
98 views
How to get my teletype (\tt) text to wrap to the next line, rather than run off the edge of the PDF? [duplicate]
Possible Duplicate:
\texttt overfull hbox problem
How to automatically hyphenate within \texttt?
Much of the LaTeX documents I write deal with computer-sciencey stuff that I like to put ...
24
votes
1answer
1k views
How to automatically hyphenate within \texttt?
This question was phrased as a bug report for LaTeX and I thought it would be helpful to be presented here (including an answer).
The person had a lot of "common words" in typewriter font sprinkled ...
6
votes
1answer
380 views
Change font size of \texttt globally?
I'm using TeX Gyre Pagella as the main font of a document which is typeset using a font size of 10pt. For the technical terms, I want to replace the default Computer Modern Typewriter with Bera Mono ...
0
votes
1answer
201 views
\texttt converts apostrophe to Unicode quotation mark [duplicate]
Possible Duplicate:
How to make a real apostrophe or single-quote in LaTeX
I'm building a Python Regex cheat sheet using Latex, which has the following line:
...
2
votes
1answer
300 views
Cyrillic monospaced font
I need to use Cyrillic (russian) monospaced font.
I chose courier and added
\usepackage[T1]{fontenc}
and
{\fontfamily{pcr}\selectfont
blabla
}
and that "blabla" is displayed like usual text ...
9
votes
1answer
141 views
How to deal with it/sl/bold in lmtt?
I just stumbled upon the fact that the font lmtt (latin modern typewriter) seems to exist in
italic
slanted
bold
bold slanted
but not
bold italic
At least the file t1lmtt.fd contains the ...
4
votes
1answer
115 views
Scaling cmtt to match times
I want to use Times Roman (times) as the default font and Computer Modern Typewriter (cmtt) for monospaced text. However, Computer Modern is a little too large. How do I scale it down document-wide?
...
13
votes
2answers
485 views
Which typewriter font fits to Linux Libertine and supports bold letters?
I'm thinking about using the Linux Libertine font (\usepackage{libertine}) in my next TeX documents. For listings with syntax highlighting I will need a typewriter font that supports boldface.
I ...
17
votes
2answers
496 views
Entire document typed in monospace font
I want to put an entire document into monospace font for various reasons. This is nominally fairly easy; you can say \renewcommand{\familydefault}{\ttdefault}. However, there at least two problems ...
5
votes
3answers
374 views
monospaced fonts not respecting spaces?
Why does true type fonts consolidate spaces and is there any way to stop this? I need easily add white space between words equal to the width of a space(which for monospace should be the same for all ...
11
votes
1answer
176 views
Escaped characters in typewriter font
I know a number of ways to fix this (e.g. \usepackage[T1]{fontenc}), but I want to understand what's happening in the following example.
\documentclass{article}
\begin{document}
\noindent
\$ \% ...
5
votes
1answer
979 views
Suggestions for typewriter font to match Concrete and Euler
I'm having fun using a combination of Concrete and Euler in some of my documents. I wonder if anyone has a suggestion about a matching typewriter font? I've been trying Inconsolata (scaled to .97) ...
8
votes
1answer
250 views
Can I change all math output to use monospaced text?
Is there any way of modifying the preamble, so instead of typing
$\mathtt{x}$ ...
\begin{eqnarray}
\mathtt{y} & \mathtt{=} & \mathtt{z^\pi}
\end{eqnarray}
I can omit the \mathtt{...} ...
4
votes
1answer
371 views
How to change math font to monospace, only inside \texttt
Related with "Can I change all math output to use monospaced text?", is it possible to use the monospace math only inside \texttt (or other custom command)?
I tried to include the \everymath inside a ...
16
votes
1answer
282 views
Improving typewriter animation
How can I improve the code for this animation so that I can write more words? I wanted a smarter code.
\documentclass{article}
\usepackage{tikz}
\usepackage[active,tightpage]{preview}
...
12
votes
2answers
3k views
\texttt overfull hbox problem
I asked a question earlier about \verb and overfull hbox :
In-line \verb -- overfull hbox problem
And regarding the solution there, changed many of my \verbs to \texttt{}s. I have come up with a new ...
6
votes
1answer
248 views
Garamond and URL links
I am experimenting the use of the Garamond Premier Pro font for a dissertation and I still would like to keep the URL information in the bibliography when available. Obviously, there's a font problem ...
7
votes
1answer
132 views
How can I force pairs of brackets [][] to be closer to each other in \texttt?
\documentclass{article}
\begin{document}
Normal margin here. Normal margin here. Normal margin here.
Normal margin here. Normal margin here. Normal margin here. Normal margin here.
Abcdefgh ...
16
votes
5answers
1k views
Why are URLs typeset with monospace fonts by default?
When typesetting URLs in LaTeX using the url package, they are set in a mono space font by default. While I just accepted that as a fact for a long time, I am now starting to wonder why?
In Browsers, ...


