-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: accelerate doc build #75
Conversation
CTeX 如果使用 pdflatex 的话是可以被缓存的,在 xelatex 中因为用了 fontspec 而暂时不能(以后会尝试更多的方法)。所以这种缓存行文还是在小范围内用于开发加速,以后想推广得等类似的方法出现。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
src/source/sjtucover.dtx
Outdated
(0.2*\the\paperwidth,0) circle [radius=\the\paperwidth]; | ||
\end{tikzpicture} | ||
\fi% | ||
% \ifbeamer@draftmode% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉是不是最好不要改变模版的默认行为和样式?可以考虑开启 cache 的时候把 overlay disable 掉(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我思考一下 改改看
改为添加下面的代码使不兼容的代码失效: \makeatletter
\def\sjtubeamer@compatible{false}
\makeatother
\usetheme{sjtubeamer} |
end | ||
|
||
typesetopts = "-interaction=nonstopmode -shell-escape" | ||
typesetfiles = {"sjtubeamerdevguide.tex","sjtubeamer.tex"} | ||
-- typesetfiles = {"sjtubeamer.tex"} | ||
-- typesetruns = 1 -- for debug. Some reference may not be linked. | ||
-- typesetdemofiles = {"min.tex"} | ||
-- cachedemo = true -- cache the demo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改 build.lua 里的 cachedemo
变量可以调整是否需要缓存demo,现在默认还是先关上吧,下面也有对应的提示。
@@ -73,8 +73,8 @@ see https://vi.sjtu.edu.cn/index.php/articles/bulletin/16. | |||
\from{sjtucover.dtx}{package\preserveoption}} | |||
} | |||
\generate{\file{sjtuvi.sty}{% | |||
\from{sjtuvi.dtx}{package,compatible}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compatible
选项已经被移除,使用上面的方法代替。
采用
mylatexformat
进行单元测试导言区预编译单元测试项目的个数很多,而且很多的导言区是重复加载的。通过
mylatexformat
可以 dump 一些可以被缓存的头文件,这样构建时就可以减少不必要的重复工作。-预编译后->
当然这种方法不太适合一些使用 OpenType 字体的宏包,比如
ctex
,这个时候就会被拆分为
这种预编译可以存储选项信息,但是过于零碎的预存就失去了减少时间的作用,所以如果第一行不匹配就会不会使用静态库(
.fmt
)链接。以后将会考虑整合这种方法到主文件编译。现在默认不启用单元测试结果缓存,开发者需要在 build.lua 中打开
cachedemo
。现在本地的编译速度已经跟服务器编译速度基本相同(之前需要 15min+,受制于硬盘读取速度等)。杂项
sjtucover
已经变成静态库,不涉及判断。cache/
文件夹现在被合并入build/
,两者有些重复。删除了 min 的标题页背景,因为构建文档时通过下面避免。fadings
库不稳定,以及之前的错位现象 封面合集及用户文档中背景图片位置异常 #55 ,并且不能被用作缓存,在这版删除,如果需要这个背景,可以手动在sjtucover.sty
中开启。compatible
预编译选项在加载前定义\sjtubeamer@compatible
为false
以避免兼容问题。点击查看预存储信息