我尝试在表格中设置 itemize,但出现“缺少 \endcsname”的情况。
我的 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}
输出为:
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
有什么提示吗?
答案1
tabular
这里使用标准似乎更容易
\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}