零碎的技巧

parbox and minipage

wiki is here:Find minepage and parbox
wiki is also here(local saved html):Find minepage and parbox

Most standard LaTeX boxes are not long commands, i.e. they do not support breaks nor paragraphs. However you can pack a paragraph of your choice into a box with either the \parbox[pos][height][contentpos]{width}{text} command or the \begin{minipage}[pos][height][contentpos]{width} text \end{minipage} environment.

The pos parameter can take one of the letters center, top or bottom to control the vertical alignment of the box, relative to the baseline of the surrounding text. The height parameter is the height of the parbox or minipage. The contentpos parameter is the position of the content and can be one of center, top, bottom or spread. width takes a length argument specifying the width of the box. The main difference between a minipage and a \parbox is that you cannot use all commands and environments inside a parbox, while almost anything is possible in a minipage.

xelatex 编译遇到eu1lmr.fd的时候缓慢

fc-cache -fv
fc-cache -sfv
	

数学中微分符号d要采用直立体

刘海洋书4.2.1 \DeclareMathOperator\dif{d\!}

sumatrapdf 与 notepad++配合正反向搜索

反向搜索

编译时一定要加参数:xelatex -synctex=1. 配置sumatrapdf: "F:\appWin\notepadpp\App\Notepad++\notepad++.exe" -n%l "%f"

"F:\appWin\notepadpp\App\Notepad++\notepad++.exe" -n%l是sumatrapdf告诉notepad++行号

"%f" 是sumatrapdf告诉notepad++打开哪文件

notepad++向sumatrapdf正向搜索

在notepad++中按F5(表示运行程序),输入F:\appWin\SumatraPDF\SumatraPDF-3.1.2-64\SumatraPDF.exe -forward-search "$(CURRENT_DIRECTORY)\$(NAME_PART).tex" $(CURRENT_LINE) "$(CURRENT_DIRECTORY)\$(NAME_PART).pdf"

sumatrapdf的GitHub页面wiki上有sumatrapdf -forward-search的解释:sumatrapdf -forward-search <texfile_path> <linenum>

"$(CURRENT_DIRECTORY)\$(NAME_PART).tex" 是notepad++给sumatrapdf 传入texfile_path参数

$(CURRENT_LINE) 是notepad++把 linenum 参数传给sumatrapdf

"$(CURRENT_DIRECTORY)\$(NAME_PART).pdf" 是notepad++告诉sumatrapdf 打开哪个pdf文件

字体相关

\setmainfont{Times New Roman}的时候使用字体名,不要使用字体文件名 ,不知道的话用fc-list

SmallCaps slanted与Times New Roman不和谐的问题

不指定英语的mainfont,没有什么问题,有些流氓就喜欢Times New Roman,\setmainfont{Times New Roman}将会导致\scshape和\slshape失效。
解决:\scshape用不同的字体 \setmainfont{TeX Gyre Termes}实现,用过后再改回Times New Roman。
\slshape:\setmainfont[AutoFakeSlant=0.2]{Times New Roman},用AotoFakeSlant,伪slant形状,效果差不多。

\addcontentsline{toc}{section} {}手动添加目录页码对,链接错误

参考网上的解答

\phantomsection
\addcontentsline{toc}{section}{表格目录}

让hyperref生成的书签有section number

\hypersetup{bookmarksnumbered}