# How to solve the problem with paragraph justification in LaTeX

I have met with a problem with the justification of a paragraph in LaTeX. See the image below.

The MWE LaTeX code is as below:

\documentclass[11pt,twoside]{article}%
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{geometry}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}[theorem]{Corollary}
\geometry{margin=1in,top=1.25in,bottom=1.25in}
\begin{document}
\begin{corollary}   \label{16}\ Suppose in a sequence of structures
$\{(\mathfrak{M}_{n},\phi_n)\colon \mathfrak{M}_{n} \models\phi_{n}\land n<\omega\}$ of a $\aleph_{0}$-categorical theory
$T$, there are finitely many homogeneous subsequences of structures
$\{(\mathfrak{M}_{n_i}, \phi_{n_i}) \colon \mathfrak{M}_{n_i} \models\phi_{n_i}\land n_i<\omega\}$. Then there is a unique formula
$\widetilde{\phi_i}$ in $\mathcal{L}$ (up to equivalence) and a unique
countable atomic structure $\widetilde{\mathfrak{M_i}}$ (up to
isomorphism) for each $\{(\mathfrak{M}_{n_i},\phi_{n_i})\}$ such that
$\widetilde{\mathfrak{M_i}}\models\widetilde{\phi_i}$. In addition,
there is a $N_i\in\omega$ such that
$\,\widetilde{\phi_i}\,=\underset{N_i<n_i<\omega} {\displaystyle\bigwedge}{\phi}_{n_i}$ which is the complete formula of
$\widetilde{\mathfrak{M_i}}$.
\end{corollary}
\end{document}


The problem happens inside {}. So the question is how to break the curly bracket to make alignment work. Thanks.

• PLease extend your code fragment to MWE, which we can test as it is. A cure fir right alignment is rewording your corollary. Maybe with some inline math (which seem to protrude right text border) change to display one. Mar 19 at 3:42
• The math expression that is having trouble breaking is quite long, and there isn't really a good place to break it. A skilled copyeditor would most likely pull the whole thing out and display it, unnumbered. You can do this by wrapping it in $...$, including the period at the end. Mar 19 at 3:45
• I changed to MWE latex code. Mar 19 at 5:42

Thanks for posting a compilable MWE, as it greatly simplifies the search for a solution of your formatting objective, which is how to fix a bad line-break situation that involves an inline math object.

• The first corollary in the following screenshot replicates the OP's screenshot.

• Before providing a solution for the OP's stated objective, it's worth fixing a few minor things about the paragraph in question. For instance, it's worth replacing

 $\,\widetilde{\phi_i}\,=\underset{N_i<n_i<\omega} {\displaystyle\bigwedge}{\phi}_{n_i}$


with

 $\widetilde{\phi}_i= \smashoperator{\bigwedge_{N_i<n_i<\omega}} \phi_{n_i}$


in order to avoid creating a large and unsightly visual gap around the "big wedge" symbol in the final line of the corollary. (The macro \smashoperator is provided by the mathtools package, which is a superset of the amsmath package.) Also, since \mathfrak operates only on uppercase letters, it's better to write \mathfrak{M}_i rather than \mathfrak{M_i}. See the second corollary below for the result of fixing these preliminary issues.

• As @barbarabeeton has already pointed out in a comment, there are two types of solutions to the formatting issue the OP has encountered. The first is to manually insert a directive -- specifically, the \allowbreak directive -- somewhere in the problematic inline math formula to indicate where a line break should occur. Here, it looks like a good idea to allow a line break after \colon. See the third corollary below.

• The second solution is to switch to a displayed formula; see the fourth corollary below. I think that this is by far the best solution for most such use cases.

\documentclass[11pt,twoside]{article}
\usepackage{amssymb}
\usepackage{mathtools} % 'mathtools' is a superset of 'amsmath'
%\usepackage{amsfonts} % 'amsfonts' is loaded automatically by 'amssymb'

\usepackage{geometry}
\geometry{hmargin=1in,vmargin=1.25in}
% '{margin=1in,top=1.25in,bottom=1.25in}' isn't unambiguous

\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}[theorem]{Corollary}

\begin{document}

\setcounter{section}{2}
\setcounter{theorem}{5} % just for this example

