1

I tried to set up itemize within a tabulary, but get a "Missing \endcsname".

My MWE:

   \documentclass{scrbook} 
   \usepackage{array,ragged2e}
   \usepackage{multirow} 
   \usepackage{tabulary}
   
   \begin{document}
   \chapter{Theoretical Background}
   \begin{table}[h]
        \centering
         \begin{tabulary}{1.0\textwidth}{|L|L|}
           \hline
            Decision level & Type  \\
            \hline 
            \multirow{12}{*}
               \begin{itemize}
                   \item strategic
                   \item tactical
               \end{itemize} &
               \begin{itemize}
                   \item stochastic
                   \item deterministic
               \end{itemize}   \\
           \hline  
       \end{tabulary}
   \end{table} \\
   \end{document}

Output is:

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./00_main_document english.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-03-06>
(/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/scrbook.cls
Document Class: scrbook 2020/01/24 v3.29 KOMA-Script document class (book)
(/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/scrkbase.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/scrbase.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/scrlfile.sty)))
(/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/tocbasic.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/scrsize11pt.clo)
(/usr/local/texlive/2020/texmf-dist/tex/latex/koma-script/typearea.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/tools/array.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/ragged2e/ragged2e.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/ms/everysel.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/multirow/multirow.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/tabulary/tabulary.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def)
(./00_main_document english.aux) ABD: EverySelectfont initializing macros
chapter 1.
./00_main_document english.tex:26: Missing \endcsname inserted.
<to be read again> 
                   \protect 
l.26    \end{tabulary}
                    
? 
Process aborted

Any hints?

7
  • 3
    also don't put \\ after \end{table} it generates an error and can not do anything useful. Jan 21, 2021 at 22:00
  • 2
    What's the purpose of \multirow{12}{*}?
    – Mico
    Jan 21, 2021 at 22:03
  • 1
    @Mico I thought something like this was necessary to have the itemize block fit in the cell of the table. Saw it in a lot of examples, but didn't really understand it.
    – Ariser
    Jan 21, 2021 at 22:04
  • 2
    I have no idea if multirow works in tabulary (certainly it was never tested) a 12 row span in a 1 row table seems brave. For lists you can make them work with some effort see tex.stackexchange.com/a/204926/1090 but really it would be simpler to use a normal tabular here and two columns Jan 21, 2021 at 22:04
  • 2
    @Ariser you are saying that the first cell should span over 12 rows of the table, but there are not 12 rows in this table. Jan 21, 2021 at 22:05

1 Answer 1

2

It seems easier to use a standard tabular here

enter image description here

\documentclass{scrbook} 
   \usepackage{array,ragged2e}
 
   
   \begin{document}
   \chapter{Theoretical Background}
   \begin{table}[htbp] % not just h
        % \centering % doesn't really do anything as the table is full width
         % \begin{tabulary}{1.0\textwidth}{|L|L|}
   \begin{tabular}{|*{2}{p{0.5\dimexpr\textwidth-3\arrayrulewidth-4\tabcolsep}|}}
         % simpler to use tabular
           \hline
            Decision level & Type  \\
            \hline 
           %%% \multirow{12}{*} there are not 12 rows to spane
               \begin{itemize}
                   \item strategic
                   \item tactical
               \end{itemize} &
               \begin{itemize}
                   \item stochastic
                   \item deterministic
               \end{itemize} \\
           \hline  
       \end{tabular}
   \end{table} % \\ % never use \\ here 
   \end{document}
5
  • That looks good. I'm going to test it on my real table.
    – Ariser
    Jan 21, 2021 at 22:16
  • This solution works, however, I guess I have to do a lot to make it look nice.
    – Ariser
    Jan 21, 2021 at 22:26
  • 1
    @Ariser tabulary produces exactly the same layout as the tabular solution shown here except that it chooses the width of each p{..} column via a rough heuristic that tries to give columns with more text a wider space. But if you set the p{..} widths by hand then you get more control. Jan 21, 2021 at 22:29
  • 1
    @Ariser, you still can stick with tabulary is you encapsulate itemize in a minipage: \begin{minipage}{\hsize}\smallskip \begin{itemize} \item strategic \item tactical \end{itemize}. However, you will get nicer result with use of the enumitem package.
    – Zarko
    Jan 21, 2021 at 22:34
  • @DavidCarlisle, you are right. I wil delete y comments soon.
    – Zarko
    Jan 21, 2021 at 22:38

You must log in to answer this question.

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