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.

-1
votes
0answers
52 views

why latex don't run without capital letter? [duplicate]

latex don't run with words " lower case" letter like "definition" ,"define".? lik this text: "That is, the inequality "Defining" the convexity of a function is strict whenever possible" what the ...
2
votes
1answer
37 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
40 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
49 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
52 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
45 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
79 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
61 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
42 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
41 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
121 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
38 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
67 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
121 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
51 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
30 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
220 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
33 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
94 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
59 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
120 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
919 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
277 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
67 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 ...
0
votes
0answers
65 views

Monospaced font with italic support that closely matches libertinus

I have been using Libertinus for all the text and math content of my PhD thesis, compiled using luatex. Now, I have come to a section where I have code listings. The pygmentize stylesheet that I am ...
4
votes
1answer
75 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
534 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
94 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
733 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
114 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
496 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
97 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
237 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
87 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
86 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
325 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
733 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
141 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
127 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
275 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
226 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
303 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 ...
2
votes
2answers
320 views

How to make \texttt in \itshaped sidepar look like \texttt in main text

I have side paragraphs in italics and I am using typewriter fonts in the main text to refer to code elements. I want to use the same font in my side paragraphs because it should be clear that it is ...
3
votes
1answer
141 views

Xetex, typewriter fonts and quotes

I use XeTeX with C-language code inside verbatims. The aim is that my students can perform copy/paste from the resulting PDF document into their programming IDE. Using XeTeX is great because I can ...
2
votes
1answer
98 views

`lstlisting` confused by `ucharclasses` (monospace code and unicode emojis) with xelatex

I need to have Unicode emojis in text dealing with code and Unicode. When I include the ucharclasses and the correct incantation, I can get the Unicode emojis, but any monospaced text appears to ...
0
votes
1answer
39 views

Using a new command inside a font command produces errors

I have defined a new command as a macro as follows: \newcommand{\Sel}[3]{S_{#1}^{#2, #3}} I want every invocation of this command to consist of teletypefont (\texttt) so I tried changing the macro ...
6
votes
2answers
466 views

How to simulate old typewriter?

I need to typeset a report such that it looks like it was written by an old, unreliable typewriter. I have looked into the memoir class, however it has chapter numbering which I don't want. It also ...