我正在尝试在图的标题中使用包\dbox
中的某个内容,如下所示:dashbox
\documentclass{article}
\usepackage{dashbox}
\begin{document}
\begin{figure}
\centering Imagine some figure here
\caption{\dbox{Boxed text} in caption.}
\end{figure}
\end{document}
Undefined control sequence. \caption{\dbox{Boxed text} in caption.}
Undefined control sequence. \caption{\dbox{Boxed text} in caption.}
Illegal parameter number in definition of \reserved@a. \caption{\dbox{Boxed text} in caption.}
Extra \or. \caption{\dbox{Boxed text} in caption.}
...
软件包文档说明:
\dbox{text}
工作原理类似\fbox
,但框用虚线绘制。
但\fbox
在标题内工作正常。
包裹里的盒子fancybox
似乎也有类似的问题。
在标题中绘制虚线框的正确方法是什么?
答案1
如果提供了图表列表的替代文本,则\dbox
可以立即使用
\documentclass{article}
\usepackage{dashbox}
\begin{document}
\begin{figure}
\centering Imagine some figure here
\caption[text for list of figures]{\dbox{Boxed text} in caption.}
\end{figure}
\end{document}