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
2
votes
1answer
38 views

Defining a “narrowized” font for \setmonofont{}

Because of Corporate Design rules, I need to use the font SourceCodePro for monospaced text and Arial for plain text. Using KOMA Script, I declared \setmainfont{Arial} \renewcommand{\sfdefault}{\...
0
votes
0answers
46 views

In the TexStudio \mathtt command is not working on in the bracket [] [duplicate]

When I use \mathtt in equation why in the [], the font is not be the same like before? \documentclass[10pt,twoside]{article} \usepackage{amsmath} \usepackage{amsfonts} $$ \mathtt{ x_1 =\left[\begin{...
2
votes
1answer
47 views

Change font size in verbatim and Verbatim using scaling

This question is closely related to several other questions here, but I believe it hasn't been asked (or answered) exactly like this. Is it possible to change the font size in verbatim and Verbatim ...
1
vote
2answers
32 views

Proper linebreaks in teletype font

In my bibliography, I want to include report numbers of technical reports in teletype font. These report numbers typically consist of several blocks of letters and numbers connected by hyphens, like ...
0
votes
1answer
42 views

MakeIndex indexing \texttt{} under “Symbols” and not by letter

I've began adding an index to my Latex project using imakeidx and have run into a small problem: When writing the code \index{\texttt{float} data type} my index shows up as the following: It is ...
2
votes
1answer
45 views

Change size of Python code in LaTeX document

I am trying to input my Python code in a document using this template which uses the listings package. However I want to change the size of the code font i.e. any mentions of \texttt{} and the ...
2
votes
1answer
89 views

Disappearing left quotation mark in `\texttt{}` when using babel (norwegian)

When using the package babel with the norwegian option (\usepackage[norsk]{babel}), double-quotation marks (") in \texttt{} disappear if they occur before certain letters (e.g., b, d, and f), but not ...
0
votes
1answer
27 views

Incompatibility between mathspec and url packages

I use xelatex and mathspec's \setmathfont(Digits,Latin,Greek) which works just fine and the url package with the Computer Modern Unicode Typewriter fonts. What happens is that all digits in my URLs ...
0
votes
0answers
25 views

prevent double hyphen conversion to single using latex2html?

I'm trying to include a double hyphen in this specific line in a manual which I convert to html using latex2html \texttt{export NETCDF\_INCLUDE=\$(nf-config --fflags)} This seems to be a duplicate ...
1
vote
1answer
47 views

Aligning escaped text in listings

Here I use escapechar with listings to set the colour for an individual word in a listing. The text set with listings is set looser though, so this doesn't align. How can I get it to align? \...
2
votes
1answer
83 views

Write mathematical operators in typewriter font [duplicate]

I want to typeset unicode symbols like ≥ (U+2265) and ∧ (U+2227) in the typewriter / tt / monospaced / non-proportional font of my document. I don't care how I have to enter these symbols in my .tex ...
0
votes
1answer
45 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
86 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
193 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
17 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
192 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
100 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 ...
3
votes
1answer
72 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
68 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
561 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
174 views

Put colored text inside a 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
48 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
38 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
54 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
55 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
94 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
102 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
62 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
102 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
51 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 ...
3
votes
2answers
221 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
89 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
102 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
77 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
50 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
260 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
49 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
98 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
198 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
76 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
63 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
293 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
49 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
221 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
30 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
82 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
223 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
30 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
381 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. ...

1 2 3 4 5 6