In this code, the text in the middle column just overlaps with itself and doesn't…
- User
In this code, the text in the middle column just overlaps with itself and doesn't continue to the next line. What's going on?
\begin{tabbing} \hspace{3cm} \= \hspace{10cm} \= \kill Figure 2.1 \> This is a very very very very very very very long description of the figure. \> 21 \\ \end{tabbing} Assistant
The issue is that the
tabbingenvironment in LaTeX doesn't automatically wrap text within columns. When text exceeds the width between tab stops, it simply overflows and overlaps with content in the next column rather than wrapping to a new line.In your code, you've set up tab stops at 3cm and 13cm (3cm + 10cm), but the long description text exceeds the 10cm space allocated for the middle column, causing it to overlap with the page number "21" in the third column.
Here are a few solutions:
Option 1: Use
tabularxfor automatic text wrapping\usepackage{tabularx} ... \begin{tabularx}{\textwidth}{l X r} Figure 2.1 & This is a very very very very very very very long description of the figure. & 21 \\ \end{tabularx}Option 2: Use
tabularwith fixed-width paragraph columns\begin{tabular}{l p{10cm} r} Figure 2.1 & This is a very very very very very very very long description of the figure. & 21 \\ \end{tabular}Option 3: Use a description list or custom formatting
\noindent Figure 2.1 \hfill 21\\ \hspace{1em} This is a very very very very very very very long description of the figure.The
tabularortabularxapproaches are generally better for this type of layout since they handle text wrapping automatically within defined column widths.- User
I would like the word "Page" above the column for page numbers?
Assistant
Here's how to add "Page" as a header above the page numbers column:
Option 1: Using
tabularx(recommended)\usepackage{tabularx} ... \begin{tabularx}{\textwidth}{l X r} & & Page \\ \hline Figure 2.1 & This is a very very very very very very very long description of the figure. & 21 \\ Figure 2.2 & Another description & 25 \\ \end{tabularx}Option 2: Using
tabularwith fixed-width columns\begin{tabular}{l p{10cm} r} & & Page \\ \hline Figure 2.1 & This is a very very very very very very very long description of the figure. & 21 \\ Figure 2.2 & Another description & 25 \\ \end{tabular}Option 3: If you really need to use
tabbing\begin{tabbing} \hspace{3cm} \= \hspace{10cm} \= \kill \> \> Page \\ \hline Figure 2.1 \> This is a very very very very very very very long description \> 21 \\ \> of the figure. \> \\ Figure 2.2 \> Another description \> 25 \\ \end{tabbing}Note that with
tabbing, you'll need to manually break long descriptions across lines as shown above, which is whytabularxortabularare better choices for this layout. Thetabularxoption is particularly good because it automatically adjusts the middle column width to fill the available space.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.