# Tag Info

32

put it into braces {...}, then it will be a math atom and not broken at the end of the line. ${v_{initial} = \SI{1000}{m/s}}$ the prevent an overfull box use \sloppy: \documentclass{article} \usepackage{siunitx} \begin{document} {\sloppy A text with an inline equation which is broken in to two parts but is not wanted right here ${v_{initial} = ... 22 I think you can justly regard this strange behaviour as kind of a bug in TeX's sub- and superscript positioning algorithm; it doesn't make sense that both the sub- and the superscript are raised. See below for some suggestions on how to fix the problem. At the end I offer a new positioning algorithm, and I compare it with the old algorithm. (Sorry for the ... 15 I'm sure you are looking for the holtpolt package and its command \polter, like in the following example: \documentclass{standalone} \usepackage{holtpolt} \begin{document} $a_0+\polter{1}{a_1}+\polter{1}{a_2}+\cdots+\polter{1}{a_n}+\cdots$ \end{document} 14 A couple of versions, you probably need to fiddle with the spacing to get exactly what you need but: \documentclass{article} \def\cFrac#1#2{% \begin{array}{@{}c@{}}\multicolumn{1}{c|}{#1}\\% \hline\multicolumn{1}{|c}{#2}\end{array}} \def\cFracB#1#2{% \vcenter{\hbox{\strut$#1$\,\vrule}\hrule\hbox{\strut\vrule\,$#2$}}} \begin{document}$ A + ...

14

The default positions of sub and superscripts are closer to the baseline in textstyle as TeX tries to maximise the chance that the expression does not disturb the paragraph line spacing. Your first example is the standard setting for inline math, however with the larger scripts caused by the subscripting, TeX has to move them further apart. This is ...

14

TeX features a special primitive for this very case. However, you will have to specify code for all four math styles: \mathchoice{display}{text}{script}{scriptscript} See TeX by Topic for more information.

14

The enumitem package has an inline option which implements inline versions of the standard lists using starred versions of the basic list environments. As with other enumitem lists, labels and (horizontal) spacing can be set with key values as well as custom settings for the elements between the list items (typically punctuation). \documentclass{article} ...

13

You can directly tell where the baseline should meet the picture using the baseline option \documentclass{article} \usepackage{tikz} \begin{document} the distance \tikz[baseline=-0.5ex]{ \draw [|-|] (0,0) -- (5ex,0); } overarching the activities \end{document}

12

I'm not sure if this is a good idea or not (imagine a new reader searching for equation 2.1, for example), but the following seems to do what you want; note that I've used refstepcounter to increment the equation counter. \documentclass{article} \usepackage{amsmath} \begin{document} The equation $a+1=b~\refstepcounter{equation}(\theequation)\label{myeq}$ ...

12

Using ${....}$ does indeed prevent a formula from being broken across lines but at the cost that you freeze up all spacing within the formula at its natural width. If you write $a=b+c$ then LaTeX generates the following list for you: \mathon \OML/cmm/m/it/10 a \glue(\thickmuskip) 2.77771 plus 2.77771 \OT1/cmr/m/n/10 = \penalty 500 \glue(\thickmuskip) ...

11


11

Images are added with a zero depth, i.e. they sit on the baseline. It depends very much on the situation (and personal taste) what the "ideal" placement of a particular image is. So no, there is no way to automatically get-it-just-right (TM). Note that \raisebox allows the use of \height, \depth, \width and \totalheight (=height+depth) which represent the ...

10

I was a little bit surprised to discover that this wasn't already catered for by the fancyvrb package. When using that package, the problem would appear to be because the newline character is defined to be an outer macro, which can't then be gobbled into the verbatim command. So here's a little modification that defines a command \VerbLB which converts ...

10

The following defines \inlineequation: \inlineequation[<label name>]{<equation>} Optionally <label name> can be given for referencing the equation. \label afterwards keeps the previous referencing behavior like an environment equation would have done. \refstepcounter is called at the beginning of the inline equation, because package ...

9

As other answers have mentioned you may use an extra set of {} however this is essentially equivalent to using \mbox{......} and like all such boxing does two things. It prevents line breaking but it also freezes all white space at its natural size and prevents stretching or shrinking, this makes it even harder to fit the unbreakable box into the paragraph. ...

9

aligned is intended for this. But also align works if you use \parbox: Text \displaystyle\parbox{2cm}{\begin{align} x &= 1 \\ y &= 0 \end{align}} \quad more text

9

Taking the definitions you make in the other question, here's a way: \mathchoice has four arguments, stating what's to be done in the various situations; \mathop states how the symbol should be considered with respect to spacing and ending with \displaylimits ensures the same behavior as \sum: \documentclass{article} \usepackage{tikz} \newcommand{\osum}{ ...

9

Anything you enclose within an \hbox or the equivalent LaTeX \mbox will not break. However overflowing into the margins is not a good idea. In the minimal below you can see the effect by using the geometry package to show a border around the normal text area. \documentclass{octavo} \usepackage[showframe=true]{geometry} \begin{document} \mbox{This is an ...

9

You need to run this twice \documentclass{article} \usepackage{color} \makeatletter \def\savepos#1{\leavevmode\pdfsavepos\write\@auxout{% \gdef\string\save@#1{{\the\pdflastxpos sp }{\the\pdflastypos sp }}}} \def\xx#1{\expandafter\expandafter\expandafter\@firstoftwo\csname save@#1\endcsname} ...

9

\everydisplay can be used to make a different setting for displayed equations: \documentclass{article} \medmuskip=0mu % \everydisplay{\medmuskip=10mu\relax} \begin{document} \centering $a+b=c+d$ $a+b=c+d$ \end{document}

8

Tell TeX that the figure should be as high as a “B”: Some text... \includegraphics[height=\fontcharht\font\B]{picture.png} ... some more text. You probably want to define a special command for this: \newcommand{\mychar}{% \begingroup\normalfont \includegraphics[height=\fontcharht\font\B]{picture.png}% \endgroup } and type your paragraph as ...

8

Token register method The problem is that the list environment is not too happy, if \item is put inside a group. \foreach of pgffor puts the body inside groups. The following file uses a token register to collect the body of the environment. \Choice needs to be expanded once. \documentclass{article} \usepackage[inline]{enumitem} \usepackage{pgffor} ...

8

There are some strategies that you could use: enclosing the expression inside braces, or boxing it, but in some cases this can produce overfull boxes. Most of the times the best solution is to rephrase the text where the formula appears so that a line break doesn't occur. An example where things go right: \documentclass[draft]{article} \begin{document} ...

8

You can use \rotatebox (from the graphicx package) with the origin=c option instead; a little example: \documentclass{article} \usepackage{graphicx} \begin{document} A\rotatebox{90}{B}C A\rotatebox{270}{B}C A\rotatebox[origin=c]{270}{B}C \end{document}

7

There is some glue in \:, but not in \!: the first uses \medmuskip which is 4.0mu plus 2.0mu minus 4.0mu, the second \thinmuskip which is 3.0mu. To avoid the glue use only \! or, simpler, just \mkern: \documentclass[a5paper]{article} \newcommand{\md}{\ensuremath{M\mkern-9mu D}} \begin{document} a a a a a a a a a a a a a a a a a a a a a a $\md$ a a a a ...

7

The Solution Use paralist for the purpose of making horizontal list. At allows you to make lists which can be used within paragraphs. Use inparaenum environment for such a list. The Code \documentclass{article} \usepackage{paralist} \begin{document} Text before list. \begin{inparaenum} \item My first in list. \item My second in list. ...

6

If you insert a formula as $\smash{<formula>}$ its vertical size will not be considered during typesetting. However, spaces inside the formula won't stretch or shrink together with the other spaces in the line, which could change the typesetting. So, in the case of a formula with an equality you should type $x=\smash{<big subformula>}$ I'd ...

6

Is this what you're looking for? Output Code \documentclass{article} \usepackage{tikz} \newcommand\code[1]{ \tikz[baseline=(s.base)]{ \node(s)[rounded corners,fill=orange!20,draw=gray]{\texttt{#1}}; } } \begin{document} Further, lists can be turned into \textcolor{blue}{Task Lists} by prefacing list items with \code{[ ]} or \code{[x]} ...

6

If you use the enumitem package, you can pass the option [inline]. Doing this enables starred environments corresponding to the regular ones which produce inline lists (\begin{enumerate*}, \begin{itemize*} etc.): \documentclass{article} \usepackage[inline]{enumitem} \begin{document} Text before list. \begin{enumerate*}[label=(\roman*)] \item My first in ...

6

Using inline math is so wrong for this (but I say same every time you post an example). However if you must, you must... \documentclass{article} \usepackage[a6paper,vmargin=15mm,hmargin=5mm]{geometry} \usepackage{times} \usepackage{helvet} \usepackage{courier} \usepackage[T1]{fontenc} \usepackage{mathtools} \allowdisplaybreaks \usepackage{tcolorbox} ...

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