24 votes
Accepted

Basic: How can I stop centering a text?

Note that the approach of {\centering Text} of the accepted answer will not work because there are not a blank line (=\par) before of the closing brace. The same apply to \begingroup\centering ... \...
Fran's user avatar
  • 80.9k
23 votes
Accepted

First letter upper case and other letters in lower case

\documentclass{article} \newcommand\capmystring[1]{\capmystringaux#1\relax} \def\capmystringaux#1#2\relax{\uppercase{#1}\lowercase{#2}} \begin{document} eXample String \capmystring{eXample String} \...
Steven B. Segletes's user avatar
21 votes

Let's get fancy: Text like tag?

Here's an alternative solution with Tikz. Output Code \documentclass[margin=10pt]{standalone} \usepackage{tikz} \definecolor{backg}{RGB}{225,236,244} \definecolor{tagtxt}{RGB}{88,115,159} \...
Alenanno's user avatar
  • 37.4k
21 votes

Draw Text in different shapes

Update Using triangular mesh, we can approximate any continuous transformation. \documentclass[border=9,tikz]{standalone} \begin{document} \pgfmathdeclarefunction{fx}{2}{\pgfmathparse{#1*(3+cos(#2*...
Symbol 1's user avatar
  • 36.9k
20 votes
Accepted

Draw Text in different shapes

I just threw in the \outline macro (requires pdflatex) for the fun of it. The \outline stuff is in the preamble, whereas the necking code is in the main document. I originally stole the code that ...
Steven B. Segletes's user avatar
18 votes
Accepted

Missing $ error <inserted>

You have not provided a full example but I would guess that you have \documentclass[12pt, a4paper]{article} \usepackage[latin1]{inputenc} \begin{document} \section{Goals} \label{Goals} Abbiamo già ...
David Carlisle's user avatar
17 votes

Creating a multi-line colored box in LaTeX

This is another tcolorbox solution which uses the skins and xparse libraries. xparse is used to define a new command \namebox{<first names>}{<last name>}{<content of right hand box e....
cfr's user avatar
  • 199k
15 votes

First letter upper case and other letters in lower case

The expl3 language can do this using Unicode data: \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \NewExpandableDocumentCommand \firstcap { m } { \text_titlecase:n {#1} } \ExplSyntaxOff \...
Joseph Wright's user avatar
  • 260k
14 votes
Accepted

How to add utf-8 symbols correctly?

If you use a Unicode engine (xetex or luatex) it is just a matter of finding a font, which offers these symbols. I have expereinced the DejaVu Sans font to be pretty complete in that regard. You ...
Henri Menke's user avatar
14 votes
Accepted

\textit and \emph doubles text

The command \textit does not permit paragraph breaks in its argument, while all-blank lines cause paragraph breaks. You must be getting the following error message: Runaway argument? { (a) ! ...
Mico's user avatar
  • 507k
14 votes
Accepted

How to decide if a comma or punctuation between math mode content should be inside math mode or in text mode?

You ask, Is there a general rule I can follow to decide whether the punctuation between math mode content should be in math mode or text mode?" Short answer: Yes. Slightly longer answer: The ...
Mico's user avatar
  • 507k
12 votes

Creating a multi-line colored box in LaTeX

A simple solution with a tabular environment and colortbl: \documentclass[paper=letterpaper,fontsize=10pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{geometry} \...
Bernard's user avatar
  • 271k
12 votes
Accepted

Why does LuaTeX plus breqn quadruple output of \text{} when in display-math mode?

“Missing termination in the redefinition of \mathchoice made by mathstyle.sty (loaded by breqn): \documentclass[11pt]{report} \usepackage{amsmath,mathtools} \usepackage{breqn} \makeatletter \def\...
egreg's user avatar
  • 1.1m
11 votes

How to add utf-8 symbols correctly?

You can load the wasysym package and use these commands. Note the \ being used to preserve the space after a macro. \documentclass{article} \usepackage{wasysym} \begin{document} Do you like \LaTeX?...
Alenanno's user avatar
  • 37.4k
11 votes

Creating a multi-line colored box in LaTeX

Perhaps I am mistaken that you are interested in multiple multiline coloured boxes placed adjacently. If that is not the case you can simply do it using parbox like this: \documentclass{article} \...
WYSIWYG's user avatar
  • 312
10 votes

Is it generally a good idea to insert some glue in \vspace?

It is almost never a good idea to have stretchable glue between lines of a paragraph as you have in the question. A paragraph should be set as a consistent block. You may or may not want the glue ...
David Carlisle's user avatar
10 votes

Creating a multi-line colored box in LaTeX

\documentclass{article} \usepackage{color} \begin{document} \colorbox{black}{\textcolor{white}{\Large\bfseries\sffamily \begin{tabular}{@{}l@{}} FirstName\\ lastName \end{tabular}}} \end{document}
David Carlisle's user avatar
10 votes
Accepted

Text transforming functions

\documentclass{article} \usepackage{stringstrings} \newcommand\latinify[1]{% \convertchar[q]{#1}{U}{V}% \convertchar{\thestring}{W}{VV}% } \begin{document} \def\myphrase{CUSTWINIUS} \myphrase{} ...
Steven B. Segletes's user avatar
10 votes
Accepted

How to embed plain text into math mode?

Probably you like to achieve this: Instead of \text in first occasion you should use \parbox which enable to write two line text. After than you need to clean-up remedy with curly braces: \begin{...
Zarko's user avatar
  • 297k
10 votes

Stretch \Leftrightarrow according to above text

Use the command \usepackage{amsmath} \makeatletter \newcommand{\xLeftrightarrow}[2][]{\ext@arrow 0099\Leftrightarrowfill@{#1}{#2}} \makeatother This is a variation of the answer to "\xRightarrow (...
gernot's user avatar
  • 49.6k
10 votes
Accepted

How to make circle of text in latex?

Steps: background color: draw the coloured wheel in the background construct wheel: draw lines and circles above add text: input text positioning Coloring: Draw the path of the different parts. ...
Bobyandbob's user avatar
  • 4,894
10 votes

Challenge: Add descriptions around the arrows in a Tikz flow chart?

With the use of the quotes tikz library: I took a liberty and also changed the positioning of the nodes. You can still stick with your solution with matrix and adequately changes the node names: \...
Zarko's user avatar
  • 297k
9 votes

Text transforming functions

The \replacestrings from OPmac can be used. It is implemented by few lines of TeX code: \long\def\addto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}} \bgroup \catcode`!=3 \catcode`?=3 \gdef\...
wipet's user avatar
  • 74.5k
9 votes

Let's get fancy: Text like tag?

You could use \colorbox{red}{text} from the standard latex color package.
David Carlisle's user avatar
9 votes

Radial text (like rays of sunlight)

You can rotate lines using Tikz. In the below example I have a command textbeam that rotates the text a certain angle around a coordinate (the sun). That can be used to go through the text strings in ...
StefanH's user avatar
  • 13.8k
9 votes
Accepted

Reducing line spacing in a tikz-pgfplots node with line break

somehow similar to @esdd answer but with even closer lines: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.15} \begin{document} \begin{tikzpicture} \begin{axis}[xmin=0, xmax=...
Zarko's user avatar
  • 297k

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