# How can I produce even line spacing in the following paragraph with loads of inline math formulas?

Normally when writing inline math formulas, in a paragraph of text, the line spacing is kept in tact but consider the following example

produced with the following code

\begin {document}

\textbf{$c_0$ is a complete metric space.} Suppose $x$ is a limit point of $c_0$. Then there exists $(x^{(k)} )_{k \in \mathbb{N}} \in c_0$ and such that  $x^{(k)} \to x$. Let $\epsilon>0$ and pick $N$ such that $\|x^(k)-x\|_\infty < \frac{1}{2} \epsilon$ for $k \ge N$. Since $x^{(N)} \in c_0$, there is some $N'$ such that $|x_i^{(N)} | < \frac{1}{2} \epsilon$ for $i \ge N'$. Then $|x_i| \le |x_i^{(N)} | +|x_i-x_i^{(N)} | \le |x_i^{(N)} | +\|x-x^{(N) } \|_\infty <\epsilon$. Hence $x_i \to 0$ and so $x \in c_0$.

\end {document}

Would it be possible to format it so that the line spacing - between the ordinary text - is kept constant?

Much grateful for any help provided!

\documentclass[a4paper]{article}
\usepackage{amsfonts,amsmath,parskip}
\usepackage{ebgaramond} %font
\addtolength\textwidth{2cm} % I have not used this
\begin {document}

\textbf{$c_0$ is a complete metric space.} Suppose $x$ is a limit
point of $c_0$. Then there exists
$(x^{(k)} )_{k \in \mathbb{N}} \in c_0$ and such that $x^{(k)} \to x$. Let $\epsilon>0$ and pick $N$ such that
$\|x^{(k)}-x\|_\infty < \frac{1}{2} \epsilon$ for $k \ge N$. Since
$x^{(N)} \in c_0$, there is some $N'$ such that
$|x_i^{(N)} | < \frac{1}{2} \epsilon$ for $i \ge N'$. Then
$|x_i| \le |x_i^{(N)} | +|x_i-x_i^{(N)} | \le |x_i^{(N)} | +\|x-x^{(N) } \|_\infty <\epsilon$. Hence $x_i \to 0$ and so $x \in c_0$.

\end{document}
• Please, extend your code snippets to one complete small document, which we can test as it is ... – Zarko Jan 1 at 17:22
• \begingroup\lineskiplimit=-\maxdimen <your contents>\endgroup – Ruixi Zhang Jan 1 at 17:32
• please post a complete test document not just a fragment, the spacing depends on all the global settings in the preamble that you have not shown. – David Carlisle Jan 1 at 17:39
• @RuixiZhang never believe the OP:-) – David Carlisle Jan 1 at 17:46
• I added a possible test document but it produces different set of linebreaks, please either edit the code to match your image or post the image from that code if that is an acceptable example. – David Carlisle Jan 1 at 17:50

The problem is with the expressions x_i^{(N)}. You may coerce TeX to lower the exponent by smashing the subscript, but then the parenthesis would clash with the “i”. This can be cured by lowering a bit the subscript.

\documentclass[a4paper]{article}
\usepackage{amsfonts,amsmath,parskip}
\usepackage{ebgaramond} %font

%\usepackage{ebgaramond-maths}
%\let\epsilon\varepsilon

\addtolength\textwidth{2cm} % I have not used this

