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 ... \...
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}
\...
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*...
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à ...
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
\...
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)
! ...
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 ...
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{...
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 (...
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. ...
10
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=...
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:
\...
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 ...
9
votes
Writing conditional math equation in latex
You can have a simpler typing with the dcases* environment from mathtools: The d in the name of the environment means it will typed in \displaystyle and the star means the second column will be in ...
9
votes
Accepted
Greek letter with two dots over in text mode
You can use alphabeta:
\documentclass{article}
\usepackage{alphabeta}
\begin{document}
\accdialytika{\texttheta}
\end{document}
9
votes
Accepted
How to create text box as shown in the Figure?
LaTeX is not really designed to allow that, so it will be tricky. Anyway,
there is a package --- called cutwin --- on CTAN, which in the second page of the documentation has:
Anyway --- the best ...
9
votes
Accepted
How to Improve the Appearance of Aligned Typewriter Text in a Minipage
As you have stretchy inter-word spaces, there is no monospaced character alignment you would be better to use a variable width typewriter font, as justifying monospace will always look awful.
lvmtt ...
8
votes
Accepted
line numbers do not show on for the text of a paragraph in which an equation is defined
The documentation of lineno shows this is not just a problem for align but also for other displays. It provides an environment linenomath to wrap around such displays to fix the problem:
\begin{...
8
votes
Make blocks of text invisible only if said so
One possibility is the multiaudience package:
\documentclass{article}
\usepackage{multiaudience}
\SetNewAudience{long}
% remove comment from the following line for the long version
%\...
8
votes
The symbol "~" is not showing up
~ is a latex special character for a non-breaking space. \textasciitilde is the command to produce ~ (in the default OT1 font there is no ~ so in that case it falls back to use the tilde accent over ...
8
votes
Writing conditional math equation in latex
You can use the cases* environment from mathtools package which loads amsmath internally. It enables you to write in normal mode in the right column, so you don't worry about spacing between words.
\...
8
votes
How do I add slurs (as in music notation) to top of the words in a text? [added follow-up]
\documentclass{article}
\usepackage{scalerel,stackengine}
\newcommand*{\slur}[1]{%
\sbox0{#1}%
\sbox2{\rotatebox[origin=bl]{90}{\stretchto{)}{\wd0}}}%
\stackengine{0pt}{\vphantom{X}#1}%
{\...
8
votes
Accepted
How do I add slurs (as in music notation) to top of the words in a text? [added follow-up]
I propose a TikZ solution. With a \slur macro that takes two arguments, the text below the slur and the color of the said slur. This macro computes and fills two arcs above the text, with customizable ...
8
votes
Accepted
First Letter Big and Inset into the next line?
You can use the package lettrine to do the job.
\documentclass{book}
\usepackage{newtxtext} % you want true small caps
\usepackage{lettrine}
\begin{document}
\chapter{Beginning}
\lettrine{F}{ew ...
8
votes
how can I write an inline hexadecimal value?
\documentclass{article}
\newcommand\0[3]{\texttt{\string\0#1#2#3}}
\begin{document}
\0x68 \0x6F \0x77 \0x20 \0x64 \0x6F \0x3F
\end{document}
7
votes
How to add a line inside an equation
Define a suitable command for those “textual variables”:
\documentclass{article}
\usepackage{amsmath}
\newcommand{\tvar}[1]{%
\textup{%
\begin{tabular}{@{}l@{}}
#1
\end{tabular}%
}%
}...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
text × 686tables × 83
tikz-pgf × 56
formatting × 51
math-mode × 44
equations × 44
graphics × 42
spacing × 38
horizontal-alignment × 36
positioning × 29
alignment × 29
align × 27
floats × 26
color × 25
fonts × 23
vertical-alignment × 21
wrap × 20
minipage × 18
nodes × 18
beamer × 16
macros × 15
overleaf × 15
pdftex × 14
text-manipulation × 14
symbols × 13