Questions tagged [typewriter]

{typewriter} is the term used for a "monospaced" font, that is, a font in which all characters have the same width.

Filter by
Sorted by
Tagged with
7 votes
3 answers
343 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
147 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
199 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,044
7 votes
2 answers
199 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{...
  • 1,539
3 votes
4 answers
366 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\...
  • 7,044
4 votes
2 answers
288 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
0 answers
58 views

Highlighting Monospaced Text

When using monospaced fonts, all characters are supposed to have identical width, including the space character/spacebar. But when highlighting monospaced text using the hl command via the soul ...
0 votes
1 answer
52 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
31 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
60 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
210 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 ...
  • 2,994
0 votes
0 answers
43 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 ...
  • 1
1 vote
2 answers
68 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 \...
  • 237
2 votes
1 answer
149 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 ...
  • 963
0 votes
2 answers
139 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 ...
  • 119
0 votes
1 answer
63 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 ...
  • 177
1 vote
1 answer
65 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
89 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 }{} ...
1 vote
1 answer
47 views

Package alltt does not typeset double quoting marks

For a report I would like to typeset HOL4 code in tt font with the alltt environment. My code includes U+201C Left Double Quotation Mark and U+201D Right Double Quotation Mark. The alltt environment ...
  • 789
0 votes
0 answers
96 views

Why does \texttt not work on braces?

