Michael Schmitt wrote:

> the following problem is really hard to identify and so I would like to 
> draw your attention to it another time.
> 
> - This one is really annoying: LaTeX accepts
>     {\sffamily \begin{tabular}{|p{3.3cm}|}\hline foo \par foo \\
>                                           \hline \end{tabular}}
>   but cannot handle
>     \textsf{\begin{tabular}{|p{3.3cm}|}\hline foo \par foo \\
>                                        \hline \end{tabular}}


[...]


 
>   Herbert, do you know whether both notations are 100% equivalent
>   (except for the bug)??? I really think that this problem should
>   be fixed; it was already the second time that I spent endless time
>   on finding out what's going on) (my former comments on this issue
>   resulted in bug #172)


they are not 100% equivalent! They have only the same
result, if they are used in the right way.
\textsf{...} puts it's argument in a group. In a table every
row, too. When one tablerow ends, TeX does not really
know that it's still inside the first group of textsf.
So you'll get the error

---------------
Runaway argument?
{\begin {tabular}{|p{3.3cm}|} \hline foo
! Paragraph ended before \text@command was complete.
---------------

\sffamily doesn't define a group and is much more easier in
it's definition than \textsf{}

\DeclareRobustCommand\sffamily
         {\not@math@alphabet\sffamily\mathsf
          \fontfamily\sfdefault\selectfont}

therefore you need the {...} to put the \sffamily command
inside, otherwide it's a global definition for all following
text.

Hope this helps

Herbert

-- 
http://www.lyx.org/help/

Reply via email to