Skip to main content
56 votes
Accepted

Should I use ~ or \mbox?

In none of the presented cases you should use \mbox. Phone numbers should use a kern, such as 123\,456\,7890 Things such as p.~210~sq.\@ should use a tie (note the \@ in order not to make the period ...
egreg's user avatar
  • 1.1m
39 votes

How to type special/accented letters in LaTeX?

Users looking to make common accents in regular text mode can do so with, for example, \'e. MWE: \documentclass[10pt]{article} \begin{document} Alfred Land\'e. \end{document} Output:
user1717828's user avatar
33 votes

Underscores in words (text)

The solution I like best is to put \chardef\_=`_ in the preamble and use \_ to typeset an underscore. That is because: \verb doesn't work in macros, \char`_ is tedious to write and looks confusing, \...
arekolek's user avatar
  • 595
32 votes
Accepted

Is there any reason to prefer a unicode symbol versus its LaTeX command counterpart?

Do you use BibTeX to create a formatted bibliography? If so, let's assume the bibliography contains entries authored by persons with surnames Åsgard and Æsgard. You may be surprised to learn that ...
32 votes

Is there any reason to prefer a unicode symbol versus its LaTeX command counterpart?

Assuming you are using pdflatex (not a Unicode TeX such as Lualatex) then Å is defined by \DeclareUnicodeCharacter{00C5}{\r A} so it expands essentially to to \r{A} \AA is defined by \def \AA {\r A}...
David Carlisle's user avatar
30 votes
Accepted

A never-written char "b" appears in a minipage

The optional argument of minipage can only be c t or b your extra letters such as br are breaking the tests and causing unexpected tokens to be typeset. The main issue is that (due to memory ...
David Carlisle's user avatar
23 votes

Should I use ~ or \mbox?

The \mbox is totally unbreakable, i.e., it does not allow hyphenation nor any other breaks. The tilde ~ inserts an unbreakable space, but does not affect the breakability of its left and right ...
Sir Cornflakes's user avatar
22 votes

Acrostics in latex (how to hide a message)

Since the first-letter arrangement heavily influences the line-breaking, it is assumed that this is done manually. As such, I'm assuming you're okay with adding a \\ at the end of each line, similar ...
Werner's user avatar
  • 606k
21 votes
Accepted

How do I make LaTeX understand Unicode characters ↔︎ and ↕︎

Actually, LaTeX has a pretty good Unicode support (better yet since the October 2019 update). You just need to define the character you want to type: \documentclass{article} \DeclareUnicodeCharacter{...
Phelype Oleinik's user avatar
20 votes
Accepted

How to type the letter Ł

The traditional markup (going back to plain TeX) is \L in current releases you can simply use Ł \documentclass{article} \begin{document} Ł \end{document} Prior to the 2018 LaTeX release you ...
Skillmon's user avatar
  • 61.2k
20 votes

How do I make LaTeX understand Unicode characters ↔︎ and ↕︎

I would recommend the newunicodechar package for this: \usepackage{newunicodechar} \newunicodechar{↔}{\ensuremath{\leftrightarrow}} \newunicodechar{↕︎}{\ensuremath{\updownarrow}} You could also ...
Davislor's user avatar
  • 45k
19 votes
Accepted

How can i prevent LaTex from converting a apostrophe combination to this weird character?

Never use " for quotes. In particular, if you use babel-german, where " is a shorthand character. \documentclass{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[ngerman]{...
egreg's user avatar
  • 1.1m
18 votes

Underscores in words (text)

There's a package for this! \documentclass{article} \usepackage{underscore} \begin{document} This_is_probably_not a_good_idea. \end{document}
JPi's user avatar
  • 13.7k
17 votes
Accepted

How to deactivate % as special character?

You can make % punctuation character by \catcode`\%=12
David Carlisle's user avatar
16 votes
Accepted

How does "\char`" work?

It is a misunderstanding to attach the left quote to the \char command as you do by writing \char`. \char expects as argument a number. With the left quote you are converting the next character or ...
Ulrike Fischer's user avatar
16 votes

Is there any reason to prefer a unicode symbol versus its LaTeX command counterpart?

Not every font includes the high Unicode glyphs, so putting one of them in a macro allows me to redefine it as necessary. You can still use the Unicode character in the macro definition. Sometimes it ...
musarithmia's user avatar
  • 12.5k
15 votes

Outlined characters

Package pdfrender for pdfTeX or LuaTeX (newer versions require package luatex85) allows to configure the outline with many parameters as fill color, stroke color, or line width for stroking. Because ...
Heiko Oberdiek's user avatar
15 votes

Insert Unicode private char

If the engine is Unicode aware and a font is used, which contains the glyph for the private Unicode code point: ^^^^e25f See: The ^^ notation in various engines. This is TeX's method to encode non-...
Heiko Oberdiek's user avatar
15 votes
Accepted

Change only ONE character in Latex template

Just change the \mathcode of v: \documentclass{book} \usepackage{amsmath} \usepackage{txfonts} \AtBeginDocument{\mathcode`v=\varv} \begin{document} A `v' in math: $v$ A `nu' in math: $\nu$ \end{...
egreg's user avatar
  • 1.1m
15 votes

How to type the letter Ł

Quick answer: \L{} or \l{} Reference: https://latex.org/forum/viewtopic.php?t=2239
user193679's user avatar
15 votes
Accepted

How do I prevent "s from turning into ß with babel?

The character " should never be used in running text to denote quotes. For double English quotes, use ``Test'' s If you want German style quotes, use "`Test"' s With UTF-8 input, you can use “...
egreg's user avatar
  • 1.1m
14 votes
Accepted

How to place a dot below for example: e?

Line 84 of latex/base/tuenc.def is \relax\detokenize{#2}^^a0\else#2\fi Please edit to say \if\relax\detokenize{#2}\relax^^a0\else#2\fi I'll get an update to the release this evening, sorry.
David Carlisle's user avatar
14 votes
Accepted

How can I show S-comma in LaTeX math mode?

Words, even without accents should not be in math italic, so \text{unde} and \text{și}
David Carlisle's user avatar
13 votes

How to deactivate % as special character?

In ConTeXt you can use ASCII mode by saying \asciimode. This will disable the special meaning of #$%&^_|~ for the whole document from that point. You can still have comments with double percent ...
Henri Menke's user avatar
13 votes

TeX and ASCII table code

There is not anything called "the extended ascii" there are hundreds of ascii extensions "code pages" where the values between 128 and 256 might be accented latin letters as you have, or cyrillic, or ...
David Carlisle's user avatar
13 votes

Is there any reason to prefer a unicode symbol versus its LaTeX command counterpart?

PDFTeX, unlike XeTeX or LuaTeX, cannot understand combining characters such as U+030A. So, Å in decomposed form would fail, and you would need to use Å (U+00C5). This contradicts the Unicode ...
Davislor's user avatar
  • 45k
12 votes
Accepted

Adding complex phonetic symbols to LaTeX

As explained by this answer, you can either use tipa and compile using pdfLaTeX or load a Unicode IPA font using fontspec and compile using XeLaTeX or LuaLaTeX. I strongly recommend using a Unicode ...
Jason Zentz's user avatar
  • 4,158
12 votes

Redefining a letter to itself

An \expandafter before \active tokenizes the following \def without the changed category code of e: { \catcode`e=\expandafter\active \def e{\char`e} SomeText } Another trick works ...
Heiko Oberdiek's user avatar
12 votes
Accepted

Handling optional commas in text

Unobtrusive parts in a TeX file can be made with a single character if it is an active character. Here is how you can do it with ; for \optionalcomma (if you don't need real semicolons). \...
pst's user avatar
  • 4,684

Only top scored, non community-wiki answers of a minimum length are eligible