以下是 tcolorbox 中带有海报的序列示例:
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{poster}
\usepackage{lipsum}
\begin{document}
\begin{tcbposter}[
poster = {showframe,
columns=2,
rows=2,
spacing=3mm,
height=18cm,
width=12cm,
},
]
\posterbox[
colframe = red,
]{
name=A,
sequence = 1 between top and row2 then
2 between top and bottom
}{\scriptsize\lipsum[1]}
\end{tcbposter}
\end{document}
我想知道是否可以只更改名为 A2 的块的设置。例如,我想在为空时禁用占位符样式或选择与 A1 不同的颜色。
此外,我想知道我是否可以将长文本放入整个序列中。如果我使用“适合”选项,我会得到一个独特的长框,而不是两个分开的框:
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{poster}
\usepackage{lipsum}
\begin{document}
\begin{tcbposter}[
poster = {showframe,
columns=2,
rows=2,
spacing=3mm,
height=14cm,
width=12cm,
},
]
\posterbox[
colframe = red,
fit to=5.85cm and 20cm,
]{
name=A,
sequence = 1 between top and row2 then
2 between top and bottom
}{\lipsum[1]}
\end{tcbposter}
\end{document}
编辑:
这是基于@BambOo 答案和不透明度选项的解决方案(如果它对某人有用)。
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{poster}
\usepackage{lipsum}
\begin{document}
\begin{tcbposter}[
poster = {showframe,
columns=2,
rows=2,
spacing=3mm,
height=14cm,
width=12cm,
},
/tcb/placeholder/.style={
enhanced jigsaw,
opacityframe=0.0,
opacityback=0.0}
]
\posterbox[
colframe = red,
]{
name=A,
column = 1,
row=1,
}{}
\posterbox[
colframe = blue,
]{
name=A,
column = 2,
row=1,
rowspan=2,
}{}
\posterbox[
enhanced jigsaw,
colframe = red,
opacityframe=0.0,
opacityback=0.0
]{
name=A,
sequence = 1 between top and row2 then
2 between top and bottom
}{\lipsum[1]}
\end{tcbposter}
\end{document}
答案1
您可以\posterbox
使用column
和between
代替 来定义您的sequence
。请参阅tcolorbox
v4.14 手册第 19.2 节第 399 页
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{poster}
\usepackage{lipsum}
\begin{document}
\begin{tcbposter}[
poster = {showframe,
columns=2,
rows=2,
spacing=3mm,
height=18cm,
width=12cm,
},
]
\posterbox[
colframe = red,
]{
name=A1,
column=1,
between= top and row2
}{\scriptsize\lipsum[1]}
\posterbox[
colframe = blue,
]{
name=A2,
column=2,
between= top and bottom
}{\scriptsize\lipsum[1]}
\end{tcbposter}
\end{document}
编辑解决方案维持sequence
方法。
该解决方案基于对placeholder
风格的重新定义tcolorbox
。
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{poster}
\usepackage{lipsum}
\begin{document}
%\tcbset{placeholder={colframe=blue,colback=blue}}
\begin{tcbposter}[
poster = {showframe,columns=2,rows=2,spacing=3mm,height=14cm,width=12cm},
boxes={colframe=red,colback=white},
/tcb/placeholder/.style={colframe=blue,colback=white}
]
\posterbox[
colframe = red
]{name=A,
sequence =
1 between top and row2 then
2 between top and bottom
}{\lipsum[1]
}
\end{tcbposter}
\end{document}
为空时的结果
填满后的结果