我想建立这个表:
由于我要逐项列出的列表很长,因此我想使用 easylist。显然 easylist-group 会在 tabularx 环境中造成问题。以下是我目前编写的代码:
\documentclass{book}
\usepackage{tabularx}
\usepackage[framemethod=tikz]{mdframed}
\usepackage[ampersand]{easylist}
\mdfdefinestyle{round}{ % rund
innertopmargin=0pt,innerbottommargin=10pt,innerleftmargin=1pt,innerrightmargin=1pt,
middlelinewidth=3pt,innerlinewidth=0.4pt,outerlinewidth=0.4pt,
linecolor=black,middlelinecolor=white,roundcorner=20pt}
\begin{document}
\begin{mdframed}[style=round]
\begin{tabularx}{\linewidth}{XX}
\multicolumn{1}{c}{
\begin{tabularx}{0.45\linewidth}{|X|}
AAAA
\begin{easylist}[itemize]
& A1
& A2
& A3
\end{easylist}
\end{tabularx}}
&
\multicolumn{1}{c}{
\begin{tabularx}{0.45\linewidth}{|X|}
BBBB
\begin{easylist}[itemize]
& B1
& B2
& B3
\end{easylist}
\end{tabularx}}
\end{tabularx}
\end{mdframed}
\end{document}
有谁知道解决方法吗?
答案1
这是一个简单的工作tcolorbox
并且不需要表格(我添加了一些颜色只是为了炫耀):
\documentclass{book}
\usepackage{tcolorbox}
\usepackage[ampersand]{easylist}
\tcbset{
colback=red!5!white,
colframe=red!75!black,
}
\begin{document}
\begin{tcolorbox}[sidebyside]
AAAA
\begin{easylist}[itemize]
& A1
& A2
& A3
\end{easylist}\tcblower
BBBB
\begin{easylist}[itemize]
& B1
& B2
& B3
\end{easylist}
\end{tcolorbox}
\end{document}
没有颜色,有双框,并且中线不接触边界:
\documentclass{book}
\usepackage[many]{tcolorbox}
\usepackage[ampersand]{easylist}
\tcbset{
colback=white,
arc=10pt,
colframe=black,
freelance,
frame code={
\draw[double,rounded corners=10pt]
(frame.south west) --
(frame.north west) --
(frame.north east) --
(frame.south east) -- cycle;
},
segmentation code={
\draw
([yshift=5pt]segmentation.south) -- ([yshift=-5pt]segmentation.north);
},
}
\begin{document}
\begin{tcolorbox}[sidebyside]
AAAA
\begin{easylist}[itemize]
& A1
& A2
& A3
\end{easylist}\tcblower
BBBB
\begin{easylist}[itemize]
& B1
& B2
& B3
\end{easylist}
\end{tcolorbox}
\end{document}
在一条评论中提出了一个新要求:在左半部分添加一个大加号,在右半部分添加一个大减号;这可以轻松完成interior code
(使用适当的移位,您可以将符号放在所需的位置):
\documentclass{book}
\usepackage[many]{tcolorbox}
\usepackage[ampersand]{easylist}
\usetikzlibrary{calc}
\tcbset{
colback=white,
arc=10pt,
colframe=black,
freelance,
frame code={
\draw[double,rounded corners=10pt]
(frame.south west) --
(frame.north west) --
(frame.north east) --
(frame.south east) -- cycle;
},
segmentation code={
\draw
([yshift=5pt]segmentation.south) -- ([yshift=-5pt]segmentation.north);
},
interior code={
\pgfsetfillopacity{0.5}
\pgftransparencygroup
\coordinate (auxleft1) at ( $ (frame.north)!0.5!(frame.south) $ );
\coordinate (auxleft2) at ([xshift=10pt] $ (frame.north west)!0.5!(segmentation.north) $ );
\draw[line width=6pt,gray]
([xshift=-25pt]auxleft2|-auxleft1) --
([xshift=25pt]auxleft2|-auxleft1);
\draw[line width=6pt,gray]
([yshift=-25pt]auxleft2|-auxleft1) --
([yshift=25pt]auxleft2|-auxleft1);
\endpgftransparencygroup
\coordinate (auxright1) at ( $ (frame.north east)!0.5!(frame.south east) $ );
\coordinate (auxright2) at ([xshift=10pt] $ (frame.north east)!0.5!(segmentation.north) $ );
\draw[line width=6pt,opacity=0.5,gray]
([xshift=-25pt]auxright2|-auxright1) --
([xshift=25pt]auxright2|-auxright1);
}
}
\begin{document}
\begin{tcolorbox}[sidebyside]
AAAA
\begin{easylist}[itemize]
& A1
& A2
& A3
\end{easylist}\tcblower
BBBB
\begin{easylist}[itemize]
& B1
& B2
& B3
\end{easylist}
\end{tcolorbox}
\end{document}
答案2
你可以使用一个minipage
环境:
笔记:
下列
mdframed
参数已被调整:innertopmargin=\baselineskip, innerleftmargin=10pt,
代码:
\documentclass{book}
\usepackage[framemethod=tikz]{mdframed}
\usepackage[ampersand]{easylist}
\mdfdefinestyle{round}{% rund
innertopmargin=\baselineskip,innerbottommargin=10pt,innerleftmargin=10pt,innerrightmargin=1pt,
middlelinewidth=3pt,innerlinewidth=0.4pt,outerlinewidth=0.4pt,
linecolor=black,middlelinecolor=white,roundcorner=20pt}
\begin{document}
\begin{mdframed}[style=round]
\begin{minipage}{0.48\linewidth}
AAAA
\begin{easylist}[itemize]
& A1
& A2
& A3
\end{easylist}
\end{minipage}%
\vrule\hfill%
\begin{minipage}{0.48\linewidth}
BBBB
\begin{easylist}[itemize]
& B1
& B2
& B3
\end{easylist}
\end{minipage}%
\end{mdframed}
\end{document}