10

I have a long table with the explanation of 50 items (the MWE displays only 9). I believe this is hard to read. How do I make it easy to read?

\documentclass[10pt,cleardoublepage=empty,twoside]{book}
\usepackage[a5paper]{geometry}
\usepackage{longtable}
\usepackage[T1]{fontenc} 
\usepackage{booktabs}

\begin{document}
\begin{longtable}{p{4.8cm} p{4.8cm}}
\caption{Lorem ipsum dolor sit amet, orci vivamus ac neque augue cras, pellentesque libero integer.}\\
\textsc{Lorem ipsum dolor sit amet}&\textsc{Lorem ipsum}\\
\midrule
\endfirsthead
\caption[]{(continued)}\\
\endhead
\endlastfoot

aenean ipsum enim egestas dui amet, ut condimentum ipsum vel arcu ullamcorper, nec et quis dolor mi, nunc id laoreet velit elit sit orci. Pede vestibulum ac amet
&\textit{enean}\slash \textit{egestas}\\

pede vestibulum ac amet
&\textit{egestas}\slash \textit{condimentum}\\

aenean ipsum enim egestas dui amet, ut condimentum ipsum vel arcu ullamcorper, ante voluptatem, suspendisse sed euismod leo
&\textit{hasellus}\slash \textit{egestas}\\

pede vestibulum ac amet.
&\textit{egestas}\slash \textit{condimentum}\\

aenean ipsum enim egestas dui amet, ut condimentum ipsum vel arcu ullamcorper
&\textit{laoreet}\slash \textit{velit}\\

aenean ipsum enim egestas dui amet, ut condimentum ipsum vel arcu ullamcorper, ante voluptatem, suspendisse
&\textit{enean}\slash \textit{egestas}\\

mauris lectus vel nulla neque lectus vel nulla eget cras luctus enim pharetra, curabitur sed curabitur sed vitae, lectus vel nulla neque
&\textit{egestas}\slash \textit{condimentum}\\

mauris eget cras luctus enim pharetra, curabitur sed vitae, lectus vel nulla neque
&\textit{cras}\slash \textit{enim}\\

sapien in sed. Sit lectus sed nullam, condimentum elit quae, morbi lacus nullam dictum libero convallis 
&\textit{convallis}\slash \textit{Sit}\\
\end{longtable}
\end{document}

Output (extract):

Table

I also have this other table. Do you think it could look better than this?

\documentclass[10pt,cleardoublepage=empty,twoside]{book}
\usepackage[a5paper]{geometry}
\usepackage[english]{babel}
\usepackage{longtable}
\usepackage{multirow}
\usepackage[T1]{fontenc} 
\usepackage{booktabs}

\begin{document}

\begin{longtable}{l l}
\caption{Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh}\\
\textsc{Lorem Ipsum}&\textsc{Ament}\\
\midrule
\endfirsthead
\caption[]{(continued)}\\
\textsc{Semantic Category}&\textsc{Variable}\\
\midrule
\endhead
\endlastfoot
\multirow{3}{*}{consectetur eiusmod tempor}&\textit{dolor}/\textit{sit}\\ &\textit{ament}/\textit{sit}\\ &\textit{laboris}/\textit{explicabo}\\
\\
\multirow{3}{*}{consectetur adipisicing elit, sed do eiusmod}&\textit{exercitationem}/\textit{voluptatem}\\ &\textit{incidunt}/\textit{laboris}\\
&\textit{aliquid}/\textit{explicabo}\\
\\
\multirow{2}{*}{consectetur adipisicing elit, sed do}& \textit{holiday}/\textit{exercitationem}\\
&\textit{sundown}/\textit{laboris}\\
\\
\multirow{2}{*}{consectetur adipisicing, sed do eiusmod}&\textit{laboris}/\textit{incidunt}\\
&\textit{exercitationem}/\textit{voluptatem}\\
\\
consectetur adipisicing elit, sed&\textit{aliquid}/\textit{incidunt}\\
\\
consectetur elit, sed do eiusmod&\textit{explicabo}/\textit{laboris}\\
\end{longtable}

\end{document}
3
  • 2
    Are all those packages necessary to run this code? If not, you should delete the ones that are not needed.
    – Vivi
    Commented Dec 19, 2012 at 8:16
  • @Vivi: this is a MWE extracted from my whole dissertation. I am not so good at deciding which packages are necessary for my MWE. I did delete many from my standard preamble already.
    – Cost
    Commented Dec 19, 2012 at 11:27
  • 1
    MWE stands for "minimal working example" (emphasis on minimal). So it is not a MWE until you have removed all unnecessary packages. Have a look at this good explanation. While it may appear I am being pedantic, there are many reasons why this should be done. If you are not sure which packages are important, coment out the lines that include a package one by one and try to compile the code. If it gives an error, uncomment that line and keep going. If anything, you will learn from that!
    – Vivi
    Commented Dec 19, 2012 at 18:10

