我的最小代码:
\documentclass{article}
\usepackage{tikz}
\usepackage{tcolorbox}
\tcbuselibrary{poster}
\usepackage{bbding}
\usepackage{pifont}
\usepackage{enumitem}
\usepackage{tcolorbox,enumitem,setspace}
\begin{document}
\begin{tcbposter}[
poster = {
columns=1,
rows=2,
spacing=3mm,
height=14cm,
width=12cm,
},
]
\posterbox[colframe=red,width=4cm,height=4cm]{column=1}{
%\begin{itemize}[leftmargin=0]
1. This will break to two lines
2. This will break to two lines
3. This will break to two lines
}
\end{tcbposter}
\end{document}
答案1
这是一个简单的可能性enumitem
:
\documentclass{article}
\usepackage{tikz}
\usepackage{tcolorbox}
\tcbuselibrary{poster}
\usepackage{bbding}
\usepackage{pifont}
\usepackage{enumitem, setspace}
\begin{document}
\begin{tcbposter}[
poster = {
columns=1,
rows=2,
spacing=3mm,
height=14cm,
width=12cm,
},
]
\posterbox[colframe=red,width=4cm,height=4cm]{column=1}{
\begin{enumerate}[wide, leftmargin =-1em, rightmargin=-1em]
\item This will break to two lines, or even more.
\item This will break to two lines.
\item This will break to two lines.
\end{enumerate}
}
\end{tcbposter}
\end{document}
答案2
使用方法如下\parindent
。也可以使用 进行设置\setlength
。
\documentclass{article}
\usepackage{tikz}
\usepackage{tcolorbox}
\tcbuselibrary{poster}
\usepackage{bbding}
\usepackage{pifont}
\usepackage{enumitem}
\usepackage{tcolorbox,enumitem,setspace}
\begin{document}
\begin{tcbposter}[
poster = {
columns=1,
rows=2,
spacing=3mm,
height=14cm,
width=12cm,
},
]
\posterbox[colframe=red,width=4cm,height=4cm]{column=1}{
%\begin{itemize}[leftmargin=0]
\raggedright
\parindent=1em
1. This will break to two lines
2. This will break to two lines
3. This will break to two lines
}
\end{tcbposter}
\end{document}