如何在“framed”环境中插图

2019-11-13 14:05发布

想在文本框中插图,却总是报错 \documentclass[11pt,a4paper]{ctexart} \usepackage{graphicx} \usepacage{subfigure} \u...

想在文本框中插图,却总是报错 \documentclass[11pt,a4paper]{ctexart} \usepackage{graphicx} \usepacage{subfigure} \usepackage{float} \usepackage{framed} \begin{document} \begin{framed} \begin{figure} \centering \includegraphics[width=0.7\textwidth]{sw1.png} \caption{} \label{fig:srfc} \end{figure} \end{framed} \end{document} 下面是报错内容: Not in outer par mode. \centering Undefined control sequence. \centering Missing number, treated as zero. \centering Font shape `U/rsfs/m/n' in size <15> not available(Font) size <14> substituted Font shape `U/rsfs/m/n' in size <10> not available(Font) size <10> substituted Font shape `U/rsfs/m/n' in size <7> not available(Font) size <7> substituted Underfull \vbox (badness 10000) detected Overfull \vbox (2.2258pt too high) detected Underfull \vbox (badness 3679) detected Underfull \vbox (badness 10000) detected Overfull \vbox (2.2258pt too high) detected Underfull \vbox (badness 10000) detected Overfull \vbox (2.2258pt too high) detected Underfull \vbox (badness 1005) detected Size substitutions with differences(Font) up to 0.6pt have occurred.


3条回答
registor
2019-11-13 14:36
不可以在frame等静态环境中使用浮动体环境,但反过来是可以的,如: ```tex \documentclass[11pt,a4paper]{ctexart} \usepackage{graphicx} \usepackage{subfigure} \usepackage{float} \usepackage{framed} \usepackage{mwe} \begin{document} \begin{figure} \begin{framed} \centering \includegraphics[width=0.7\textwidth]{example-image-a} \caption{test} \label{fig:srfc} \end{framed} \end{figure} \end{document} ``` 另外,MWE中`\usepacage{subfigure}`是错误的,应该是`\usepackage{subfigure}`。

一周热门 更多>