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
0
votes
1answer
29 views

Children misalignment in forest

Problem I am trying to draw a tree diagram with forest package. I have multiline children including the \texttt command and a one-line child with normal text. This results in a misalignment among the ...
0
votes
1answer
29 views

How to change the \texttt font

This question is the most similar to my own, but it was closed before anyone could answer it. Looking here there are quite a few "Typewrite" fonts built into LaTeX. I was wondering what the default ...
3
votes
3answers
178 views

Line Feed in monospace font - Macro

I want to have long texts without spaces written in monospace font (using \texttt). As line feeds don't appear automatically, I found this answer: https://tex.stackexchange.com/a/315376, where a macro ...
0
votes
0answers
15 views

How to customize the page number to match a completely monospace document

As per My font is monospace, will Latex treat it as monospace, or what do I do?, I'm wondering how I can get the pagination to be on the right bottom corner so that it always is aligned with the ...
2
votes
2answers
178 views

My font is monospace, will Latex treat it as monospace, or what do I do?

I have a custom monospace font. I want to write the whole document using it. The output from doing Lorem Ipsum shows that my monospaced font is not being rendered as monospaced (i.e. some character ...
3
votes
1answer
53 views

How to change the font style (not the size but the style) of algorithimc package

I would like to change the font of the algorithm package. It's currently using serif and I would like to try either sans serif or typewritter font. I have tried to use the following code (which I ...
2
votes
0answers
33 views

Test if current font is a monospace font

I'm trying to define a command that should give different outputs depending on the currently active font, especially depending on if the font is a monospace or serif/sans serif font. I know there's \...
0
votes
0answers
40 views

Extra space after custom texttt

I am currently using the below codes for auto line breaking in Latex. However, below code places an extra space behind the /texttt. How can I remove the extra space being placed after the /texttt ...
5
votes
3answers
555 views

Single-key teletype?

I'm writing a document with a ton of pseudocode and it's very tedious to keep wrapping code objects in {\tt text}. It would be so much nicer to, well, do what StackExchange does! There's a one-...
5
votes
1answer
104 views

Color text inside lstlisting

So I've been looking for a way to color text inside a lstlisting. There are already several questions answere. E.g. here: How can I highlight some lines from source code? All solutions I've found ...
0
votes
0answers
41 views

Justified text with usepackage typewriter

The text when using usepackage typewriter is not justified. Is there a way to do that? \documentclass[12pt,a4paper]{scrartcl} \usepackage{lipsum} \providecommand\ttgreyone{0.1} \...
1
vote
1answer
37 views

use package typewriter with wrapfigure

I would like to have two pictures side by side on the right side of the page with text floating around. This works fine until I try to use the package typewriter. Then the two pictures are one upon ...
1
vote
0answers
33 views

How can I use Fira Code with ligatures in pdflatex?

Basically, I've come to really like Fira Code and its ligatures while coding, and I'd like to use it for my code listings in LaTeX, too. Specifically, I am looking for a way to use Fira Code with ...
3
votes
1answer
38 views

Escape listings but keep colour formatting

Getting bold typed text I have been using listings to format my code, and have occasionally been using the following solution to make some typed text bold: \DeclareFontShape{OT1}{cmtt}{bx}{n}{<5&...
2
votes
1answer
68 views

fontawesome5 monospaced icons [duplicate]

I have been trying to make icons from fontawesome5 monospaced without much success: \documentclass[12pt]{article} \usepackage{fontspec} \usepackage{fontawesome5} \begin{document} \section{MWE} ...
1
vote
2answers
58 views

How can I hyphenate words with dots in a \texttt environment in LaTeX?

There is a bunch of discussions online how to enable (or disable) hyphenation in \texttt environments. I found both the options \usepackage[htt]{hyphenat} and \DeclareTextFontCommand{\mytexttt}{\...
4
votes
1answer
55 views

Use default typewriter font only for a part of the document

I'm using the Inconsolata font provided by the zi4 package. But for a single macro, I want to use the default typewriter font (so not Inconsolata). Every other occurrence of \texttt in the document ...
2
votes
1answer
80 views

Enable highlighting and auto-line-breaking for texttt{}

I'm using the following command to modify texttt{} so that it automatically breaks long lines (without inserting a hyphen), and it's very helpful when writing documents where I have to write lengthy ...
1
vote
1answer
49 views

Is there a way to insert paragraph breaks inside of \texttt block?

The following source code compiles just fine: \documentclass{minimal} \begin{document} \texttt{ Lorem ipsum dolor sit amet Lorem Lorem } \end{document} However, the following ...
2
votes
2answers
117 views

Word wrapping text only when the hbox is overfull

I am using pandoc to process an markdown file that is causing me some issues with regard to in-line code blocks. In some cases I need to be able to have a long string without any punctuation or ...
0
votes
1answer
79 views

How to prevent word wrapping with 2 hyphens?

I have the following markdown file that demonstrates the issue (at least in my environment): --- title: TEST subtitle: Minimum Working Example version: 1.0 rev0 document: TEST-MWE date: 27 December ...
0
votes
2answers
80 views

I have an override for \texttt to prevent line breaks and add a box, but it still breaking up the word

I have the following override: % override the inline code styling to show a gray highlight box \let\oldTexttt\texttt \renewcommand{\texttt}[1]{% \begin{RaggedRight}% \sethlcolor{codegray}% \...
3
votes
1answer
62 views

Why does setmonofont change the justifying of normal text using the same font?

I usually use a different font for URLs e.g. email adresses. Today, I tried to change it in a letter to use the same font als the normal text and it cancelled the justification in the main body of the ...
0
votes
2answers
44 views

How to get monospace font of title, section, subsections, etc. to be all the same size

Wondering how to take this MWE and make it so that the title and all the sections/subsections/paragraphs/etc. all have the same font size and font weight. Basically I would like to know how to adjust ...
7
votes
1answer
189 views

How to make \textpm (or \pm) monospaced

Is it possible to typeset the symbol \textpm (or the equivalent math operator \pm) using a monospaced font? I would like to compile something like \texttt{\textpm} without errors. MWE: \...
1
vote
1answer
45 views

Matrix brackets not appearing when typeset in the typewriter style

I need to display all the math in the typewriter style, so I used mathastext to do it, but now matrix brackets are not being displayed. Everything else works fine as far as I can tell. Here's my code:...
0
votes
2answers
83 views

problems with margins in textual minipages

I'm writing a restaurant menu and i have problems with the left margins of this page, in particular in the paragraph 'Wine'. If I omit \vfill, the code overlaps the two paragraphs but it puts them ...
1
vote
2answers
148 views

Why does `\texttt` repeat and shrink my equation?

When I use \texttt with the caret symbol in an amsmath equation environment, I get a very weird result. Specifically, the text repeats itself four times while shrinking. MWE: \documentclass{article} ...
2
votes
1answer
62 views

Wrong glyph and wrong ligature with FiraMono and listings

Consider the following MWE: % Compile with pdfLaTeX \documentclass{article} \usepackage{FiraMono} \usepackage{listings} \lstset{ language=[LaTeX]TeX, basicstyle=\ttfamily, columns=fullflexible, ...
1
vote
1answer
47 views

Disable linebreaks in \texttt while using underscore package

The \texttt normally does not lead to automatic hyphenation or linebreaks. However, it apparently does when using the underscore package: \documentclass{article} \usepackage[nohyphen]{underscore} \...
3
votes
2answers
257 views

Make soul and \texttt work together

I was trying to redefine \texttt command to make it have background color using package soul. But it seems that it is harder than I thought. My initial code is \documentclass{article} \usepackage{...
2
votes
1answer
37 views

Misalignement and interword spacing with mono font

I'm making a document with XeLaTeX and I would like to use a mono TTF font (Liberation Mono) and a special (reversed) indentation for my paragraphs. I don't understand some things about words spacing ...
2
votes
1answer
160 views

DOI links inside \texttt{} with \url{} line breaking

As in the title, is there any way to have \doi{}, apart from automatically inserting a link to an article, output into \texttt{} and break the line just like \url{} does? Unfortunately, I can't use ...
0
votes
1answer
29 views

References and typewriter in xdef

Is there a way to use \texttt{} and references in a xdef? As example, I have following environment: \NewEnviron{named-environment}{ \xdef\bodycontent{\BODY} } Which I want to use in this way: \...
2
votes
1answer
67 views

\texttt can't show “ij” of babel-dutch' \appendixname in the fonts used bij apa6 man and doc mode

Using the apa6 class with the option man or doc, and using [dutch]babel, \texttt drops the "ij" of \appendixname. (The Dutch word for "Appendix" (that babel uses) is "Bijlage". MWE: %Run with ...
2
votes
3answers
168 views

True fixed-width font for standalone mathematical expressions

I'd like the following to be in a fixed-width (i.e. monospace) font, so I can get the various expressions lined up nicely in order to (probably with a bit of manipulation) make their similarities and ...
11
votes
5answers
1k views

Changing all single quotes to be straight when within texttt

I have a document with many ' characters inside of texttt. Is there a way to make them all appear straight when in texttt? I know that I can search/replace all ' with \textsinglequote: Adding ...
0
votes
1answer
29 views

Equal Width monospace text with changing colors in the same line

I'm trying to create something like the following in Latex: I've tried to \usepackage{color} and put this: \ssmall\begin{ttfamily} \begin{center} \colorbox{yellow}{...
2
votes
3answers
340 views

Too much space after an abbreviation period in tt mode

Is there any way to reduce the space between "CTRL." and "OUT", in the following text? \documentclass[11pt,a4paper,twoside,openright]{book} \begin{document} \noindent Press the button \texttt{CTRL. ...
3
votes
1answer
76 views

Why is the \input command not honored when there is an incorrect use of \texttt before it?

Here is my code: \documentclass{article} \usepackage{listings} \begin{document} Foo { \texttt \input{bar.txt} } Baz \end{document} This produces the output: Foo bar.txt Baz I was expecting this ...
4
votes
1answer
106 views

How can I make the monospace font narrower using fontspec?

The available monospace fonts are mostly too wide for convenient use in documenting code (Courier is an extreme example). Although narrower fonts exist (Prestige Elite, and zcoN, a narrowed Courier), ...
4
votes
3answers
599 views

How to force LaTeX to 'hyphenate' (monospaced font)

How can I force LaTeX to 'hyphenate' the following text? Such that the margins are not overridden (see picture). Is there a way to prevent this? Edit: This is the file after adding - \documentclass[...
1
vote
2answers
113 views

Single character ellipsis in monospace (teletype)

I would like to get an ellipsis as a single (width) character in \texttt. By default it uses three periods: \documentclass{article} \begin{document} \centering \begin{tabular}{rcc} & ...
9
votes
2answers
790 views

typewriter version of \leq

I have the following piece of program code written as $r_4$:\quad\texttt{r(X)} \texttt{<=>} \texttt{X$\leq$0|} \texttt{q(X)} I would like to cheat and display the less-equal sign in a font ...
0
votes
1answer
150 views

How can I insert the following WinBugs code into Latex as a text format?

How can I insert the following WinBugs code into LaTeX as a text format? model { for(i in 1:nSUB) { s[i] ~ dnorm(0,tau.precision); } } I tried \texttt{}: \texttt{model \{ \...
0
votes
2answers
549 views

Help exporting regression output from STATA to LaTeX

How can I export my regression output from STATA to LaTeX so that it looks like this: And not like this: Using estout gives me the second and cleaner table. I just want to export a table that looks ...
0
votes
1answer
136 views

Make \texttt not exceed line length

I have to state a few long numbers in a document. These aren't meant to be regarded as regular numbers but instead as data. So I don't want to format them with \num{<...>} but with \texttt{<.....
1
vote
3answers
527 views

How can I display a backtick inside the \texttt environment?

I am building an automatic password generator producing a pdf. I am having troubles in typesetting the backticks, how can I print a backtick in inside a \texttt? EDIT: my mac spell checker changed ...
1
vote
1answer
122 views

Hyphenation in eprint field of biblatex

I've got a custom formatting style for the arXiv eprint field in biblatex (with biber). However, for some citation, this results in the contents running into the margin. For example, the bibliography ...
5
votes
1answer
94 views

Is there a way to find all Cyrillic typewriter fonts on CTAN?

DejaVu and Droid both provide good T2A typewriter fonts. I wanted to check if there are alternatives, but couldn't find a good way to do so using either http://www.tug.dk/FontCatalogue, CTAN, or ...