4

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

enter image description here

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}
  • 1
    Please, extend your code snippets to one complete small document, which we can test as it is ... – Zarko Jan 01 '20 at 17:22
  • \begingroup\lineskiplimit=-\maxdimen <your contents>\endgroup – Ruixi Zhang Jan 01 '20 at 17:32
  • 1
    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 01 '20 at 17:39
  • @RuixiZhang perhaps, but this question is a followup from https://tex.stackexchange.com/questions/522530/writing-lineskiplimit-maxdimen-produces-blank-space-instead-of-equation-when?noredirect=1#comment1321578_522530 which shows the dangers of that setting – David Carlisle Jan 01 '20 at 17:40
  • @DavidCarlisle Indeed there are dangers ahead. But the OP claims that there are only inline maths. So… – Ruixi Zhang Jan 01 '20 at 17:46
  • 2
    @RuixiZhang never believe the OP:-) – David Carlisle Jan 01 '20 at 17:46
  • 1
    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 01 '20 at 17:50
  • also I assume x^(k) was intended to be x^{(k)} – David Carlisle Jan 01 '20 at 17:52
  • Thank you! I'm new to this site and thus not familiar to what to write etc. You are right about $x^{(k) } . I have included the fonts I'm using which may make a difference for the line break... – MrFranzén Jan 01 '20 at 17:56

3 Answers3

3

enter image description here

\documentclass[a4paper]{article}
\usepackage{amsfonts,amsmath,parskip}
\addtolength\textwidth{2cm}
\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.

David Carlisle
  • 757,742
3

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.

enter image description here

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

enter image description here

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}

enter image description here

egreg
  • 1,121,712
1

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}

demo

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

John Kormylo
  • 79,712
  • 3
  • 50
  • 120