# Displaying Equations in Specific Tabularx Environment

I want to get rid of that huge blank space between the displayed equation and "converges to q". I am using a tabularx environment and hence I have to insert an enter (\\) after the displayed equation in order to make the table work properly. How can I get rid of that space?

Since I am working on a huge project and I cannot change the whole thing, I would appreciate if there is a solution that does not change the overall structure (tabularx, \hspace{3em}).

Here's my code.

\documentclass{article}

\usepackage[english]{babel}
\usepackage[a4paper,top=2cm,bottom=2cm,left=3cm,right=3cm,marginparwidth=1.75cm]
{geometry}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{enumitem}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{indentfirst}
\usepackage{tabularx}
\usepackage{bm}
\usepackage{nicematrix}
\usepackage[T1]{fontenc}

\begin{document}

\begin{tabularx}{0.9\linewidth}{l@{}c@{}X}
\hypertarget{5.5.1}{\textbf{5.5.1}} & $\quad$ & If $P$ is the transition matrix for a
regular Markov chain, then :
\end{tabularx}

\renewcommand{\arraystretch}{1.5}
\begin{tabularx}{0.9\linewidth}{l@{}c@{}X}
& \hspace{3em} & (a) There is a unique probability vector $\mathbf{q}$ with positive
entries such that \\
& \hspace{3em} & \hspace{1.25em} $P \mathbf{p} = \mathbf{q}$. \\
& \hspace{3em} & (b) For any initial probability vector $\mathbf{x}_{0}$, the sequence
of state vectors
$$\mathbf{x}_{0}, \quad P \mathbf{x}_{0}, \quad \cdots, \quad P^{k} \mathbf{x}_{0}, \quad \cdots$$ \\
& \hspace{3em} & \hspace{1.25em} converges to $\mathbf{q}$. \\
& \hspace{3em} & (c) The sequence $P, P^{2}, \cdots, P^{k}, \cdots$ converges to the
matrix $Q$ each of whose \\
& \hspace{3em} & \hspace{1.25em} column vectors is $\mathbf{q}$. \\
\end{tabularx}

\end{document}

• Commented Feb 26, 2023 at 15:24
• Off-topic: Do use $...$, not $$...$$, to create an unnumbered display math group. For more on the is subject, please see Why is $...$ preferable to $$...$$?
– Mico
Commented Feb 26, 2023 at 15:53
• Get rid of the \\  after . Display structures have space built in below the equation, so you're just adding to it. However, see the answer for better advice. Commented Mar 28, 2023 at 18:14

I think you're badly abusing the tabularx machinery, and you're engaging in a lot of hard-to-decipher (and, I hate to have to say it, fairly amateurish-looking) visual formatting.

I suggest you switch to a customized enumerate environment, along the following lines. A side benefit is that the excess virtual space issue you've encountered vanishes on its own.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[a4paper, vmargin=2cm, hmargin=3cm,
marginparwidth=1.75cm]{geometry}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{enumitem}
\newcommand\xzero{\mathbf{x}_{0}}

\begin{document}

\noindent
\begin{minipage}[t]{0.9\textwidth}
If $P$ is the transition matrix for a regular Markov chain, then:
\begin{enumerate}[label=(\alph*),left=0pt,align=left,itemsep=0pt]
\item There is a unique probability vector $\mathbf{q}$ with positive entries such that $P \mathbf{p} = \mathbf{q}$.
\item For any initial probability vector $\xzero$, the sequence of state vectors
$\xzero, P \xzero, \dots, P^{k} \xzero$
converges to $\mathbf{q}$.
\item The sequence $P, P^{2}, \dots, P^{k}, \dots$ converges to the  matrix $Q$, each of whose column vectors is~$\mathbf{q}$.
\end{enumerate}
\end{minipage}

\end{document}

• Thanks for your advice, but I can't change those at this point since I have about 200 similar tables and I cannot change all of them one by one. Yes this is my first project using LaTeX and I am an amateur. I will try using the enumerate environment for my next project.
– Vue
Commented Feb 26, 2023 at 16:09
• @Vue - Well, maybe you can use this coding idea for your next LaTeX document.
– Mico
Commented Feb 26, 2023 at 16:10