Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [typewriter]

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

0
votes
0answers
31 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 ...
4
votes
3answers
545 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
58 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
34 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
32 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
25 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 ...
2
votes
1answer
29 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
51 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
49 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
53 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
58 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
47 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
90 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
71 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
71 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
55 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
141 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
39 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
74 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
134 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
52 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
37 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
231 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
34 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
111 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
27 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
62 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
141 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
989 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
28 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
292 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
71 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
85 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
558 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
97 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
760 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
131 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
517 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
105 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
338 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
100 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
90 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 ...
0
votes
3answers
377 views

Linebreak in texttt, works with textttt in mathmode

I want to have automatic line breaks for \texttt (specifically for my case in text-mode), while not causing build errors when \texttt occurs in math-mode. Adding hyphens or using \path or \url isn't ...
1
vote
2answers
868 views

How do you change the font size globally for the \texttt environment?

How do you change the font size globally for the \texttt environment? I can do it for the verbatim environment with the following pair of commands \newcommand{\verbatimfont}[1]{\renewcommand{\...
0
votes
0answers
161 views

How do I make a fake typewritten page and a fake medieval manuscript page? [duplicate]

Okay, I am typesetting something where there is snippets from something that is typewritten and something that is a medieval manuscript. Naturally, I think it would be funny to mimic those looks. Here'...
1
vote
2answers
138 views

Is the command \underscore used in any packages?

I've noticed that the underscore produced with \textunderscore doesn't get matched when I search the resulting PDF for it. Does any one know of an \underscore (or perhaps \uscore) command to produce a ...
1
vote
1answer
322 views

Straight typewriter apostrophe (' instead of ’) in \texttt-environment

How can I write ' instead of ’ within the \texttt-environment? I have stumbled upon several discussions, but not a single discussion has solved my problem. I do not want to write code! I just want to ...
5
votes
1answer
238 views

Typewriter font for math symbols (∃, ∀) in scaled verbatim environment for pdflatex

I would like to use math symbols (such as ∀ and ∃) in a scaled verbatim environment, using a typewriter font. The current answer to Proper typewriter font for math symbols (∀, ∃, →), e.g. in verbatim ...
0
votes
1answer
328 views

Change font type in \newtcbox to \texttt

I wanted to change the font type to \texttt inside of the LIB box: This code is found here: \documentclass{article} \usepackage[many]{tcolorbox} \newtcbox{\mylib}{enhanced,nobeforeafter,tcbox raise ...