# Inline math and vertical spacing

I use inline mathematics in a document. But for that I need a wider indentation. Example, now my math looks like this:

I need it to be like this:

Code:

\usepackage{amsmath}

1) $\delta (a_1) = \dfrac{|5,19615 - 5,19|}{5,19} = 0,0012 = 0,12\%$

2) $\delta (a_1) = \dfrac{|2,63157 - 2,63|}{5,19} * \dfrac{|2,63157 - 2,63|}{5,19} * \dfrac{|2,63157 - 2,63|}{5,19} * \dfrac{|2,63157 - 2,63|}{5,19} * \dfrac{|2,63157 - 2,63|}{5,19}= 0,0006 = 0,06\%$


Impotant! I need immutable size the number in fractional.

• Welcome to TeX.SE! Could you please add a minimal but compilable example which reproduces your output? – CarLaTeX Nov 5 '19 at 20:49
• Off-topic but nevertheless important from a typographic point of view: If you use commas as decimal separators in math mode, you should either encase them in curly braces (to change their math status from math-punct to math-ord). Otherwise, what'll happen is exactly what's shown in the upper screenshot you posted: there will be an inappropriate gap to the right of each comma. – Mico Nov 5 '19 at 20:59
• @Mico, for this case i not use list. And thanks for help with commas as separators. – Dmitry Shkulnik Nov 5 '19 at 21:15
• @Micom sorry, ok. – Dmitry Shkulnik Nov 5 '19 at 21:23

Don't hand-code enumerated items. It's tedious and error-prone. Instead, load the enumitem package and employ an enumerate environment. E.g.,

\begin{enumerate}[label=\arabic*)]
\item $\delta (a_1) = \dfrac{|5,19615 - 5,19|}{5,19} = 0,0012 = 0,12\%$
\item $\delta (a_1) = \dfrac{|2,63157 - 2,63|}{5,19} = 0,0006 = 0,06\%$
\end{enumerate}


Incidentally, if you use commas as decimal markers, you should encase them in curly braces in order to keep getting whitespace to the right of the commas. (By default, TeX assigns status math-punct to commas in math mode.)

A final comment: If your document uses a Times Roman text clone, you should give serious thought to employing a compatible math font. E.g., if you load the newtxtext package, do consider loading newtxmath as well.

A full MWE (minimum working example):

\documentclass{article} % or some other suitable document class
\usepackage{newtxtext}  % optional: Times Roman clone text font
\usepackage{amsmath}    % for \dfrac macro
\usepackage{enumitem}
\begin{document}
1) $\delta (a_1) = \dfrac{|5,19615 - 5,19|}{5,19} = 0,0012 = 0,12\%$

2) $\delta (a_1) = \dfrac{|2,63157 - 2,63|}{5,19} = 0,0006 = 0,06\%$

\begin{enumerate}[label=\arabic*)]
\item $\delta (a_1) = \dfrac{|5{,}19615 - 5{,}19|}{5{,}19} = 0{,}0012 = 0{,}12\%$
\item $\delta (a_1) = \dfrac{|2{,}63157 - 2{,}63|}{5{,}19} = 0{,}0006 = 0{,}06\%$
\end{enumerate}
\end{document}

• Yes, its worked. But only for this situation. Maybe I poorly described. If in this case paste a long math expression, for example on 2 lines, vertical spacing was small. I change post and paste another expression. – Dmitry Shkulnik Nov 6 '19 at 8:41
• @DmitryShkulnik - In my opinion, you're violating a cardinal typographic rule by insisting on using \dfrac for inline-math expressions, especially when the expressions span more than one line. (Hint: The d in \dfrac stands for "display-math style".) I'm not at all surprised that the output you get is unsatisfactory. The fact that the output isn't satisfactory in no way implies, though, that TeX is doing something wrong. The real remedy is for you to stop using \dfrac for inline-math expressions. – Mico Nov 6 '19 at 20:31

A variant using the medium-sized fractions from nccmath has a better vertical spacing:

\documentclass{article} % or some other suitable document class
\usepackage{newtxtext} % optional: Times Roman clone text font
\usepackage{amsmath, nccmath} % for \dfrac macro
\usepackage{enumitem}

\begin{document}

\begin{enumerate}[label=\arabic*)]
\item $\delta (a_1) = \mfrac{|5{,}196\,15 - 5{,}19|}{5{,}19} = 0{,}001\,2 = 0{,}12\,\%$
\item $\delta (a_1) = \mfrac{|2{,}631\,57 - 2{,}63|}{5{,}19} = 0{,}000\,6 = 0{,}06\,\%$
\end{enumerate}

\end{document}


• Hi! Its fine but I need the number not change size. In nccmath and \mfrac - it is clear that the numbers of steel are proportionally smaller. But I need immutable size the number in fractional. – Dmitry Shkulnik Nov 6 '19 at 8:47
• In this case, the spacing in the enumerate environment, with enumitem is controlled through the key itemsep=, which you can adjust to your needs. – Bernard Nov 6 '19 at 9:39