3

I'm using longtable and I was wondering if there was a possibility to set font format for 1 specific column. For example, I would like to have the forth column in italic.

\begin{longtable}[1]{llllrr}

\caption{XXXX} \\ 
  \hline
\textbf{Order} & \textbf{Family} & \textbf{Genus} & \textbf{Specie} & \textbf{Average abundance} & \textbf{Average length (cm)} \\ 
  \hline
Acipenseriformes & Acipenseridae & Acipenser & Brevirostrum & 3.67 & 59.90 \\ 
   &  &  & Oxyrinchus & 2.50 & 27.81 \\ 
   & Polyodontidae & Polyodon & Spathula & 1.50 & 14.25 \\ 
  Anguilliformes & Anguillidae & Anguilla & Rostrata & 1.38 & 43.64 \\ 
   & Congridae & Conger & Oceanicus & 1.00 & 20.10 \\ 
  Atheriniformes & Atherinopsidae & Membras & Martinica & 12.33 & 6.69 \\ 
   &  & Menidia & Menidia & 2.50 & 6.72 \\ 
  Aulopiformes & Synodontidae & Synodus & Foetens & 1.90 & 15.92 \\ 
  Batrachoidiformes & Batrachoididae & Opsanus & Beta & 2.58 & 15.30 \\ 
   &  &  & Pardus & 1.50 & 16.52 \\ 
   &  &  & Tau & 4.05 & 19.29 \\ 
   &  & Porichthys & Plectrodon & 1.20 & 28.51 \\ 
  Beloniformes & Belonidae & Strongylura & Marina & 6.00 & 20.15 \\ 
  Carcharhiniformes & Carcharhinidae & Carcharhinus & Isodon & 1.00 & 38.00 \\ 
   &  &  & Limbatus & 1.00 & 39.20 \\ 
   &  &  & Porosus & 1.00 & 50.50 \\ 
   & Sphyrnidae & Sphyrna & Tiburo & 1.00 & 37.47 \\ 
   & Triakidae & Mustelus & Canis & 4.67 & 53.95 \\ 
  Clupeiformes & Clupeidae & Alosa & Aestivalis & 3.62 & 7.95 \\ 
   &  &  & Pseudoharengus & 6.38 & 7.35 \\ 
   &  &  & Sapidissima & 7.33 & 10.43 \\ 
   &  & Brevoortia & Gunteri & 35.17 & 7.99 \\ 
   &  &  & Patronus & 20.81 & 8.79 \\ 
   &  &  & Smithi & 1.00 & 12.20 \\ 
   &  &  & Tyrannus & 5.69 & 13.19 \\ 
   &  & Clupea & Harengus & 21.11 & 10.08 \\ 
   &  & Dorosoma & Cepedianum & 14.26 & 16.91 \\ 
   &  &  & Petenense & 11.85 & 10.37 \\ 
   &  & Etrumeus & Teres & 1.00 & 20.00 \\ 
   &  & Harengula & Jaguana & 2.47 & 9.70 \\ 
   &  & Opisthonema & Oglinum & 2.22 & 8.46 \\ 
   &  & Sardinella & Aurita & 3.00 & 13.07 \\ 
   & Engraulidae & Anchoa & Hepsetus & 8.66 & 6.81 \\ 
\hline
\hline
\end{longtable}

One more thing, how to avoid the header title (here specices) to have italic?

1
  • Note that the optional argument [1] to longtable doesn't make sense; you probably want [l] (with ‘ell’, not ‘one’) to get a longtable flush with the left margin.
    – egreg
    Jul 9, 2013 at 22:41

1 Answer 1

3

Just add in your preamble \usepackage{array} and modify your \begin{longtable} line as I indicate in the following code. Notice that the format specifier of your column must be inserted before the alignment of the same column via the symbol > and the format commands between {}

For your second question the solution is to add a \textnormal command to your "Specie" header title.

\begin{longtable}{l>{\bfseries}ll>{\itshape}lrr} 
  \hline
\textbf{Order} & \textbf{Family} & \textbf{Genus} & \textnormal{\textbf{Specie}} & \textbf{Average abundance} & \textbf{Average length (cm)} \\ 
  \hline
Acipenseriformes & Acipenseridae & Acipenser & Brevirostrum & 3.67 & 59.90 \\ 
   &  &  & Oxyrinchus & 2.50 & 27.81 \\ 
   & Polyodontidae & Polyodon & Spathula & 1.50 & 14.25 \\ 
  Anguilliformes & Anguillidae & Anguilla & Rostrata & 1.38 & 43.64 \\ 
   & Congridae & Conger & Oceanicus & 1.00 & 20.10 \\ 
  Atheriniformes & Atherinopsidae & Membras & Martinica & 12.33 & 6.69 \\ 
   &  & Menidia & Menidia & 2.50 & 6.72 \\ 
  Aulopiformes & Synodontidae & Synodus & Foetens & 1.90 & 15.92 \\ 
  Batrachoidiformes & Batrachoididae & Opsanus & Beta & 2.58 & 15.30 \\ 
   &  &  & Pardus & 1.50 & 16.52 \\ 
   &  &  & Tau & 4.05 & 19.29 \\ 
   &  & Porichthys & Plectrodon & 1.20 & 28.51 \\ 
  Beloniformes & Belonidae & Strongylura & Marina & 6.00 & 20.15 \\ 
  Carcharhiniformes & Carcharhinidae & Carcharhinus & Isodon & 1.00 & 38.00 \\ 
   &  &  & Limbatus & 1.00 & 39.20 \\ 
   &  &  & Porosus & 1.00 & 50.50 \\ 
   & Sphyrnidae & Sphyrna & Tiburo & 1.00 & 37.47 \\ 
   & Triakidae & Mustelus & Canis & 4.67 & 53.95 \\ 
  Clupeiformes & Clupeidae & Alosa & Aestivalis & 3.62 & 7.95 \\ 
   &  &  & Pseudoharengus & 6.38 & 7.35 \\ 
   &  &  & Sapidissima & 7.33 & 10.43 \\ 
   &  & Brevoortia & Gunteri & 35.17 & 7.99 \\ 
   &  &  & Patronus & 20.81 & 8.79 \\ 
   &  &  & Smithi & 1.00 & 12.20 \\ 
   &  &  & Tyrannus & 5.69 & 13.19 \\ 
   &  & Clupea & Harengus & 21.11 & 10.08 \\ 
   &  & Dorosoma & Cepedianum & 14.26 & 16.91 \\ 
   &  &  & Petenense & 11.85 & 10.37 \\ 
   &  & Etrumeus & Teres & 1.00 & 20.00 \\ 
   &  & Harengula & Jaguana & 2.47 & 9.70 \\ 
   &  & Opisthonema & Oglinum & 2.22 & 8.46 \\ 
   &  & Sardinella & Aurita & 3.00 & 13.07 \\ 
   & Engraulidae & Anchoa & Hepsetus & 8.66 & 6.81 \\ 
\hline
\hline
\end{longtable}

enter image description here

3
  • Thank you sir for your help. It works fine. Have a nice day, Phil
    – user33438
    Jul 10, 2013 at 10:59
  • @user33438 now there is also the answer to your new question. In future remind that is better to open a new question instead of adding the question to an already existing one.
    – Red
    Jul 11, 2013 at 9:35
  • Here is a question that may be useful to people trying to use styles other than italic: tex.stackexchange.com/questions/7669 Jul 17, 2022 at 20:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .