LaTeX forum ⇒ Graphics, Figures & TablesLongtable hide column

Information and discussion about graphics, figures & tables in LaTeX documents.
fhrttn
Posts: 18
Joined: Thu Nov 16, 2017 2:43 pm

Longtable hide column

Postby fhrttn » Tue Dec 31, 2019 10:40 am

With the longtable package how can hide a column, I used H and it gave me error. Also I want to ask about longtable caption, It appears in all pages that the table exist on. How can I change it e.g "Table 1 Continued" in the pages after the first page. Thanks in advance


Here is the sample
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \begin{scriptsize}
  2. \begin{longtable}[c]{llrrHrrrrrcc}
  3. \caption{C-caption}\label{tab:a}\\
  4. % header and footer information
  5.  
  6. \hline
  7. N& Q $& Ex & T & D\&K & R & H& S& B& DM1& DM2\\
  8. \hline
  9. \endhead
  10. \hline
  11. \endfoot

User avatar
Ijon Tichy
Posts: 277
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Tue Dec 31, 2019 12:52 pm

These are two questions (and it is almost ever better to ask two questions if you have two questions instead of mixing two questions into one).

The answer to the second one is: Read \endfirsthead in the longtable manual.

Question to the first question: Can you show us a Infominimal working example example, that also give us information about the definition of the (usually unknown) column type H?

rais
Posts: 268
Joined: Sun Nov 16, 2014 8:51 pm

Postby rais » Tue Dec 31, 2019 7:05 pm

I guess that's just it---an H column is not specified.
If I had to create one, I'd do s.th. like
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \documentclass{article}
  2. \usepackage{array}
  3. \newsavebox\dummy
  4. \newcolumntype{H}{>{\begin{lrbox}{\dummy}}c<{\end{lrbox}}@{}}
  5. \begin{document}
  6. \raggedright
  7. \begin{tabular}{rl}
  8. one & two\\
  9. three & four\\
  10. \end{tabular}
  11.  
  12. \begin{tabular}{rHl}
  13. one & something & two\\
  14. three & not visible & four\\
  15. \end{tabular}
  16. \end{document}

then again, I wouldn't put a column into my table I don't intend to use...

A Happy New Year

Rainer

fhrttn
Posts: 18
Joined: Thu Nov 16, 2017 2:43 pm

Postby fhrttn » Wed Jan 01, 2020 11:27 am

Hiding column with H is worked. I will read the manual of longtable for the second question.

rais
Posts: 268
Joined: Sun Nov 16, 2014 8:51 pm

Postby rais » Wed Jan 01, 2020 12:39 pm

Come to think of it,
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \newcolumntype{H}{>{\iffalse}c<{\fi}@{}}

would be even easier.

KR
Rainer


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 6 guests