Questions tagged [typewriter]
{typewriter} is the term used for a "monospaced" font, that is, a font in which all characters have the same width.
394
questions
1
vote
1
answer
39
views
Insert monospace text at the beginning of \item While Using microtype
I'm trying to insert teletype text (monospace) at the beginning of an \item in various environments such as lists, tables, or description lists in LaTeX. I understand that the \verb command cannot be ...
3
votes
1
answer
83
views
Does \ttfamily override the effect of \hyphenchar?
Using the following MWE, the first paragraph is hyphenated, whereas the other two are not:
\documentclass{article}
\usepackage{mwe}
\textwidth=7cm % increase the likelihood of hyphenation
\begin{...
2
votes
1
answer
53
views
How to use a the tt font for mathrm?
I am using a combination of Computer Modern TT and Euler Math for my document:
\usepackage[euler-digits,euler-hat-accent]{eulervm}
\usepackage[T1]{fontenc}
\renewcommand*\familydefault{\ttdefault}
\...
0
votes
0
answers
37
views
XeLaTeX: fallback specifically for monospace
I'm using a package that ends up delegating to pygments for some code rendering. I use ≡ and ∈ as symbols within the code, which lmmono10-regular complains about not having.
What can I add to the ...
3
votes
2
answers
105
views
How to produce a stable mathematical symbol & in the typewriter font?
First a minimal working sample is as follows.
\documentclass{article}
\newcommand*\ttand{\mathord{\texttt{\&}}}
\begin{document}
$\ttand$
\itshape$\ttand$
\end{document}
As you see I defined ...
1
vote
1
answer
70
views
aligning typewriter text in different rows
I am putting together a table with letters, and numbers below the letters to track progress.
\documentclass{article}
\usepackage{xcolor, placeins, cmbright}
\usepackage[margin=0.5in]{geometry}
\begin{...
7
votes
3
answers
433
views
Greek typewriter characters with \symtt (or \mathtt)
I want to have Greek typewriter characters in math mode, using unicode-math.
I use a font having Greek characters:
\setmonofont{NewCMMono10}[
Extension = .otf,
UprightFont = *...
1
vote
0
answers
78
views
How to perfectly simulate typewriter style?
I want to simulate typewriter style typesetted math articles. There are a few major requirements:
All characters in all environments be tt style and of the same size and width (including super and ...
6
votes
3
answers
836
views
How to get real minuses in typewriter font
In many fonts the minus signs - have been shrunken to hyphens in the last decades which looks quite odd in the context of programming languages. How can I get back the original size which is exactly ...
2
votes
1
answer
116
views
Type of k strange in Lehmann's Analytical geometry book
How can I enter this 'K' in LaTeX?
0
votes
0
answers
36
views
Help with minipage/colum space
I am currently making a non-professional document in latex, I am using the typewriter package.
I'm trying to put two photos (one below the other) and right next to them, as if it were another column, ...
2
votes
1
answer
645
views
\textbf \texttt \textit is not working anymore
I am trying latex for the first time to write an essay for school, in the beginning the \textbf \texttt and \textit worked normaly. But i started to use more and more different packages and copied ...
0
votes
0
answers
112
views
How to use backticks exactly like in markdown
For processing documents with a lot of program code and code fragments, I would like to use backticks for inline program code. So far I use the suggestions from this answer (which already declutters a ...
0
votes
1
answer
42
views
Force hyphenation or make newline in \tt
Overview
The goal is to get a tt rendering but with no right text overflow, in any case. I try to force LaTeX to make hyphenation or, if it’s not possible, newline. No matter if sometimes it let a gap ...
4
votes
2
answers
574
views
Changing mono font with PDFLaTeX
I'd like to change the default monofont (used with \texttt{} and \url{}) to "CMU Typewriter Text Variable Width", without touching the default main font.
I was able to do it with
\usepackage{...
13
votes
2
answers
487
views
replacing tt italic with tt slanted at LaTeX level?
I have a personal dislike of the CM typewriter italic design. (Sorry,
DEK :). It's fine for what it is, but I just find it distractingly fancy.) For TUGboat, I always want to replace it with ...
0
votes
1
answer
75
views
Hyphen too wide in texttt when combined with microtype
I'm currently writing a paper with a lot of code references. I want to typeset class and method names using \texttt{}. I am explicitly indicating word splitting points using e.g. \texttt{Very\-Long\-...
0
votes
0
answers
33
views
How to print quotation mark glyphs inside the verbatim, minted, listings & texttt?
Assuming the desired quotation marks in the code are called glyphs, how to print the left & the right quotes as desired, as it's printed in `monster'
inside the verbatim, minted, listings ...
3
votes
3
answers
179
views
Fontspec: separately scale uppercase and lowercase so `tt` has same cap-to-x-height ratio as main font
TL/DR
I understand this is a perverse question, but—is it possible, in fontspec/XeLaTeX|LuaLaTeX, to separately scale uppercase and lowercase letters of a monospace typewriter font to achieve the ...
7
votes
4
answers
1k
views
How do I write the reference mark symbol ※ in TeX?
Consider the reference mark symbol, ※, also pictured below:
How can I write this symbol in TeX?
0
votes
0
answers
31
views
Space missing in list of tables after monospaced / typewriter text
I am using this custom version of the \texttt command from this answer to enable line breaks in monospaced / typewriter text in my document:
\newcommand*\justify{%
\fontdimen2\font=0.4em% interword ...
4
votes
3
answers
445
views
Typewriter non-bold font with italic support and Greek letters
I'm explaining some code that uses Greek characters, bold, italic, and accents.
The default font does not differentiate between bold and non-bold.
\documentclass{minimal}
\usepackage[LGR,T1]{fontenc}
\...
2
votes
1
answer
163
views
Some code ligatures work in xelatex but not lualatex
While looking at this question I noticed that some of the code ligatures from the JetBrains Mono font (freely available from their website) worked in xelatex, but not in lualatex. Compare:
Xelatex
...
1
vote
1
answer
815
views
XeLaTeX Font Warning: Font shape `TU/pcr/m/n' undefined (Font)
The commands \textbf and \texttt don't have an effect.
XeLaTeX Font Warning: Font shape `TU/pcr/m/n' undefined
.cls file:
\RequirePackage{fmtcount}
\newcommand{\setthesistype}[1]{\def\@thesistype{#1}}...
1
vote
2
answers
77
views
Have characters (subscripts) in equation mode occupy the same width
Is there a way to make specific letters in equation mode have the same width? I could use the command \texttt{} outside the align environment but not in math mode. For instance, the script below ...
2
votes
0
answers
109
views
How to make content written in texttt{} to wraparound the margin?
The content I have written inside the
\usepackage[english]{babel}
\usepackage[letterpaper,top=2cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]{geometry}
\title{Your Paper}
\author{You}
\...
0
votes
2
answers
185
views
Add extra kerning before certain punctuation in Babel, but not for the typewriter font
I want to add extra kerning before exclamation marks, question marks, colons, semicolons, etc. and extra kerning before and after en and em dashes. My current code is based off of this answer.
The ...
3
votes
1
answer
136
views
Monospace (typewriter) fonts do not respect margins
I am trying to use a typewriter font (TXTT) in a document, but it consistently overruns the margins. I don't know if this is expected or if I am making a mistake in my document.
An MWE below:
\...
1
vote
0
answers
21
views
Adjusting the Vertical Spacing Between Consecutive Lines with a Scaled Typewriter Font [duplicate]
Consider the code
\documentclass[12pt]{book}
\usepackage{scalefnt}
\begin{document}
\thispagestyle{empty}
\begin{description}
\item {\fontfamily{lmvtt}\selectfont{No one should be ashamed to admit ...
2
votes
1
answer
172
views
How to use backticks as a \tt mode
Using markdown quite a lot lately, I would like to use backticks/backquotes in the same way in Latex. Thus
Using a `tt-font`
would produce the same as
Using a {\tt tt-font}
similarly to the two $s ...
2
votes
2
answers
848
views
Characters in texttt
This page states, falsely as far as I can tell, that the code
\texttt{\alpha in texttt mode }\alpha
results in this appearing in the document:
\alpha in texttt mode
followed by the letter alpha in ...
1
vote
2
answers
91
views
How do I show dollar sign in a monospace font?
How do I show a dollar sign in monospace -- like $124.12? I tried the below method with no luck.
\verb$\$124.12$
\texttt{$124.12}
Thanks
0
votes
3
answers
337
views
How to use the default typewriter font with Times New Roman?
I'm trying to use the default typewriter font (that comes with LaTeX & CMU) with Times New Roman.
If I disable the newtxtext package, I can use the nice typewriter font, but it disables Times New ...
7
votes
3
answers
906
views
Can I switch to Consolas for \texttt?
For part of my documentation I want my \texttt to use a fixed-spacing font that slashes its zeroes. The default font LaTeX uses for the purpose (Courier New, I suppose) does not. I'm used to ...
3
votes
2
answers
219
views
Different appearence of typewriter font in algorithm2e procedure
Let's say we have a procedure in which we want to iterate over an object whose data type we want to specify by writing it in texttt font.
I tried
\documentclass{article}
\usepackage{algorithm2e}
\...
4
votes
2
answers
388
views
How to Obtain Typewriter Font Small Caps
I am using (in this case) the lmvtt font.
Consider the code
\documentclass{book}
\begin{document}
\thispagestyle{empty}
\LARGE
{\fontfamily{lmvtt}\selectfont{How to Obtain Typewriter Font Smallcaps}}
\...
7
votes
2
answers
243
views
Force horizontal spacing for a character
How can I force the spacing of a character?
I tried using a zero-width box, but its content gets shifted to the left (not sure why).
\documentclass{minimal}\usepackage{fancyvrb}\textwidth=9cm
\begin{...
3
votes
4
answers
446
views
How to Improve the Appearance of Aligned Typewriter Text in a Minipage
Consider the code:
\documentclass[12pt]{book}
\usepackage{microtype}
%\usepackage{ragged2e}
\begin{document}
\thispagestyle{empty}
\begin{center}
\begin{LARGE}
\begin{minipage}{5.75in}\leftskip\...
4
votes
2
answers
360
views
Why UM Typewriter font not working properly?
I compiled this code
\documentclass{article}
\usepackage{minted, fontspec}
\setmonofont{UM Typewriter} %% <--- some problems here (see the next comment). To solve comment it out.
\begin{document}...
0
votes
1
answer
203
views
Greek letter in text, in courier font
I am able to display the Greek letter θ (the only one I am interested in) in text mode, thanks to \usepackage[euler]{textgreek}. I just copy and paste θ into my text, and it looks fine. Now I want it ...
0
votes
0
answers
52
views
How to Produce a Continuous Emdash with Pdflatex Using Texttt
I would like to know how one might extend the answer given in How to Produce an Unbroken Emdash with Texttt ---which requires fontspec; and thus, either lualatex or xelatex---that is applicable when ...
1
vote
1
answer
73
views
How to Produce an Unbroken Emdash with Texttt
MWE:
\documentclass{book}
\begin{document}
\Large
\thispagestyle{empty}
emdash---
\vspace*{25pt}
Now, with the texttt command: \, \texttt{emdash---}
\end{document}
which gives:
How may I produce ...
1
vote
1
answer
829
views
How can I simulate the draft mode of a 9-pin dot matrix printer?
How can I get LaTeX to make its output look like it was printed with the draft mode of a 9-pin dot matrix printer, such as the classic Epson FX-80? The upper part of the following illustration, taken ...
1
vote
0
answers
87
views
\string\noindent outputs a quotation mark " instead of a backslash \
I used \string\noindent to output a command \noindent, but the result is "noindent.
I also tried with \verb|\noindent| and \texttt{\noindent}, but the results are the same.
I found a question may ...
2
votes
2
answers
105
views
How might one print the \tt prime character while in taocpmac's begintt mode?
I am using \begintt and \endtt from Knuth's taocpmac.tex and I would like to typeset the prime character, not the apostrophe. My code looks something like this:
\input taocpmac
\begintt
a' = a + 1
\...
2
votes
1
answer
430
views
Change the font inside `tabular` globally, in LaTeX Beamer (metropolis)
I have a presentation in beamer with the metropolis theme. All the content of all tables should be written in mono/typewriter font. Ideally I would prefer to make the change globally, inside the ...
0
votes
2
answers
512
views
Should I Use Sans Serif Fonts for Section Headers and Monospace Fonts for URLs
The font I use is Latin Modern.
I want to know if I should use sans serif family for the section headers.
Some people suggest to use sans serif for section headers but to me it looks a bit weird and ...
0
votes
1
answer
145
views
Hyphenate \texttt
Before anyone says anything, yes, of course I've seen this. But, it's not what I want.
What I'm looking for is basically a way to either alter the way \texttt works, or a new command that works just ...
1
vote
1
answer
73
views
Space before the "?", normally unbreakable with babel-french, breakable with listings' breaklines option
With babel-french, the space before the question mark is normally unbreakable.
But, as shown by the MWE below (compiled with pdflatex, xelatex or lualatex), the breaklines option of the listings ...
1
vote
0
answers
235
views
Latin Modern under T1 encoding, "lighttt" setting, and "lmtt/m/sl" in place for italic: Error at apostrophe "\textquotesingle"
The MWE:
\documentclass{article}
\usepackage[lighttt]{lmodern}
\usepackage[T1]{fontenc}
\ttfamily
\DeclareFontFamily{T1}{lmtt}{}
\DeclareFontShape{T1}{lmtt}{m}{it}{
<-> ssub * lmtt/m/sl
}{}
...