Files
silby 0f71b9e8c4 Skip at most one argument to LaTeX tabular newline (#10707)
In LaTeX's tabular environment, the tabular newline takes an optional
argument that we skip. But it only takes a single optional argument, and
any further square-bracketed text that follows shouldn't be skipped.

Fixes #7512, and also adds a test for the original problem raised in
that issue which was already fixed at some point.
2025-03-19 16:33:19 -07:00

1.5 KiB

% pandoc -t native -f latex
\begin{equation*}
[d,\delta]=0.
\end{equation*}
^D
[ Para [ Math DisplayMath "[d,\\delta]=0." ] ]
% pandoc -t native -f latex
\begin{table}[htb]
  \begin{tabular}{|c|c|}
       $W$      & rel. err. \\[0mm]
       [$\mu$m] & [\%]\\
  \end{tabular}
\end{table}
^D
[ Table
    ( "" , [] , [] )
    (Caption Nothing [])
    [ ( AlignCenter , ColWidthDefault )
    , ( AlignCenter , ColWidthDefault )
    ]
    (TableHead ( "" , [] , [] ) [])
    [ TableBody
        ( "" , [] , [] )
        (RowHeadColumns 0)
        []
        [ Row
            ( "" , [] , [] )
            [ Cell
                ( "" , [] , [] )
                AlignDefault
                (RowSpan 1)
                (ColSpan 1)
                [ Plain [ Math InlineMath "W" ] ]
            , Cell
                ( "" , [] , [] )
                AlignDefault
                (RowSpan 1)
                (ColSpan 1)
                [ Plain [ Str "rel." , Space , Str "err." ] ]
            ]
        , Row
            ( "" , [] , [] )
            [ Cell
                ( "" , [] , [] )
                AlignDefault
                (RowSpan 1)
                (ColSpan 1)
                [ Plain [ Str "[" , Math InlineMath "\\mu" , Str "m]" ]
                ]
            , Cell
                ( "" , [] , [] )
                AlignDefault
                (RowSpan 1)
                (ColSpan 1)
                [ Plain [ Str "[%]" ] ]
            ]
        ]
    ]
    (TableFoot ( "" , [] , [] ) [])
]