[latexrefman-discuss] Each line must be terminated with the control sequence @code{\\}.

Vincent Belaïche vincent.belaiche at domain.hid
Sun Aug 23 13:25:28 CEST 2015


One more thing on this matter...


Le 23/08/2015 11:08, Vincent Belaïche a écrit :
>
>
> Le 22/08/2015 23:44, Karl Berry a écrit :

[...]

>>
>> I certainly agree with the analysis, but I'd like to fix it
>> differently.  Please give me a day or so and I'll try to commit
>> something.  Thakns.
>>
>> k
>
> If you go into commonalizing some aspects of \raggedleft, \raggedright
> and \centering into a single node, as I suggested in my previous mail on
> the other thread about \end, then it would be good also to mention that
> these command redefine \\ in a way that you cannot do simply
>
> \begin{tabular}{>{\raggedleft}p{0.5\linewidth}}
> some line\\
> \end {tabular}
>
> You need to use \arraybackslash:
>
> \begin{tabular}{>{\raggedleft\arraybackslash}p{0.5\linewidth}}
> some line\\
> \end {tabular}
>
>
> Or \tabularnewline instead of \\ --- as far as I can remember, I never do that but
> use \arraybackslash rather:
>
> \begin{tabular}{>{\raggedleft}p{0.5\linewidth}}
> some line\tabularnewline
> \end {tabular}
>
>   V.
>
>

Well, it would probably be better to say that '\\' is a shorthand for
'\newline' or '\tabularnewline', whichever applicable. When one wants to
control horizontal alignment in parboxed tabular cells, then one has to
make a choice about the meaning of '\\', does it refers to
'\tabularnewline' or to '\newline'. This concerns any parboxed cell (p,
m, b) with with the '>{...}' construct of array package or direct use of
\raggedright, \raggedleft, \centering within the cell.

Personnally I always prefer that '\\' remains '\tabularnewline', because
forcing a newline within the cell is scarcely done, while adding rows to
the table is often, so I postfix \raggedright, \raggedleft, \centering
by \arraybackslash.

  V.

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
http://www.avast.com





More information about the latexrefman mailing list