4

I'm a bit stuck at the moment. I want a table like the following (quickly drawn in Word, and I don't want the vertical lines as displayed - I'm using booktabs). The reason I'm making such a table is to summarise the findings of the literature review, and I'm splitting the studies by category (e.g. colour or music). Also, I'd like the column widths of the 'citation' column to be ever slightly bigger than the 'sample' and 'environment' columns, but smaller than the 'conclusion' column, which should be the biggest Please note that the white text and black background is not the colour scheme I want. I'm not sure about the colour options in Latex, but a background colour that would work well with black text would be fine - perhaps a light gray?

enter image description here

I began writing something in latex (so it is not a MWE) but I simply got stuck. I've included the packages of xcolor, because my googling revealed this how to fill in rows & columns, and I'm certain that my final table will span more than one page. Also would it be better if lines (of the same thickness) were between the "Colour" and "Music" 'sub-headings' ? Probably not.

\documentclass{article}
\usepackage{booktabs, xcolor, longtable}
\begin{document}
\begin{longtable}
\toprule
Citation & Sample & Environment & Conclusion
...
...
\end{longtable}
\end{document}
3
  • 1
    This does not sound like a good use for a table. Could you not simply have a subsection for each category, and then have a structured heading and a paragraph for the conclusion?
    – Thruston
    Apr 4, 2014 at 20:50
  • Unless it is just for your use but then presentation would not be much of a concern. But I basically agree this seems a poor way to present this kind of content. Maybe you could explain what it is about a table that you see as being useful here? Somebody might then be able to suggest an effective alternative.
    – cfr
    Apr 4, 2014 at 21:10
  • @Thruston - I'm open to new ideas but I can't quite seem to visualise your suggestion. Is it possible you could create a MWE? I have many studies in my literature review - I did not talk about some of them, and I thought it would be nice to have a 'summary table' of all the results, so the reader could more easily digest all the information. Apr 5, 2014 at 6:46

2 Answers 2

1

Displaying things like this may not be the good idea, but how to do it with LaTeX has answers.

\documentclass{article}
\usepackage{booktabs, longtable,array}
\usepackage[table]{xcolor}
\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}
\usepackage[a4paper,margin=1in]{geometry}
\begin{document}
\begin{longtable}{P{\dimexpr0.26\textwidth-2\tabcolsep-2\arrayrulewidth\relax}
                        P{\dimexpr0.18\textwidth-2\tabcolsep-\arrayrulewidth\relax}
                        P{\dimexpr0.19\textwidth-2\tabcolsep-\arrayrulewidth\relax}
                        P{\dimexpr0.37\textwidth-2\tabcolsep-\arrayrulewidth\relax}}
\toprule
Citation & Sample & Environment & Conclusion\\\midrule
\rowcolor{gray!20}\multicolumn{4}{c}{Colour}\\
Some name and some year in parenthesis & 300 adults & Furniture store & This is some long text that doen't really conclude in a single line\\\midrule
\rowcolor{gray!20}\multicolumn{4}{c}{Music}\\
Some name and some year in parenthesis & 300 adults & Furniture store & This is some long text that doen't really conclude in a single line\\
\bottomrule
\end{longtable}
\end{document}

enter image description here

7
  • Thanks @Harish Kumar. Before selecting it as the preferred answer, I'm just wondering if you can replicate what Thruston is saying? Both you and the other two people seem to think a table is not the greatest idea. I'm open to new suggestions. Apr 5, 2014 at 7:23
  • @Chris I see that Thruston has already done it :)
    – user11232
    Apr 5, 2014 at 12:46
  • Thanks, I've seen Thruston's answer, now I'm just trying to compile your example. Unfortunately, Latex is giving me some strange results: !undefine control sequence <recently read> \rowcolor 1.12 \rowcolor {gray!20}\multicolumn{4}{c}{Colour}\\ ! Misplaced omit \multispan -->\omit. and so on. Here is a picture. i58.tinypic.com/2cn7061.png Apr 5, 2014 at 15:02
  • @Chris Did you run my code exactly as such?
    – user11232
    Apr 5, 2014 at 15:04
  • Oops, saw you had added [table] to xcolor. I had already loaded xcolor on my document so didn't look there. Sorry for my stupidity! Apr 5, 2014 at 15:17
0

An answer not as a table, as requested. You might want to use a enumerate or some other type of list, as the bullets probably look a bit bossy. I'd probably suppress the numbers on the subheadings too, but do whatever fits into your overall document design. I would also use \cite commands rather than writing out the references by hand if I were doing this for real.

\documentclass{article}
\begin{document}
\subsection{Summary of references}

[Explain the standard layout of each summarized reference.]

\subsubsection{References about colour}

\begin{itemize}
    \item Bellizzi, et. al. (1983) -- 125 adults -- furniture store

    Warm and cool colours created different emotional responses.  
    Customers view red detail environments as more negative and less pleasant
    than blue.

\item Smith and Jones (1977) -- 103 dogs -- pet shop

    A service-oriented paradigm is further compounded when taking into account the
    evolution of specifications over a given time period.  

\end{itemize}

\subsubsection{References about music}

\begin{itemize}

    \item Some name (1902) -- 300 adults -- Furniture store

    This is some long text that doesn't really conclude in a single line, and so we
    set it as a paragraph below.

\item And so on

\end{itemize}

\end{document}

General principle. You have several short things and one long thing for each item that you want to tabulate: if you set them in a table structure you inevitably waste a lot of space on the page. Setting them as structured paragraphs is (in my opinion) a bit easier on the reader.

<sarcasm> On the other hand if you want to bulk out your report, then a table with lots of blank space is a great way to go. Management consultants make a good living out of doing this. </sarcasm>

You must log in to answer this question.

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