1

I'm doing a very long sidewaystable with tabularx. The thing is that I have a lot of text in columns: Table 1.

I did it using minipage and enumerate. The thing is that I was wondering if there's any way I could get the last column on the top of it (same start point as third column). Heres my code:

\documentclass[11pt,a4paper,twoside]{report}
\usepackage[spanish]{babel}
\addto\shorthandsspanish{\spanishdeactivate{~<>}}
\usepackage[utf8x]{inputenc}
\usepackage{microtype}
\usepackage[T1]{fontenc}
\usepackage{booktabs}
\usepackage[figuresright]{rotating} 
\usepackage{tabularx}
\usepackage{multirow}
\usepackage[sort&compress]{natbib}
\usepackage{amsmath}
.
.
\begin{document}
some text here..
.
.
\begin{sidewaystable}
\small
\centering
\begin{tabularx}{\textwidth}{ p{2.5cm} p{3.5cm} X X }
    \toprule
    \multicolumn{1}{l}{\textbf{Índice}} & \multicolumn{1}{c}{\textbf{Fórmula}} & \multicolumn{1}{c}{\textbf{Ventaja}}    & \multicolumn{1}{c}{\textbf{Contras}} \\
    \midrule
    \multirow{-10}[2]{1in}{\normalsize{\textbf{NDVI} \\[3mm] {\small Normalized Difference Vegetation Index \\[3mm] \citep{Rouse1973}}}}
        & \multirow{-10}[8]{1.5in}{
        \begin{equation*} 
            \frac{NIR_t-RED_t}{NIR_t+RED_t}
        \end{equation*}}
        & 
        \begin{minipage}{3.3in}
        \begin{enumerate}[{-}]
          \item ....
          \item bla bla...
        \end{enumerate}
        \end{minipage}
        &
        \begin{minipage}{3.3in}
        \begin{enumerate}[{-}]
          \item ....
          \item bla bla 2...
        \end{enumerate}
        \end{minipage}
        \\
\bottomrule
\end{tabularx}
\end{sidewaystable}

To be honest, I'm really new at LaTeX. So I'd really appreciate some help! Thanks in advance.

  • It might help if you fixed typos in your code (e.g., \bagin instead of \begin) and made the code compilable (by loading all required packages, among them multirow, natbib, and amsmath). – Mico Oct 30 '15 at 6:30
1

With help of two new packages: makecell for column headers and multi row cells and paralist for compact lists. Package mathtools (the same result can be obtained by use of amsmath package) serve only for \text{...} command in one column header. Probably it will somewhere else in report. With this I made the following table:

enter image description here

with code:

\documentclass[11pt,a4paper,twoside]{report}
%\usepackage[spanish]{babel}
%\addto\shorthandsspanish{\spanishdeactivate{~<>}}
    \usepackage[utf8]{inputenc}
    \usepackage{mathtools}
%    \usepackage{microtype}
    \usepackage[T1]{fontenc}
    \usepackage{booktabs,makecell,multirow,tabularx}
\renewcommand\theadfont{\bfseries\sffamily}
\usepackage[figuresright]{rotating}%

\usepackage{paralist}%enumitem
\usepackage{lipsum}

\begin{document}
\lipsum[1-3]

\begin{sidewaystable}
    \small
    \centering
\begin{tabularx}{\textwidth}{p{1.5in} 
                             >{$}p{1.2in}<{$} 
                             X X }
\toprule
\thead{Índice} 
    &   \thead{\text{Fórmula}}
        &   \thead{Ventaja}    
            &   \thead{Contras}     \\
\midrule
\multirowcell{1}[-17em][l]{
    \large\textbf{NDVI}     \\[2ex] 
    Normalized Difference   \\
    Vegetation Index        \\[2ex]
    \cite{{Rouse1973}}
                            }   
    &   \multirowcell{1}[-19em][c]{\dfrac{NIR_t-RED_t}{NIR_t+RED_t}}   
        &  \begin{compactitem}[$-$] 
        \item \lipsum[2]
        \item \lipsum[2]
        \item  ...
            \end{compactitem}
        &      \begin{compactitem}[$-$]   
            \item \lipsum[2]
            \item  ...
            \item  ...
                \end{compactitem}   \\
\bottomrule
\end{tabularx}
\end{sidewaystable}
    \end{document}

Package lipsum serves for dummy text only. I comment microtype package I haven't installed scalable fonts. Also I comment babel and to it related package for the same reason. This changes shouldn't destroy obtained result. Beside this, I slightly simplified provided MWE.

Note: Instead of paralist can be used newer enumitem package, however it differently determine distance between items and between itemize environment surroundings (top and bottom of cell).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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