Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This is obliquely related to this query, except that I would like to have a tabularx environment where the entire first column is in italics (or some other standard formatting). The following obviously does not work:

\documentclass{article}
\usepackage{array, tabularx}
\begin{document}
\begin{table}[htbp]
\begin{tabularx}{\linewidth}{>{\em}X{}<XX}
a & a & a \\
b & b & b
\end{tabularx} 
\end{table}
\end{document}

I do actually need tabularx since I expect the last column to contain quite long sentences.

share|improve this question
1  
answer already given but your code would have worked apart from {}< which should be omitted or should be <{} (Using \itshape is most likely more semantically correct than using \em but it would have worked) –  David Carlisle Oct 15 '12 at 16:28
    
Thanks David. I thought that this feature was not allowed with tabularx, not noticing that I was making a typo. –  fg nu Oct 16 '12 at 1:00

1 Answer 1

up vote 8 down vote accepted

Using {>{\itshape\arraybackslash}XXX} works:

\documentclass{article}
\usepackage{array, tabularx}
\begin{document}
\begin{table}[htbp]
\begin{tabularx}{\linewidth}{>{\itshape\arraybackslash}XXX}
a & a & a \\
b & b & b
\end{tabularx}
\end{table}
\end{document}

enter image description here

share|improve this answer
    
Great, thanks for your quick response. –  fg nu Oct 15 '12 at 16:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.