Why does \texttt not work on \textbraceleft or \{? Is there any solution to solve this? \documentclass{article} \begin{document} \texttt{\textbraceleft} \texttt{\{} \verb|{| \end{...
  • 3,498
0 votes
0 answers
26 views

What's the best way to deal with large pieces of text like keywords, camel cased words, namespaces, etc [duplicate]

I'm writing a text which has a lot of long Redis keys and camel cased text (like class names). This could be extended to long keywords and namespaces too. I want to accentuate these in way, so I'm ...
  • 559
3 votes
1 answer
342 views

Redefine \texttt{} to allow underscore

I use underscore inside \texttt{} quite often to represent python functions, and I get quite tired of escaping every single underscore with \_. I tried the following to redefine the \texttt{} command ...
2 votes
0 answers
76 views

How to change text color with typewriter package?

How to change the text color when the typewriter package is loaded? Currently, with this MWE: \documentclass{article} \usepackage{typewriter} \usepackage{xcolor} \color{red} \begin{document} \...
0 votes
0 answers
99 views

How to use the typewriter package "locally"?

Is there a way to enclose the effects of the typewriter package locally, into an enviroment for exemple as suggested by @Phelype Oleinik's comment in a related question (with something like \...
1 vote
1 answer
45 views

How to do a left double quote that looks right both as monospaced and non-monospaced fonts?

As best I can tell, if I want a correct left double quote mark: in all non-monospaced fonts I must do ``X in all monospaced fonts I must do "X In my case this is an issue because I have a macro ...
  • 209
2 votes
1 answer
105 views

fontspec + JuliaMono: missing glyphs in LuaLaTeX compared to XeLaTeX

I am trying to typeset a document that contains monospaced text with Greek-letter Unicode glyphs, e.g. alpha, beta, etc. To do so, I'm using the JuliaMono font, which has extensive support for mathy ...
  • 205
0 votes
1 answer
91 views

Adjust relative font size of *all* monospaced text?

By default, LaTeX makes monospaced text rather large relative to the default serif ("roman") text. This is especially pronounced when choosing custom fonts, e.g. \usepackage{fouriernc} \...
  • 1,819
1 vote
3 answers
83 views

Line not breaking when combining inline math and \texttt

Sadly, I am not able to recreate a MWE since I'm working on a fairly complex template. I cannot understand how LaTeX decides to break lines, I googled but I couldn't find a clear cut answer. This is ...
2 votes
2 answers
177 views

How can I save and restore fontdimen parameters?

I am using the fontdimen code in this answer to make spaces stretch in inline code samples (credit to Stefan Kottwitz): \documentclass{minimal} \usepackage{lipsum} \newcommand*\justify{% \...
  • 3,964
2 votes
1 answer
258 views

Text runs off right margin with \texttt{}

I asked this question earlier and it was linked to other questions and considered closed. I've checked the answers to the linked questions and they don't answer my question so I'm trying again. The ...
  • 437
7 votes
1 answer
180 views

Selectively disable a ligature in pdflatex + newtxtext

I had a wonderfully working setup with LuaLaTeX, but my publisher demands I use PDFLaTeX and newtxtext. This, however, replaces ">>" in monospaced text with "»" which looks ...
  • 183
0 votes
0 answers
49 views

May I label with a monospaced typeface?

Say I have an enumerate environment like \documentclass{article} \usepackage{amsmath, amssymb, amsthm, enumitem, graphicx, hyperref, latexsym, babel, blindtext, thmtools} \usepackage{enumitem} \...
  • 3,941
0 votes
1 answer
271 views

Use the bold typewriter font from lmodern for keywords in listings but keep Computer Modern fonts in the rest of document in LaTeX

I am writing a document in LaTeX using the standard Computer Modern fonts. The text is mainly in Russian but it includes some listings. I prefer to typeset listings using the standard typewriter font (...
3 votes
2 answers
297 views

typewriter font in times new roman

Given, \documentclass{article} \usepackage{times} \begin{document} This is textual typewriter {\tt Angry Hyena kills Lion to save her baby} This is mathematical typewriter ${\tt Angry~...
  • 3,896
1 vote
2 answers
67 views

libertinus-otf does not print straight quotes in verbatim environment

Consider the following LuaLaTeX document: % arara: lualatex \documentclass{article} \usepackage{libertinus-otf} \setmonofont{CascadiaCod3-Light.otf} % from cascadia-code package on CTAN \begin{...
  • 32.7k
10 votes
3 answers
555 views

\texttt and breaking in justified paragraphs

When a monospace segment is used within an otherwise variable-width justified paragraph, very often the monospaced part is wrapped "one word too late", resulting in many lines being overfull ...
  • 135
1 vote
1 answer
66 views

How to edit .bst file to use texttt typewriter font?

I'm using the scrreprt document class and BibTeX, Version 0.99d with apsrev4-2 for by bibliography. I'd like to modify my local .bst file such that the eprint field is printed with the \texttt ...
  • 185
2 votes
1 answer
76 views

Allow arbitrary linebreaks in \texttt formatted text

My document is a mixture of regular text and code, where I format the code with \texttt{}. To make this a little easier, I added a new command: \newcommand {\ttt} {\texttt} so now I just write, \ttt{...
2 votes
0 answers
63 views

Typesetting mathematical unicode characters in typewriter font

This is a followup to this answer: https://tex.stackexchange.com/a/593973/27523 it suggests using the \DeclareUnicodeCharacter command to use Unicode source characters. Now the problem is that I use ...
  • 789
0 votes
1 answer
28 views

Newcommand without extra spacing [duplicate]

Defining a new command as \newcommand{\boo}{\texttt{boo}} and then using it in the text as \boo removes the space after boo and the next word. This is fine if the next word happens to be a period, ., ...
  • 129
0 votes
1 answer
365 views

Missing $ inserted when use \texttt [duplicate]

I have this simple code: \documentclass[10pt]{article} % amsmath package, useful for mathematical formulas \usepackage{amsmath} % amssymb package, useful for mathematical symbols \usepackage{amssymb} ...
2 votes
1 answer
106 views

How do I detokenize '\texttt{%>%}'

I have a command: \newcommand{\help}[2]{ \href{https://www.rdocumentation.org/packages/#1/functions/#2}{\texttt{?\detokenize{#2}}} } and another \newcommand{\code}[1]{\texttt{\detokenize{#1}}} ...
  • 279
1 vote
1 answer
84 views

how can I change an arbitrary portion of my document to monospaced/typewriter font in xetex?

I want to put arbitrary portions of my text into a font that looks like it came out of a 1960s manual typewriter. In particular, each character must occupy a column, identical in width to all other ...
4 votes
1 answer
154 views

Define \textunderscore to mimic look of standard underscore

I noticed that the look of the underscore _ differs greatly from the look of \textunderscore How can I redefine \textunderscore to look like the standard underscore of the set font? I want to avoid ...
4 votes
1 answer
185 views

Text in monospaced font being compressed

When there're too many characters in a line, the white spaces are being compressed so as to fit in those texts. Normally this is fine. But now since I'm using a monospaced font and I wish to keep the ...
  • 7,135
1 vote
1 answer
71 views

Modify hyphenation behavior for texts in monospaced font

I'm using a monospaced font and with some effort I got it hyphenated. However the hyphenation behavior is quite strange and the right side of the document is ugly. Is there a way to force it always ...
  • 7,135
1 vote
1 answer
76 views

Combining Wrapping \texttt{} with Sections and TOC - Improper alphabetic constant

Was working on getting line wrapping working for code, and came across a solution which was working for me - until I tried to add a table of contents to my code. The issue seems to be with using the ...
1 vote
2 answers
100 views

Underline text with === (SETEX style)

I'm trying to recreate the typewriter look. How to make \underline{sometext} work like SETEX-style section marker? The intended use is with monospaced/typewriter fonts for lines with plenty of space ...
2 votes
0 answers
205 views

typewritten to Latex

I have a math book from the '60s in PDF. It's typewritten and I found it harder to read than a Latex edition, but couldn't find any modern edition. Is there an app or site or some way to transform it ...
  • 21
0 votes
1 answer
185 views

Awful text wrap with \ttfamily

This might be a silly question but I cannot find a way to solve it. Below is a MWE: \documentclass{article} \usepackage[margin=1in]{geometry} \usepackage{blindtext} \begin{document} \ttfamily What ...
  • 7,135

1
2 3 4 5
8