\newcommand{\ssub}[1]{_{\smash{\raisebox{-1pt}{$\scriptstyle#1$}}}}

\begin {document}

\emph{$c_0$ is a complete metric space.} Suppose $x$ is a limit
point of $c_0$. Then there exists
$(x^{(k)} )_{k \in \mathbb{N}} \in c_0$ and such that $x^{(k)} \to x$. Let $\epsilon>0$ and pick $N$ such that
$\|x^{(k)}-x\|_\infty < \frac{1}{2} \epsilon$ for $k \ge N$. Since
$x^{(N)} \in c_0$, there is some $N'$ such that
$|x\ssub{i}^{(N)} | < \frac{1}{2} \epsilon$ for $i \ge N'$. Then
$|x\ssub{i}| \le |x\ssub{i}^{(N)} | +|x\ssub{i}-x\ssub{i}^{(N)} | \le |x\ssub{i}^{(N)} | +\|x-x^{(N) } \|_\infty <\epsilon$. Hence $x\ssub{i} \to 0$ and so $x \in c_0$.

\end{document}

I changed the boldface text into italics: using boldface Garamond is anathema.

Uncommenting the two lines in the code above will use Garamond also for math.

Using different notation may improve the appearance.

\documentclass[a4paper]{article}
\usepackage{amsfonts,amsmath,parskip}
\usepackage{ebgaramond} %font

\usepackage{ebgaramond-maths}
\let\epsilon\varepsilon

\addtolength\textwidth{2cm} % I have not used this

\newcommand{\ssub}[1]{_{\smash{\raisebox{-1pt}{$\scriptstyle#1$}}}}

\begin {document}

\emph{$c_0$ is a complete metric space.} Suppose $x$ is a limit
point of $c_0$. Then there exists
$(x_k)_{k \in \mathbb{N}} \in c_0$ and such that $x_k \to x$.
Let $\epsilon>0$ and pick $N$ such that
$\|x_k-x\|_\infty < \epsilon/2$ for $k \ge N$. Since
$x_N \in c_0$, there is some $N'$ such that
$|x_{N,i}| < \epsilon/2$ for $i \ge N'$. Then
$|x_i| \le |x_{N,i}| + |x_i-x_{N,i}| \le |x_{N,i}| +\|x-x_N \|_\infty <\epsilon$.
Hence $x_i \to 0$ and so $x \in c_0$.

\end{document}

• are you sure that paragraph has even spacing and no use of \lineskip :-) – David Carlisle Jan 1 at 18:23
• @DavidCarlisle It has “almost even” space. – egreg Jan 1 at 18:25
• actually I think for specific formulae this does really make better output than the global settings I suggest, but getting a complete solution requires a lot of manual adjustments. – David Carlisle Jan 1 at 18:28
• @DavidCarlisle I added a solution with different notation that avoids superscripts. – egreg Jan 1 at 18:35
• thanks.......... – David Carlisle Jan 1 at 18:48

\documentclass[a4paper]{article}
\usepackage{amsfonts,amsmath,parskip}
\newcommand\test{%
\textbf{$c_0$ is a complete metric space.} Suppose $x$ is a limit
point of $c_0$. Then there exists
$(x^{(k)} )_{k \in \mathbb{N}} \in c_0$ and such that $x^{(k)} \to x$. Let $\epsilon>0$ and pick  zzzz $N_y$ such that
$\|x^{(k)}-x\|_\infty < \frac{1}{2} \epsilon$ for $k \ge N_{0}$. Since
$x^{(N)} \in c_0$, there is some $N'$ such that
$|x_i^{(N^2)} | < \frac{1}{2} \epsilon$ for $i \ge N'$. Then
$|x_i| \le |x_i^{(N)} | +|x_i-x_i^{(N)} | \le |x_i^{(N)} | +\|x-x^{(N) } \|_\infty <\epsilon$. Hence $x_i \to 0$ and so $x \in c_0$.

}

\begin {document}

1 \test

{\lineskiplimit=-\maxdimen
2 \test
}

{\lineskiplimit=0pt  \lineskip=0pt
3 \test
}

{\baselineskip=15pt
4 \test
}

5 \textbf{$c_0$ is a complete metric space.} Suppose $x$ is a limit
point of $c_0$. Then there exists
$(x^{(k)} )_{k \in \mathbb{N}} \in c_0$ and such that $x^{(k)} \to x$. Let $\epsilon>0$ and pick  zzzz $N_y$ such that
$\|x^{(k)}-x\|_\infty < \frac{1}{2} \epsilon \quad\text{for k \ge N_{0}.}$
Since
$x^{(N)} \in c_0$, there is some $N'$ such that
$|x_i^{(N^2)} | < \frac{1}{2} \epsilon$ for $i \ge N'$. Then
$|x_i| \le |x_i^{(N)} | +|x_i-x_i^{(N)} | \le |x_i^{(N)} | +\|x-x^{(N) } \|_\infty <\epsilon\;.$
Hence $x_i \to 0$ and so $x \in c_0$.

\end{document}

1) is the original (example changed slightly to demonstrate overlapping)

2) uses -\maxdimen this prioritises even linespacing over everything including readability, it will make the lines overlap with no warning if that is needed.

3) uses asetting of \lineskiplimit of 0pt so it will allow lines to touch if it really has to but if the lines really do not fit in the space then it will increase the spacing rather than over-print.

4) (which is what I'd do if I really had to set this as inline) opens up the linespacing to the minimum that allows the desired inline math to fit.

5) (which is what I'd do if I had a choice) uses displayed math for the larger expressions.

If you don't mind wasting space, you can use

\documentclass[a4paper]{article}
\usepackage{amsfonts,amsmath,parskip}
\usepackage{ebgaramond} %font
\addtolength\textwidth{2cm} % I have not used this
\begin {document}
{\baselineskip=1.2\baselineskip
\textbf{$c_0$ is a complete metric space.} Suppose $x$ is a limit
point of $c_0$. Then there exists
$(x^{(k)} )_{k \in \mathbb{N}} \in c_0$ and such that $x^{(k)} \to x$. Let $\epsilon>0$ and pick $N$ such that
$\|x^{(k)}-x\|_\infty < \frac{1}{2} \epsilon$ for $k \ge N$. Since
$x^{(N)} \in c_0$, there is some $N'$ such that
$|x_i^{(N)} | < \frac{1}{2} \epsilon$ for $i \ge N'$. Then
$|x_i| \le |x_i^{(N)} | +|x_i-x_i^{(N)} | \le |x_i^{(N)} | +\|x-x^{(N) } \|_\infty <\epsilon$. Hence $x_i \to 0$ and so $x \in c_0$.
\par}

\end{document}

There may be a way to do this using \linespread, but so far I haven't figured it out.