Skip to content
The Chat Archive
o4-mini-2025-04-16· OpenAI LMArena Human Preference 140K

In this code, the text in the middle column just overlaps with itself and doesn't…

  1. 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}
    
  2. Assistant

    When you use the tabbing environment, you’re essentially telling TeX “think of this like a typewriter with custom tab‐stops,” not a table whose cells automatically wrap their contents. Any text you put between two tabs will be set on one line and will simply overrun (and overlap) whatever comes next, because tabbing does not do automatic line breaking in its “columns.”


    Why it overlaps

    1. The \= in the preamble (\hspace{3cm} \= \hspace{10cm} \= \kill) only sets two tab stops (at 3 cm and 13 cm from the left margin).
    2. When you write
      Figure 2.1   \>  This is a very very … long description  \> 21 \\
      
      the middle chunk doesn’t know it has a “10 cm wide cell.” It just starts at 3 cm and prints, unbroken, all the way across your page (and even on top of the “21”).

    Solutions

    1) Switch to a proper table with fixed‐width columns

    If you want automatic word‐wrapping, use a tabular (or tabularx) with a p{…} (or X) column:

    \documentclass{article}
    \usepackage{tabularx} % for X-columns
    \begin{document}
    
    \begin{tabular}{l p{10cm} r}  % l = left, p{10cm} = paragraph column 10 cm wide, r = right
      Figure 2.1 & This is a very very very very very very very long description of the figure. & 21 \\
    \end{tabular}
    
    % or with 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}
    
    \end{document}
    

    Here TeX will automatically break (wrap) the text in the middle column.

    2) If you really want to stick with tabbing, wrap the text yourself

    You can force a “mini–cell” by using a \parbox (or a minipage) of fixed width:

    \begin{tabbing}
      \hspace{3cm}\= \hspace{10cm}\= \kill
      Figure 2.1 \> 
        \parbox[t]{10cm}{This is a very very very very very very very long description of the figure.} 
      \> 21 \\
    \end{tabbing}
    

    Now the \parbox will handle the line‐breaking for you inside that 10 cm box.


    TL;DR

    • Tabbing sets tab stops but does not wrap text.
    • For automatic wrapping use a tabular environment with p{…} or tabularx with X columns.
    • If you must use tabbing, wrap your long text in a fixed‐width box (\parbox/minipage).
  3. User

    I would like the word "Page" above the column for page numbers?

  4. Assistant

    Here are two quick ways to put a “Page” heading above your page–number column.

    1. Using tabbing
    2. Using a proper table (tabular/tabularx)

    1) With the tabbing environment

    \begin{tabbing}
      \hspace{3cm}\= \hspace{10cm}\= \kill
      %–– header row ––%
      \> \> \textbf{Page} \\[6pt]  % add a bit of vertical space if you like
      %–– data row ––%
      Figure~2.1 \> This is a very very very very very very very long description 
                     of the figure. \> 21 \\
    \end{tabbing}
    

    Notes:

    • The first “>>” skips to your third tab‐stop and prints Page.
    • You still need to wrap your long description yourself (e.g. via \parbox) if it overruns.

    2) With a tabular (or tabularx) environment

    \documentclass{article}
    \usepackage{tabularx}   % for X–columns
    \usepackage[margin=2.5cm]{geometry}
    \begin{document}
    
    \begin{tabularx}{\textwidth}{l X r}
      \textbf{Figure} & \textbf{Description} & \textbf{Page} \\  
      \hline
      2.1 & This is a very very very very very very very long description of the figure. & 21 \\
    \end{tabularx}
    
    \end{document}
    

    Why this is nicer:

    • The X column auto-wraps your long text.
    • You get a real “column header” row.
    • You don’t need any \hspace or \parbox tricks.

    Pick whichever suits your workflow!

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.