2016年12月21日
Q: 使用applied optics编译tex时,出现错误:
“! Package caption Error: singlelinecheck undefined. ”
“258 \caption@ProcessOptions*{caption}”
A: 需要更新caption宏包:打开“MiKTeX → Maintenance (Admin) → Update (Admin)”(好像必须要Admin),然后选择“caption”点击“下一步”更新即可。(已经更新过,所以列表中没有出现caption)
Q: 编译bib文件时,出现错误:
...\OSA-journal-template.bbl
! Misplaced alignment tab character &.
l.36 Control &
Information Sciences \textbf{401}, 3 (2010).
A: 这是因为编译*.bib文件生成的*.bbl(本质上也是生成了\bibitem)或者手动添加的\bibitem中特殊符号“&”错误,需要改成“\&”。(本例中期刊名称“Lecture Notes in Control & Information Sciences”应该改成“Lecture Notes in Control \& Information Sciences”)
一些直接导出的bib文件中&符号自动改成了“\&”,而有些没有自动转换。
Note : 有次在一处引用多篇文献时,如\cite{A, B}两篇文献中间有空格,编译出错(删除空格后没有错误),后来再编译时没有出错;原因未知。
Q: 编译bib文件时,出现错误:
! Missing } inserted.
text>
}
l.69 \end{thebibliography}
A: 这次编译是因为拷贝了web of science导出的bibtex文件,各项item都是用两个大括号括起来的,如下:
@article{ Bell2016Method,
...
Volume = {{55}},
Number = {{9}},
Pages = {{2346-2352}},}
而生成bbl文件是,结果如下:
..., { 2346 {(2016)}.
即少了一个右括号“}”,造成错误。把上面的双括号改成单括号没有错误,但自动生成的bbl还是parse有点错误的,至少编译没有问题。待解决~~
20161225
Q: 编译bib文件后图片、表格编号处为两个问号,示例代码如下:
\begin{figure}[h]
\begin{center}
\includegraphics[width=\linewidth]{fig_4.eps}\label{fig:fig4}
\caption{~~~.}
\end{center}
\end{figure}
A: “the label is defined when the center environment has already been closed and the object which the reference should be attached to has been forgotten.”,改正如下:
\begin{figure}[h]
\begin{center}
\includegraphics[width=\linewidth]{fig_4.eps}
\caption{~~~.}
\end{center}\label{fig:fig4}
\end{figure}
参考链接
20170310
在网页的参考文献中,如果有下划线,也需要“\_”
howpublished = {\url{http://www.vision.caltech.edu/bouguetj/calib\_doc/index.html}}
在一个地方引用多个参考文献,需要这样\cite{A,B}
,其中A和B中间不加空格;如果可是不正确可以参考这里。
20170313
一些package
\usepackage{multirow} %合并多行单元格
\usepackage{bm} %字母粗体,使用示例$\bm{H}$
\usepackage{amsfonts} %空心字母,如$\mathbb{R}$
粗体字母最好用bm,参考这里
2017-4-6
Q:电脑上安装了两个MikTex(安装CTex和LYX都会自动安装),两个软件编译都不能通过,出现类似下面的错误:
running 'initexmf --quiet --update-fndb' to refresh the file name database
Sorry, but latex.exe did not suceed
A:两个MikTex发生冲突,卸载其中一个
Q:用WinEdt打开tex文件出错
A:可能是因为utf-8编码,参考”解决 winedit 打开tex文件 reading error“,解决方法为:打开winedt,再点击file菜单-open,然后找到你的文档所在文件夹,右下角打开按钮上面的default旁边的黑三角,选相应的编码,如utf-8,然后再打开。
使用thuthesis模板时出现的一些问题
\arg\min_...
,如 argminNi arg min i N equation*
的时候,不对方程进行编号,其它align*
、multline*
等也一样gather
环境;可尝试其它环境、环境好像还可以组合,参见这里、这里以及模板示例文件等Q:有时候出错File ended while scanning use of \@@BOOKMARK
,直接回车继续,然后在编译一遍就通过了,可能是上一次出错的信息没有更新;使用thuthesis模板时,如果删除cover.tex中”%博士后专有部分”及其下面几行会出现“\kv@processor@default“等两个error
A:保留那一部分(原因目前未知);另外如果按照cover.tex所说把关键词放到摘要之后,关键词就不显示了,所以不要移动
Q:用subcaptionbox
时,调整图片间距
A:水平方向可以用\hspace{2em}
(单位em
表示approximately the width of the letter ‘M’ in current font,参考LaTeX的长度单位入门;而竖直方向间距不能用\vspace
(这好像是图片和最后一行和总体caption的间距),而应该用\par \bigskip
:You could insert the instructions \par\bigskip
between the second and third subfigure to create a bit of extra vertical space between the two sets of subfigures. If \bigskip
is too much for your taste, try using \medskip
.参考这里和这里。(还有\smallskip
可以参考WinEdt自带帮助)
Q:生成的参考文献列表中有很多[.s.l]
和[s.n.]
A:会议等地址不详,所以用这个替代;可以找到bst文件进行修改,参考这里。
\input xy
\xyoption{all}
^-{f}
或_-{h}
。