hithesis部署和VSCode远程编辑tex文件

Posted fjssharpsword

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了hithesis部署和VSCode远程编辑tex文件相关的知识,希望对你有一定的参考价值。

哈工大学位论文模板:GitHub - dustincys/hithesis: 嗨!thesis!哈尔滨工业大学毕业论文LaTeX模板

1、在ubuntu下安装TinyTeX

1) git clone https://github.com/dustincys/hithesis.git

2) cd目录到hithesis/.github/workflows下执行:sh install-TinyTeX_hithesis.sh

安装到/root/.TinyTeX/下,bin在/root/bin目录。

2、由于非path路径,需要补充安装:

1) apt-get install libfontconfig1

2)补充一个sh文件,执行:

/root/bin/tlmgr option repository http://www.ctan.org/tex-archive/systems/texlive/tlnet
/root/bin/tlmgr update --self --all
/root/bin/tlmgr path add
/root/bin/fmtutil-sys --all

echo "Finish update , install extra packages..."

/root/bin/tlmgr install \\
      adobemapping algorithm2e amscls amsfonts amsmath arphic atbegshi atveryend \\
      auxhook babel beamer bibtex bibtex.x86_64-linuxmusl bigfoot bigintcalc bitset \\
      booktabs carlisle ccaption changepage cjk cjkpunct cm cns ctablestack ctex \\
      datatool dehyph dvipdfmx dvipdfmx.x86_64-linuxmusl dvips dvips.x86_64-linuxmusl \\
      ec enumitem environ epstopdf-pkg eso-pic etex etexcmds etoolbox euenc everyhook \\
      everysel everyshi fancyhdr fancyvrb fandol filehook firstaid float fontaxes \\
      fonts-tlwg fontspec footmisc fp framed garuda-c90 gbt7714 geometry \\
      gettitlestring glossaries glossaries-extra glossaries.x86_64-linuxmusl glyphlist \\
      graphics graphics-cfg graphics-def grfext grffile helvetic hycolor hypdoc \\
      hyperref hyph-utf8 hyphen-base hyphen-german ifoddpage iftex inconsolata \\
      infwarerr intcalc jknapltx kastrup knuth-lib kpathsea kpathsea.x86_64-linuxmusl \\
      kvdefinekeys kvoptions kvsetkeys l3backend l3kernel l3packages latex \\
      latex-amsmath-dev latex-base-dev latex-bin latex-bin.x86_64-linuxmusl \\
      latex-firstaid-dev latex-fonts latex-tools-dev latexconfig latexmk \\
      latexmk.x86_64-linuxmusl letltxmacro lipsum listings lm lm-math ltxcmds \\
      lua-alt-getopt luahbtex luahbtex.x86_64-linuxmusl lualatex-math lualibs \\
      luaotfload luaotfload.x86_64-linuxmusl luatex luatex.x86_64-linuxmusl luatexbase \\
      luatexja makeindex makeindex.x86_64-linuxmusl mdwtools metafont \\
      metafont.x86_64-linuxmusl metalogo mfirstuc mfware mfware.x86_64-linuxmusl modes \\
      mptopdf mptopdf.x86_64-linuxmusl ms multirow natbib newpx newtx norasi-c90 \\
      ntheorem oberdiek pdfescape pdflscape pdfpages pdftex pdftex.x86_64-linuxmusl \\
      pdftexcmds pgf placeins plain platex platex-tools platex.x86_64-linuxmusl psnfss \\
      ptex ptex-base ptex-fonts ptex.x86_64-linuxmusl realscripts refcount relsize \\
      rerunfilecheck rsfs scheme-infraonly siunitx splitindex \\
      splitindex.x86_64-linuxmusl stringenc subfigure substr svn-prov symbol tex \\
      tex-gyre tex-ini-files tex.x86_64-linuxmusl texlive-scripts \\
      texlive-scripts.x86_64-linuxmusl texlive.infra texlive.infra.x86_64-linuxmusl \\
      textcase tikzpagenodes times tipa tools tracklang translator trimspaces ttfutils \\
      ttfutils.x86_64-linuxmusl txfonts uhc ulem unicode-data unicode-math \\
      uniquecounter uplatex uplatex.x86_64-linuxmusl uptex uptex-base uptex-fonts \\
      uptex.x86_64-linuxmusl url varwidth wadalab xcjk2uni xcolor xecjk xetex \\
      xetex.x86_64-linuxmusl xetexconfig xfor xkeyval xltxtra xpinyin xstring xunicode \\
      zapfding zhmetrics zhmetrics-uptex zhnumber

echo "Finish install extra packages."

3) 补充relsize.sty文件

wget http://tug.ctan.org/tex-archive/macros/latex/contrib/relsize/relsize.sty

4) 安装ghostscript 

apt-get -y install ghostscript

3、模板编译

1) cd目录到hithesis下,执行/root/bin/latex hithesis.ins

2) cd到hithesis/examples/hitbook/chinese执行

/root/bin/xelatex -shell-escape thesis.tex
/root/bin/bibtex thesis
/root/bin/xelatex -shell-escape thesis.tex
/root/bin/xelatex -shell-escape thesis.tex
/root/bin/splitindex thesis -- -s hithesis.ist  
/root/bin/xelatex -shell-escape thesis.tex

或直接make thesis

目前是执行/root/bin/xelatex -no-pdf thesis.tex可以编译通过,但执行/root/bin/xdvipdfmx -V5 thesis就出现错误。

这个错误“xdvipdfmx:fatal: pdf_link_obj(): passed invalid object.”暂时无解,在ubuntu20环境下。

4、VSCode远程编辑tex文件:

1)windows本地安装并remote远程部署latex的ubuntu服务器;

2)vscode安装插件LaTeX Workshop;

3)配置vscode上的latex插件,包括编译环境。

5、在ubuntu环境下无法成功执行thesis.tex,因此将其移到Overleaf上,可以。

1)执行/root/bin/latex hithesis.ins,生成的文件即迁移到overleaf;

2)修改latexmkrc上配置项preview_continuous_mode=0 (原来是1);

参见Github:https://github.com/fjssharpsword/hithesis_overleaf

以上是关于hithesis部署和VSCode远程编辑tex文件的主要内容,如果未能解决你的问题,请参考以下文章

hithesis部署和VSCode远程编辑tex文件

基于VSCode的Markdown博文编写与发布方案

vscode远程ubuntu代码编辑

如何使用 VSCode 远程编辑网站文件?

Vim哭了,浏览器就能远程VS Code开发,还支持Docker快速部署运行

使用Vscode软件直接编辑调试远程Linux主机上的代码