问题:有人能告诉我如何指定 bclogo 框的宽度吗?我还没有找到答案,也不知道该怎么做。
例如,
\documentclass[article]{book}
\usepackage{xcolor}
\usepackage[tikz]{bclogo}
\usepackage{lipsum}
\begin{document}
\thispagestyle{empty}
\lipsum[1]
\vskip 20pt
\begin{center}
\begin{bclogo}[
couleur=red!10, % background color
marge=10, % margin in pt
epBord=2.5, % border width
arrondi=0, % corner radius
ombre=true, % shadow
blur, % blur
couleurBord=blue!14, % border color
logo=, % no built-in logo
barre=none, % border style
tailleOndu=1.5 % border amplitude (zigzag)
]
{\vskip -11pt {\color{black} This is a sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. \vspace*{-15pt}}}
\end{bclogo}
\end{center}
\end{document}
输出为:
我希望能够指定显示框的宽度,以便我可以相应地增加或减少它。我不知道默认值是多少---使用bclogo似乎总是会产生一个宽度接近文本宽度的框。
谢谢。
答案1
根据bclogo
文档,它将margeG
和定义margeD
为外部边距,但它们对我来说不起作用。
如果您想继续使用,bclogo
可能的解决方案是将其插入\minipage
具有所需宽度的内部:
\documentclass[article]{book}
\usepackage{xcolor}
\usepackage[tikz]{bclogo}
\usepackage{lipsum}
\begin{document}
\thispagestyle{empty}
\lipsum[1]
\begin{bclogo}[
couleur=red!10, % background color
marge=10, % margin in pt
epBord=2.5, % border width
arrondi=0, % corner radius
ombre=true, % shadow
blur, % blur
couleurBord=blue!14, % border color
logo=, % no built-in logo
barre=none, % border style
tailleOndu=1.5 % border amplitude (zigzag)
]{}
This is a sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence.
\end{bclogo}
{\par\centering
\begin{minipage}{.75\linewidth}
\begin{bclogo}[
couleur=red!10, % background color
marge=10, % margin in pt
epBord=2.5, % border width
arrondi=0, % corner radius
ombre=true, % shadow
blur, % blur
couleurBord=blue!14, % border color
logo=, % no built-in logo
barre=none, % border style
tailleOndu=1.5 % border amplitude (zigzag)
]{}
This is a sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence.
\end{bclogo}
\end{minipage}
\par}
\end{document}
另外,您可以尝试使用(使用模拟一个盒子tcolorbox
并不难):bclogo
tcolorbox
\documentclass{article}
\usepackage{lipsum}
\usepackage[most]{tcolorbox}
\newtcolorbox{mybox}[1][]{
enhanced, colback=red!10, colframe=blue!14, boxrule=2.5pt, sharp corners, drop fuzzy shadow, #1
}
\begin{document}
\thispagestyle{empty}
\lipsum[2]
\begin{mybox}
\lipsum[2]
\end{mybox}
\begin{mybox}[width=.75\linewidth, center]
\lipsum[2]
\end{mybox}
\end{document}