\begin{corollary}   \label{16}
\ Suppose in a sequence of structures
$\{(\mathfrak{M}_{n},\phi_n)\colon \mathfrak{M}_{n} \models\phi_{n}\land n<\omega\}$
of a $\aleph_{0}$-categorical theory $T$, there are
finitely many homogeneous subsequences of structures
$\{(\mathfrak{M}_{n_i}, \phi_{n_i}) \colon \mathfrak{M}_{n_i} \models\phi_{n_i}\land n_i<\omega\}$.
Then there is a unique formula
$\widetilde{\phi_i}$ in $\mathcal{L}$ (up to
equivalence) and a unique countable atomic structure
$\widetilde{\mathfrak{M_i}}$ (up to isomorphism) for each
$\{(\mathfrak{M}_{n_i},\phi_{n_i})\}$ such that
$\widetilde{\mathfrak{M_i}}\models\widetilde{\phi_i}$.
In addition, there is a $N_i\in\omega$ such that
$\,\widetilde{\phi_i}\,=\underset{N_i<n_i<\omega} {\displaystyle\bigwedge}{\phi}_{n_i}$
which is the complete formula of
$\widetilde{\mathfrak{M_i}}$.
\end{corollary}

\begin{corollary}   \label{16a}
Suppose that in a sequence of structures
$\{(\mathfrak{M}_{n},\phi_n)\colon \mathfrak{M}_{n} \models\phi_{n}\land n<\omega\}$
of an $\aleph_{0}$-categorical theory $T$, there are
finitely many homogeneous subsequences of structures
$\{(\mathfrak{M}_{n_i}, \phi_{n_i}) \colon \mathfrak{M}_{n_i} \models\phi_{n_i}\land n_i<\omega\}$.
Then there is a unique formula
$\widetilde{\phi}_i$ in $\mathcal{L}$ (up to
equivalence) and a unique countable atomic structure
$\widetilde{\mathfrak{M}}_i$ (up to isomorphism) for each
$\{(\mathfrak{M}_{n_i},\phi_{n_i})\}$ such that
$\widetilde{\mathfrak{M}}_i\models\widetilde{\phi}_i$.
In addition, there is an $N_i\in\omega$ such that
$\widetilde{\phi}_i= \smashoperator{\bigwedge_{N_i<n_i<\omega}} \phi_{n_i}$
which is the complete formula of
$\widetilde{\mathfrak{M}}_i$.
\end{corollary}

\begin{corollary}   \label{16b}
Suppose that in a sequence of structures
$\{(\mathfrak{M}_{n},\phi_n)\colon \mathfrak{M}_{n} \models\phi_{n}\land n<\omega\}$
of an $\aleph_{0}$-categorical theory $T$, there are
finitely many homogeneous subsequences of structures
$\{(\mathfrak{M}_{n_i}, \phi_{n_i}) \colon \allowbreak % <-- '\allowbreak' is new \mathfrak{M}_{n_i} \models\phi_{n_i}\land n_i<\omega\}$.
Then there is a unique formula
$\widetilde{\phi}_i$ in $\mathcal{L}$ (up to
equivalence) and a unique countable atomic structure
$\widetilde{\mathfrak{M}}_i$ (up to isomorphism) for each
$\{(\mathfrak{M}_{n_i},\phi_{n_i})\}$ such that
$\widetilde{\mathfrak{M}}_i\models\widetilde{\phi}_i$.
In addition, there is an $N_i\in\omega$ such that
$\widetilde{\phi}_i= \smashoperator{\bigwedge_{N_i<n_i<\omega}} \phi_{n_i}$
which is the complete formula of
$\widetilde{\mathfrak{M}}_i$.
\end{corollary}

\begin{corollary}   \label{16c}
Suppose that in a sequence of structures
$\{(\mathfrak{M}_{n},\phi_n)\colon \mathfrak{M}_{n} \models\phi_{n}\land n<\omega\}$
of an $\aleph_{0}$-categorical theory $T$, there are
finitely many homogeneous subsequences of structures
$\bigl\{(\mathfrak{M}_{n_i}, \phi_{n_i}) \colon \mathfrak{M}_{n_i} \models\phi_{n_i}\land n_i<\omega\bigr\} \,.$
Then there is a unique formula
$\widetilde{\phi}_i$ in $\mathcal{L}$ (up to
equivalence) and a unique countable atomic structure
$\widetilde{\mathfrak{M}}_i$ (up to isomorphism) for each
$\{(\mathfrak{M}_{n_i},\phi_{n_i})\}$ such that
$\widetilde{\mathfrak{M}}_i\models\widetilde{\phi}_i$.
In addition, there is an $N_i\in\omega$ such that
$\widetilde{\phi}_i= \smashoperator{\bigwedge_{N_i<n_i<\omega}} \phi_{n_i}$
which is the complete formula of
$\widetilde{\mathfrak{M}}_i$.
\end{corollary}

