用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条回答
兰铃 - 渔舟唱晚
2020-02-16 13:44
盲猜 `subfloat` 传参问题。 ```tex \documentclass{article} \usepackage{subfig} \usepackage[demo]{graphicx} \begin{document} other part of code which compiles fine \begin{figure} \centering \subfloat[][a]{\includegraphics{}\label{}} \subfloat[][b]{\includegraphics{}\label{}} \caption{Comparison of steady state results (a) x method (b) y method} \label{steady_state} \end{figure} %remaining part \end{document} ``` reference: https://tex.stackexchange.com/questions/111822/using-subfloat-to-place-figures-side-by-side 学习之余也要会自己多探索,加油啊。 ![](https://pics.latexstudio.net/data/images/202002/fd2c897947314ad.png)

回答: 2020-02-16 13:44

![](https://pics.latexstudio.net/data/images/202002/1329f26bd681dcc.png) 效果图忘了放了。 如果要修改默认的`(a), (b)`子图的编号,得具体去查看下`subgif`的手册了。

一周热门 更多>