2

When using the changes package in a table, I am experiencing spurious extra lines in the marked-up output for the columns defined as p-type (see example).

These extra lines disappear in the final version of the document. How can I get rid of these? (please note that in my actual table I do have the need to define the column width, and therefore use the p-type).

Example:

\documentclass{standalone}

\usepackage{color}
\usepackage[authormarkup=none]{changes}

\usepackage{booktabs}
\aboverulesep=0ex
\belowrulesep=0ex
\renewcommand{\arraystretch}{1.2}

\usepackage{array}
\newcolumntype{?}{!{\vrule width 1pt}}

\newcolumntype{a}{p{2.0cm}}

\begin{document}
\begin{tabular}{|a|l|a|l|}
\cmidrule[1.0pt]{1-4}
Text& Text& Text& Text\\
\added{New text}& \added{New text}& \added{New text}& \added{New text}\\
\cmidrule[1.0pt]{1-4}
\end{tabular}
\end{document}

Output:

enter image description here

CarLaTeX
  • 62,716
dontpanic
  • 809

1 Answers1

2

Just add \leavevmode to your new column type.

For more info about it, see Function and usage of \leavevmode.

\documentclass{standalone}

\usepackage{color}
\usepackage[authormarkup=none]{changes}

\usepackage{booktabs}
\aboverulesep=0ex
\belowrulesep=0ex
\renewcommand{\arraystretch}{1.2}

\usepackage{array}
\newcolumntype{?}{!{\vrule width 1pt}}

\newcolumntype{a}{>{\leavevmode}p{2.0cm}}% <-- \leavevmode added here

\begin{document}
    \begin{tabular}{|a|l|a|l|}
        \cmidrule[1.0pt]{1-4}
        Text& Text& Text& Text\\
        \added{New text}& \added{New text}& \added{New text}& \added{New text}\\
        \cmidrule[1.0pt]{1-4}
    \end{tabular}
\end{document}

enter image description here

CarLaTeX
  • 62,716