1

enter image description here

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[colorlinks=true, allcolors=teal]{hyperref} \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}

Vue
  • 155

1 Answers1

1

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.

enter image description here

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

\begin{document}

\noindent \hypertarget{5.5.1}{\textbf{5.5.1}} \quad \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}

Mico
  • 506,678
  • 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 Feb 26 '23 at 16:09
  • @Vue - Well, maybe you can use this coding idea for your next LaTeX document. – Mico Feb 26 '23 at 16:10