2

I'm trying to have a tabular section that has bullet points next to it. There might be a better way to go about this, but currently it seems as though the cells are out of sync (though this might be expected from the code I'm not too sure).

Here's the MWE :

\documentclass{article}

\begin{document}


\begin{tabular}{p{5cm} p{8cm}}

\large{1. Keyboard apple} &

\begin{itemize}
\item Trying on plates
\item Never fly pent
\item Bluo sceit tier
\end{itemize} \\

\large{2. Car in table paper} &
\begin{itemize}
\item Never always maybe
\item Circuit paper china cup
\end{itemize} \\

\end{tabular}
\end{document}

Here's an image of the output :

enter image description here

So I'm unsure about the best way to sort this, I'm certainly not hung up on the approach that I've taken, I just don't know any others.

Thanks

  • 1
    Nesting your itemize environments in enumerate items ? – percusse Jun 8 '15 at 23:05
  • 1
    unrelated to the alignment but \large{1. Keyboard apple} should be \large 1. Keyboard apple (size commands do not take an argument) – David Carlisle Jun 8 '15 at 23:45
  • 1
    ah sorry didn't notice it was same OP:-) – David Carlisle Jun 8 '15 at 23:47
  • 1
    @baxx it is less explicit:-) \large{something}else looks like something is an argument of \large (which it isn't) and else will not be large (which it will be). – David Carlisle Jun 9 '15 at 11:44
  • 1
    {\large something} else or usually better {\large something\par} else work fine. – David Carlisle Jun 9 '15 at 11:50
2

How about defining a new I column type?

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{array}
\newcolumntype{I}[1]{>{\leavevmode\vspace*{\dimexpr-\topsep-\baselineskip\relax}\itemize}p{#1} <{\enditemize}}

\begin{document}

\begin{tabular}{p{5cm}I{8cm} }
  \large{1. Keyboard apple} &
  \item Trying on plates
  \item Never fly pent
  \item Bluo sceit tier \\
  \large{2. Car in table paper} &
  \item Never always maybe
  \item Circuit paper china cup \\
\end{tabular}

\end{document} 

enter image description here

|improve this answer|||||
  • 1
    Probably your .tex file is not utf8 encoded. Which editor do you use? – Bernard Jun 8 '15 at 23:44
  • 1
    Can you check what is its default encoding? And do you have the same problem just copying and compiling my code? – Bernard Jun 8 '15 at 23:47
  • 1
    @baxx Your file is not ascii (or you would not have got that error message) not heard of spacemacs but in emacs C-x RET f prompts for the encoding to save the current file, – David Carlisle Jun 8 '15 at 23:50
  • 1
    Not at all, just remove the line that loads inputenc. But really, you should ask him to encode in utf8: all modern editors and systems understand utf8, and you'll have problems with accented letters from other people. What if you meet with Gauß's lemma or Poincaré's lemma? – Bernard Jun 8 '15 at 23:52
  • 1
    @baxx yes I recognise file output, but file only looks at the start of the file and makes a guess. ASCII files are UTF-8 encoded (UTF8 is a full superset of ASCII) so if the file was really ascii specifying UTF-8 would be fine. – David Carlisle Jun 8 '15 at 23:54
1

This is a well known problem for itemized list in tabular environments; I'd avoid them to begin with, but, if you can't, here's a workaround:

\documentclass{article}
\usepackage{array}

\makeatletter
\newcolumntype{P}[1]{>{\@minipagetrue}p{#1}}
\makeatother

\begin{document}

\begin{tabular}{p{5cm} P{8cm}}
\large 1. Keyboard apple &
  \begin{itemize}
  \item Trying on plates
  \item Never fly pent
  \item Bluo sceit tier
  \end{itemize}
\\
\large 2. Car in table paper &
  \begin{itemize}
  \item Never always maybe
  \item Circuit paper china cup
  \end{itemize}
\\
\end{tabular}
\end{document}

Note that \large doesn't take an argument: it's a declaration that means “typeset in a larger font from now on”; here its scope is just the table cell in which it appears (it obeys groups).

enter image description here

|improve this answer|||||
  • Thanks for that. I've been trying to adapt this to another problem (unsuccessfully) though it worked fine for this. The line \newcolumntype{P}[1]{>{\@minipagetrue}p{#1}} sets up a new column type 'P', this contains one argument {P}[1] i think? I'm not too sure what occurs after, a minipage is involved, does it convert the right hand side to a mini page? Thanks – baxx Jun 9 '15 at 11:41

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.