\end{document}

• @EugeneZhang - You're most welcome.
– Mico
Mar 19 at 16:34

I don't think you should use \colon in this case, which is for maps like in f\colon A\rightarrow B. In the set-builder notation, the colon is a relation symbol.

You should also use better names, such as \fM for \mathfrak{M} and \cL for \mathcal{L}, which makes for simpler input and avoids mistakes such as \mathfrak{M_i}, that should be \mathfrak{M}_i.

I also used upright parentheses (I don't really like their slantedness in Computer Modern).

Finally, I replaced the ugly realization of \models with \vDash.

\documentclass[11pt,twoside]{article}%
\usepackage{geometry}
\usepackage{amssymb}
\usepackage{amsmath}

\geometry{margin=1in,top=1.25in,bottom=1.25in}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}[theorem]{Corollary}

\newcommand{\fM}{\mathfrak{M}}
\newcommand{\cL}{\mathcal{L}}
\newcommand{\wt}{\widetilde}

\renewcommand{\models}{\vDash}

\begin{document}

\begin{corollary}\label{16}
Suppose in a sequence of structures
$\{(\fM_{n},\phi_n): \fM_{n} \models \phi_{n}\land n<\omega\}$
of a  $\aleph_{0}$-categorical theory $T$, there are
finitely many homogeneous subsequences of structures
$\{(\fM_{n_i}, \phi_{n_i}) : \fM_{n_i} \models\phi_{n_i}\land n_i<\omega\}$.
Then there is a unique formula $\wt{\phi_i}$ in $\cL$
\textup{(}up to equivalence\textup{)} and a unique countable atomic structure
$\wt{\fM_i}$ \textup{(}up to isomorphism\textup{)} for each
$\{(\fM_{n_i},\phi_{n_i})\}$ such that
$\wt{\fM_i}\models\wt{\phi_i}$.
In addition, there is a $N_i\in\omega$ such that
$\wt{\phi_i}\,= \bigwedge_{N_i<n_i<\omega}\phi_{n_i}$
which is the complete formula of $\wt{\fM_i}$.
\end{corollary}

\end{document}


The \underset in the last big formula is wrong. You might use

\bigwedge\limits_{N_i<n_i<\omega}\phi_{n_i}


for the particular case where the construct is in the last line of the corollary, but inline it's much better to set the limits on the side.

If you really want to use \colon spacing, define your own symbol that allows a line break

\documentclass[11pt,twoside]{article}%
\usepackage{geometry}
\usepackage{amssymb}
\usepackage{amsmath}

\geometry{margin=1in,top=1.25in,bottom=1.25in}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}[theorem]{Corollary}

\newcommand{\fM}{\mathfrak{M}}
\newcommand{\cL}{\mathcal{L}}
\newcommand{\wt}{\widetilde}

\renewcommand{\models}{\vDash}

\newcommand{\suchthat}{\colon\allowbreak}

\begin{document}

\begin{corollary}\label{16}
Suppose in a sequence of structures
$\{(\fM_{n},\phi_n)\suchthat \fM_{n} \models \phi_{n}\land n<\omega\}$
of a  $\aleph_{0}$-categorical theory $T$, there are
finitely many homogeneous subsequences of structures
$\{(\fM_{n_i}, \phi_{n_i}) \suchthat \fM_{n_i} \models\phi_{n_i}\land n_i<\omega\}$.
Then there is a unique formula $\wt{\phi_i}$ in $\cL$
\textup{(}up to equivalence\textup{)} and a unique countable atomic structure
$\wt{\fM_i}$ \textup{(}up to isomorphism\textup{)} for each
$\{(\fM_{n_i},\phi_{n_i})\}$ such that
$\wt{\fM_i}\models\wt{\phi_i}$.
In addition, there is a $N_i\in\omega$ such that
$\wt{\phi_i}\,= \bigwedge_{N_i<n_i<\omega}\phi_{n_i}$
which is the complete formula of $\wt{\fM_i}$.
\end{corollary}

\end{document}