用subfig排版图片报错Illegal unit of measure (pt inserted)

2020-02-16 13:19发布

我参考了lshort-zh-cn P35页的参考代码编写的如下代码, ```tex \documentclass{book} \usepackage{subfig} \begin{document...

我参考了lshort-zh-cn P35页的参考代码编写的如下代码, ```tex \documentclass{book} \usepackage{subfig} \begin{document} \begin{figure}[htbp] \centering \subfloat[(1)]{ \label{C1T12(1)} \begin{minipage} \centering \end{minipage} } \qquad \subfloat[(2)]{ \label{C1T12(2)} \begin{minipage} \centering \end{minipage} } \caption{第12题} \label{C1T12} \end{figure} \end{document} ``` 但是报错 行 12: Missing number, treated as zero. ^^I^^I} 行 12: Illegal unit of measure (pt inserted). ^^I^^I} 行 12: Missing number, treated as zero. ^^I^^I} 行 12: Illegal unit of measure (pt inserted). ^^I^^I} 行 19: Missing number, treated as zero. ^^I^^I} 行 19: Illegal unit of measure (pt inserted). ^^I^^I} 行 19: Missing number, treated as zero. ^^I^^I} 行 19: Illegal unit of measure (pt inserted). ^^I^^I} 请问是什么原因,谢谢。
3条回答
xjw
2020-02-16 13:51
caption用中文得加ctex,加载图片要用graphicx,同时minipage要指定宽度,不能只有\begin{minipage} \documentclass{book} \usepackage{subfig,ctex,graphicx} \begin{document} \begin{figure}[htbp] \centering \subfloat[(1)]{ \label{C1T12(1)} \begin{minipage}{0.2\textwidth} \centering \includegraphics{a.png} \end{minipage} } \qquad \subfloat[(2)]{ \label{C1T12(2)} \begin{minipage}{0.2\textwidth} \centering \includegraphics{a.png} \end{minipage} } \caption{第12题} \label{C1T12} \end{figure} \end{document}

一周热门 更多>