2 Answers 2

18

First suggestion: increase space between rows, so that the paragraphs are not so crampled. This can be achieved by simply inserting in the preamble:

\usepackage{array}
\renewcommand{\arraystretch}{1.5}

This is the result:

With arraystretch

Second suggestion Is it possible to swap columns? In this case, I would insert an \hfill in the shorter one in order to have it right-aligned with the longer one. I.e:

\begin{longtable}{>{\hfill}p{4.8cm}p{4.8cm}}  % <----- here 
\caption{Lorem ipsum dolor sit amet, orci vivamus ac neque augue cras, pellentesque libero integer.}\\
\textsc{Lorem ipsum} & \textsc{Lorem ipsum dolor sit amet}\\
\midrule
\endfirsthead
\caption[]{(continued)}\\
\endhead
\endlastfoot

\textit{enean}\slash \textit{egestas}
& aenean ipsum enim egestas dui amet, ut condimentum ipsum vel arcu ullamcorper, nec et quis dolor mi, nunc id laoreet velit elit sit orci. Pede vestibulum ac amet
\\
\textit{egestas}\slash \textit{condimentum}
& pede vestibulum ac amet
\\
[etc.]
\end{longtable}

Resulting in:

Swapped columns

Finally, this table looks like a list of descriptions. If so, perhaps a description environment would be the best option.

3
  • +1 sorry I just saw your final comment after I'd produced the answer below using description. Commented Dec 19, 2012 at 9:24
  • How can I set the \renewcommand{\arraystretch}{1.5} only for this table and not for the rest of the text?
    – Cost
    Commented Dec 19, 2012 at 11:27
  • 1
    @Costi enclose all in braces: {\renewcommand{\arraystretch}{1.5}\begin{longtable} ... \end{longtable}}
    – JLDiaz
    Commented Dec 19, 2012 at 11:37
14

On the general principle of avoiding all my packages, this looks more like a list than a table to me, something like:

enter image description here

\documentclass[10pt,cleardoublepage=empty,twoside]{book}
\usepackage[a5paper]{geometry}

\usepackage[italian]{babel}

\usepackage[T1]{fontenc} 
\renewcommand*\descriptionlabel[1]{\hbox to \textwidth{\hspace\labelsep
 \normalfont\bfseries\itshape #1}}

\begin{document}

\section*{Lorem ipsum dolor sit amet, orci vivamus ac neque augue cras, pellentesque libero integer}
\subsection*{Lorem ipsum dolor sit amet}

\begin{description}
\item[enean\slash egestas]
aenean ipsum enim egestas dui amet, ut condimentum ipsum vel arcu ullamcorper, nec et quis dolor mi, nunc id laoreet velit elit sit orci. Pede vestibulum ac amet


\item[egestas\slash condimentum]
pede vestibulum ac amet

\item[hasellus\slash egestas]
aenean ipsum enim egestas dui amet, ut condimentum ipsum vel arcu ullamcorper, ante voluptatem, suspendisse sed euismod leo

\item[egestas\slash condimentum]
pede vestibulum ac amet.

\item[laoreet\slash velit]
aenean ipsum enim egestas dui amet, ut condimentum ipsum vel arcu ullamcorper

\item[enean\slash egestas]
aenean ipsum enim egestas dui amet, ut condimentum ipsum vel arcu ullamcorper, ante voluptatem, suspendisse

\item[egestas\slash condimentum]
mauris lectus vel nulla neque lectus vel nulla eget cras luctus enim pharetra, curabitur sed curabitur sed vitae, lectus vel nulla neque

\item[cras\slash enim]
mauris eget cras luctus enim pharetra, curabitur sed vitae, lectus vel nulla neque

\item[convallis\slash Sit]
sapien in sed. Sit lectus sed nullam, condimentum elit quae, morbi lacus nullam dictum libero convallis 
\end{description}
\end{document}
8
  • The description list looks great. The only problem is that I must not use the bold face. How can I get rid of that? Also, is there a way to add a caption to a description list?
    – Cost
    Commented Dec 19, 2012 at 11:33
  • I have solved my own question about the bold face this way: \renewcommand*\descriptionlabel[1]{\hbox to \textwidth{\hspace\labelsep \normalfont #1}} The question about the caption is still open.
    – Cost
    Commented Dec 19, 2012 at 12:08
  • Also, last item alignement is crazy. It forces justification rather than aligning to the left.
    – Cost
    Commented Dec 19, 2012 at 12:14
  • 1
    how do you define "Caption" I used subsection heading in the example, but do you mean you want it to appear in the list of tables? Commented Dec 19, 2012 at 12:15
  • You are right: I did not notice your caption here. It is ok if the list does not go in the list of tables.
    – Cost
    Commented Dec 19, 2012 at 12:17

You must log in to answer this question.

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