0

Simpler way to get paragraph column in multipage align-like environment?

Simpler way to get paragraph column in multipage align-like environment? I am seeking an align-like environment that can contain paragraph-like text columns and can also can overflow onto the next page.

This page showed me how align environments can straddle pages with \usepackage{amsmath}\allowdisplaybreaks[4]. Unlike the tabular environment, however, I can't designate specific columns to behave like paragraphs, with line wrapping.

This page showed me how wrap text within cells using\parbox[t]{2in}{Some text.}. As shown in the MWE below, however, it introduces a lot of extra noise in the code.

Is there a more streamline way to accomplish both objectives?

I initially used longtable, but ran into a bug where the text after the table overflowed past the bottom margin, as shown here. I applied the patch here, but the problem persisted.

I then tried the tabular environment, without an enclosing table environment, but it won't span multiple pages.


MWE

\documentclass[letterpaper]{article}
\usepackage[letterpaper]{geometry}
\usepackage{amsmath}\allowdisplaybreaks[4]
\begin{document}

\vspace*{2in}

Pretend that there is lots of text here.

\vspace*{3in}

I present the equation:

\[ a b c = x y z \]

where

\begin{align*}
   a & = \parbox[t]{2in}{\raggedright The quick brown fox jumped
   over the lazy dogs.}
\\[0.05in]
   b & = \parbox[t]{2in}{\raggedright The quick brown fox jumped
   over the lazy dogs.}
\\[0.05in]
   c & = \parbox[t]{2in}{\raggedright The quick brown fox jumped
   over the lazy dogs.}
\\[0.05in]
   x & = \parbox[t]{2in}{\raggedright The quick brown fox jumped
   over the lazy dogs.}
\\[0.05in]
   y & = \parbox[t]{2in}{\raggedright The quick brown fox jumped
   over the lazy dogs.}
\\[0.05in]
   z & = \parbox[t]{2in}{\raggedright The quick brown fox jumped
   over the lazy dogs.}
\end{align*}
\end{document}

Failed attempts at simplifying \parbox command

I tried to simplify the use of the \parbox command by defining a \TLpar command that takes care of all the details. I wanted the \TLpar command to look up the length \ParWidth whenever \TLpar is invoked. However it only uses the value of \ParWidth at the time that \TLpar is defined:

\documentclass[letterpaper]{article}
\usepackage[letterpaper]{geometry}
\usepackage{amsmath}\allowdisplaybreaks[4]

% Command to put text into top-left-aligned paragraph box
\newlength{\ParWidth}
\setlength{\ParWidth}{4.5in}
\newcommand{\TLpar}[1]{\parbox[t]{\ParWidth}{\raggedright #1}}
\begin{document}

\vspace*{2in}

Pretend that there is lots of text here.

\vspace*{3in}

I present the equation:

\[ a b c = x y z \]

where

\begin{align*}
   \setlength{\ParWidth}{2in} % Doesn't work
   a & = \TLpar{The quick brown fox jumped over the lazy dogs.}
\\[0.05in]
   b & = \parbox[t]{2in}{\raggedright The quick brown fox jumped
   over the lazy dogs.}
\\[0.05in]
   c & = \parbox[t]{2in}{\raggedright The quick brown fox jumped
   over the lazy dogs.}
\\[0.05in]
   x & = \parbox[t]{2in}{\raggedright The quick brown fox jumped
   over the lazy dogs.}
\\[0.05in]
   y & = \parbox[t]{2in}{\raggedright The quick brown fox jumped
   over the lazy dogs.}
\\[0.05in]
   z & = \parbox[t]{2in}{\raggedright The quick brown fox jumped
   over the lazy dogs.}
\end{align*}
\end{document}

If I define the \TLpar command to accept a second argument to specify paragraph width, that works, but I need to provide the argument at every single invocation of the \TLpar command. That's not very streamlined, as the paragraph width doesn't change throughout any single occurrence of the align environment.

2
  • you just need to set the length before the alignment, an alignment cell is a local group so you lose the set value at the & Jan 11, 2022 at 8:08
  • @David Carlisle: That works! Thanks! Would you like to post that as the answer? Jan 11, 2022 at 8:16

1 Answer 1

1

An align cell (like a tabular cell) is a local group, so your \setlength setting is discarded at the first & before you actually use it.

Move the \setlength to before the \begin{align} so that it is in scope for the whole alignment.

1
  • Thank you, David Carlisle! Jan 11, 2022 at 8:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .