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
2answers
34 views

How can I use \texttt{some text} for the names of greek letters?

I want to write coefficients names as alpha_0, beta_1 and phi_1 using \texttt{...} to make it look like a function arguments. I tried \texttt{alpha_0} but I got an error ! Missing $ inserted.<...
0
votes
1answer
35 views

How to prevent \texttt from making the text bold

I tried to escape the underscore character but the resultant "_" did not look perfect. Then I came across another answer suggesting to use \texttt. However, I see that \texttt is also ...
1
vote
0answers
22 views

Push \texttt in tcolorbox to a new line if it doesn't fit

So I use a colorbox with \texttt for inline code fragments, and as you can see from the picture below, the code fragments run off the page. What I would like is for the colorbox to appear on the next ...
1
vote
1answer
37 views

The most fancy way to write 2D array

I have something like What's the best way to do it? I tried this method but it doesn't work. \begin{array}{r}[[0.86455156], \\ [-0.82104237], \\ [4.12186079]]\end{array} Getting,
1
vote
2answers
29 views

problem with symbol ^, kerkis-font and texttt

I want to write something like this SomeCode^MoreCode, so I wrote the code below. \documentclass{article} \usepackage[english,greek]{babel} \usepackage[utf8]{inputenc} \usepackage{kerkis} \begin{...
2
votes
1answer
40 views

Missing { / } inserted when using \texttt

I recently had to reinstall my tex environment (texlive under windows), and afterwards I got lots of "Missing { [or }] inserted" errors. I managed to track the cause down to the use of \...
17
votes
3answers
1k views

Is there an easy way to enter texttt mode, like $ for math mode?

When I want to refer to a math variable, say some index i, I simply surround it with dollars (i.e., $i$) as opposed to writing \begin{math}i\end{math}. Is there some similar option for texttt mode, e....
3
votes
1answer
35 views

Monospaced numbers in invoice2

I am trying to make an invoice where the entries are all using ttfamily, in the invoice2 package, but can't seem to get the numbers (as opposed to the table text) in monospace. This is frustrating as ...
1
vote
0answers
37 views

How to detect teletype/typewriter mode

How do I detect whether or not I'm in teletype mode in LaTeX? I'm looking for something like \ifmmode or \mathpalette or \mathchoice. Perhaps this is an xy problem, so let me give my original context:...
4
votes
2answers
333 views

Typewriter font for Korean language

A little while ago I asked some questions about the Greek language in LaTeX and got some excellent responses. In the same context I'm looking now to the Korean Language but I'm having problems setting ...
2
votes
3answers
75 views

Missing characters in Greek output due to `\ttfamily`

Unfortunately the next question in the series ASCII text set in Greek script when using \usepackage[greek]{babel} / Missing characters in output due to `\renewcommand{\familydefault}{\sfdefault}` When ...
0
votes
0answers
53 views

How to emulate “typewriter” style?

[Not sure how to word this question exactly, please let me know if it is a duplicate.] Many older scientific papers are set completely in "typewriter" style. Here is an equation that was set using ...
1
vote
2answers
106 views

Fira Mono is oblique not upright by default

I'm trying to use Fira Mono as my monospaced font, but when I compile my MWE (below) in XeLaTeX or LuaLaTeX the font ends up in its oblique variant. What should I be doing differently? \documentclass{...
1
vote
0answers
38 views

texttt in metropolis-beamer is sometimes in italic - XeLaTex and pdfLaTex [closed]

I'm using Overleaf and metropolis theme to create my presentation in beamer and there is something wrong with \texttt. When using XeLaTex for compilation, \texttt returns text in italic: \...
0
votes
1answer
87 views

Use Roboto monospaced font for \url

I am using the Roboto font for section titles; I also want to use it for ttfamily kind of cases, such as \url, especially because it is more condensed than the default font. Looking at the font ...
2
votes
2answers
40 views

How to get monospace characters with pmboxdraw?

I want to have a monospace font for block characters, U+2580, U+2584, U+2588 (see below). For those characters, I use pmboxdraw. \documentclass{article} \usepackage{pmboxdraw} \begin{document}\tiny\...
1
vote
2answers
96 views

How to use typewriter fonts in math mode? [duplicate]

How can we use teletypewriter fonts in math mode? In the following code, $X_i$ still comes italic and non-typewriter font. $\texttt{fnfoo(X_i)}$ gives errors "Missing $ inserted". \documentclass{...
1
vote
2answers
51 views

Full Justification in ttfamily

Here is my MWE. I wish for text with full justification, that is the text lines up perfectly with the right margin. I can not find a simple answer to this, Please help. \documentclass[oneside,12pt]{...
4
votes
3answers
311 views

Underscore is shorter for ttfamily

I'm struggling with the problem with underscores in a mono font. It looks like it is shorter than other symbols. For example: \documentclass{article} \begin{document} \ttfamily Test \\ .------------....
0
votes
0answers
34 views

polyglossia, czech, xelatex: Bad character code (-1) with \tt

Polyglossia with Czech and \tt fails when I'm compiling the file with xelatex. It works with lualatex and it works with \setmainlanguage{english}. What is causing this behavior? MWE: \documentclass{...
3
votes
1answer
56 views

Shaded verbatim and fragile frame [duplicate]

I have a beamer class file, with a plenty of frames. Almost all frames need the option [fragile] because I frequently use \verb| | to illustrate codes. So I want the frame to be equipped with [...
4
votes
3answers
642 views

How could one have typewriter (monospaced) numbers throughout a document (LuaLaTeX)

I would like to have all numbers in a typewriter (monospace) font throughout my document, but maintain the usual serif font for everything else. See column A in the picture below (which was kindly ...
2
votes
1answer
57 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
48 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
79 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
609 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
111 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
218 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
97 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
35 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
31 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
81 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
177 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
55 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
392 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
219 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 ...
2
votes
2answers
241 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
129 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
141 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
109 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
568 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
238 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
61 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
43 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 ...
2
votes
0answers
118 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
118 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
125 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
177 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
86 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
132 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
2 3 4 5
7