使用NotesTex时,xelatex编译遇到的pdf生成不能包含页面

2020-02-21 18:24发布

<我遇到了这样的问题,我是用了NotesTex。它生成的pdf文件右边和下边不能打印完整,我看NotesTex的模板用latex编译出来是ok的。但是我要输入中文字符所以用的是xelatex,c...

<我遇到了这样的问题,我是用了NotesTex。它生成的pdf文件右边和下边不能打印完整,我看NotesTex的模板用latex编译出来是ok的。但是我要输入中文字符所以用的是xelatex,ctex,不注释掉\pdfoutput=1就会报错。注释掉之后就会是这样,求助大家,应该怎么调?
附上代码:我的问题.zip




这是用latex正常情况!

2条回答
论坛 github.com/C
2020-02-21 20:04
这是一个 xetex 的 bug,已在代码库中修复。介绍见文章 https://zhuanlan.zhihu.com/p/108460962 。 原回答提供了「避免设置 [h|v]offset 为非零值」的绕过方法。 ------ notestex 宏包里使用了 ```tex \geometry{hoffset=-1in, voffset=-1in,} ``` 而 `hoffset` 和 `voffset` 在正常情况 [1] 下都应该为零值。xetex 的 `\pdflastxpos` 在 `\[h|v]offset` 非零时的行为与 pdftex 和 luatex 不同,导致了问题。 可复现问题的最小例子是 ```tex \documentclass{article} \usepackage[showframe]{geometry} \usepackage{marginnote} \geometry{hoffset=-1in, voffset=-1in} \begin{document} so\marginpar{right} that\marginnote{right}[10pt] \end{document} ``` 修复方式是,在加载 notestex 宏包后,添加 ```tex \geometry{hoffset=0pt, voffset=0pt, layouthoffset=-1in, layoutvoffset=-1in} ``` 这样,边注的不正常偏移就没了。 因为marginnote 和 sidenotes 宏包生成的边注都**不能浮动**,所以有时可能需要手动调整边注的纵向位置。 ```tex \marginnote{}[] % or \sidenote[][]{} ``` 其中 `` 是 tex dimension,例如 `50pt`(表示向下偏移 50pt)。 ------ [1] The LaTeX Companion, sec. 4.1 > The reference point can be shifted by redefining the lengths `\hoffset` and `\voffset`. By default, their values are zero. In general, the values of these parameters should **never** be changed.

一周热门 更多>