以下表示我想在一对垂直平行线之间从头到尾强调的一个定理的要素。
- 一段文本。
- 一个等式——不一定有编号。
- 比例为 1.00 的 eps 文件中的图形
- 更多文字。
看来 tcolorbox 和 tikz(作为绘图工具)不适合这样的要求,而 mdframed 是理想的选择;但它并不经常被提及。
这似乎适用于许多应用程序。有人能告诉我正确的语法吗?>
\begin{tikzpicture}[draw=DarkBlue, line width=1.0pt,
inner sep=12pt, inner ysep=6pt]
\node at (0,0) [rectangle,draw,fill=LightBlue]{%
\begin{minipage}[t]{118mm}% Items 1, 2, 3, 4 as in my original question. I want only the left and right lines to appear. Tried adapting the line commented-out below, but cannot control placement.
\vspace{2pt}%
\draw [line width=0.25mm, red ] (0,-1) -- (2,-1) node [right] {\SI{0.25}{\milli\meter}};;
\end{minipage}};
\end{tikzpicture}
答案1
我不明白为什么tcolorbox
它不适合,所以我建议用这个包来解决问题。它包含一个带有标题的图和caption
包。
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{caption}
\newtcolorbox{mybox}[1][]{%
breakable,
notitle,
colback=blue!10!white,
colframe=blue!60!black,
sharp corners,
boxsep=0pt,
left=12pt, right=12pt,
top=6pt, bottom=6pt,
boxrule=0pt,leftrule=1pt,rightrule=1pt,
#1
}
\begin{document}
\lipsum[1]
\begin{mybox}
Some previous text: \lipsum[2]
An unnumbered equation:
\[\sin^2 x + \cos^2 x = 1 \]
A numbered equation:
\begin{equation}
\sin^2 x + \cos^2 x = 1
\end{equation}
A figure with caption:
{\par\centering
\includegraphics[width=.75\textwidth]{example-image}
\captionof{figure}{This is a figure inside a \texttt{tcolorbox}}
\par}
Some more text: \lipsum[4]
\end{mybox}
\end{document}