# Tag Info

## Hot answers tagged inline

79


16

In the source code of the algpseudocode package, look for the definitions of the macros used for typesetting functions and procedures: \algdef{SE}[PROCEDURE]{Procedure}{EndProcedure}% [2]{\algorithmicprocedure\ \textproc{#1}\ifthenelse{\equal{#2}{}}{}{(#2)}}% {\algorithmicend\ \algorithmicprocedure}% \algdef{SE}[FUNCTION]{Function}{EndFunction}% [2]...

15

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.

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}

15

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 ...

15

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 ...

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 + \cFrac{B}{... 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 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+cthen 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) 2.... 13 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 13 \raisebox will do. The height of the contents of \raisebox is available as \height. The tabular environment puts struts with factor \arraystretch in the rows. Since the first line of your tabular only contains normal text, the strut is very likely larger (and probably larger than the extend of the curly brace). Then the argument of \raisbox can be calculated ... 13 In justified paragraphs TeX tries to fill the lines. But it is very difficult, if the line contain large chunks of unbreakable stuff. Then the remaining stretchable spaces are stretched and TeX gives a Underfull \hbox warning. TeX can break inline math at binary and relational operators unless they are inside a subformula. Curly braces or \left and \right ... 12 \documentclass{article} \usepackage{amsmath} \makeatletter \def\mymacro{\ifinalign@ B\else A\fi} \makeatother \begin{document} \mymacro \begin{align} \mymacro \end{align} \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 equationa+1=b~\refstepcounter{equation}(\theequation)\label{myeq}$... 12 \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} 12 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. \end{... 11 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}{ ... 11 I'd define a new environment and use adjustbox for this. The principle is the same as in Heiko's answer. \documentclass[a4paper]{article} \usepackage{adjustbox,varwidth,xparse} \NewDocumentEnvironment{bracedrows}{m} {\begin{adjustbox}{valign=t}%\kern-\nulldelimiterspace\left. \begin{tabular}{@{}l@{}}} {\end{tabular}\right\rbrace \begin{...

10

Line breaking will not occur inside a part of a formula that is enclosed in braces: ${v_{initial} = \SI{1000}{m/s}}$

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