嗯,boss不喜歡Latex,so weak(吐槽而已!對不起!)! 但我喜歡,所以又在新PC(Windows10)上重裝了texlive2019。要記錄一下,以後折騰會快點。
1. 在WSL上裝texlive2019
嗯,我裝了Ubuntu(wsl)
,而且還裝了oh-my-zsh
。安裝過程基本是看這篇:texlive 2019安裝指南,但是這篇沒能解決我所有問題。
Q1: 一開始,我遇到一個問題:爲什麼我在wsl
中運行tex --version
沒有反應?
我已經裝了libfontconfig
庫了。
(1)我覺得可能是我安裝了zsh,所以應該把~/.bashrc
寫成~/.zshrc
:
echo "export MANPATH=${MANPATH}:/usr/local/texlive/2019/texmf-dist/doc/man" >> ~/.zshrc
echo "export INFOPATH=${INFOPATH}:/usr/local/texlive/2019/texmf-dist/doc/info" >> ~/.zshrc
echo "export PATH=${PATH}:/usr/local/texlive/2019/bin/x86_64-linux" >> ~/.zshrc
(2)沒用。所以我打開~/.zshrc
文件,把(1)中加入的刪掉,換成這個:
export MANPATH=${MANPATH}:/usr/local/texlive/2019/texmf-dist/doc/man
export INFOPATH=${INFOPATH}:/usr/local/texlive/2019/texmf-dist/doc/info
export PATH=${PATH}:/usr/local/texlive/2019/bin/x86_64-linux
這個主要參考:
(3)還是不行,但是我在wsl
中輸入exit
退出後,再打開wsl
就奇蹟般行了。輸出如下:
$ tex --version
TeX 3.14159265 (TeX Live 2019)
kpathsea version 6.3.1
Copyright 2019 D.E. Knuth.
There is NO warranty. Redistribution of this software is
covered by the terms of both the TeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the TeX source.
Primary author of TeX: D.E. Knuth.
所以說不定一開始(1)也行,但我沒回頭嘗試了。
Q2:我使用vscode的latexworkshop插件,zsh:1:commond not be found: xelatex
?
研究過後,我覺得是插件沒辦法識別我settings.json
中的latex-workshop.latex.tools
。我嘗試過不少方法,都沒能解決我的問題。最後,我修改wsl
爲/usr/local/texlive/2019/bin/x86_64-linux/xelatex
就可以了。我settings.json
中的latex-workshop.latex.tools
如下:
"latex-workshop.latex.tools": [
{
"name": "xelatex",
"command": "wsl",
"args": [
"/usr/local/texlive/2019/bin/x86_64-linux/xelatex",
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
// 聽說把%DOC%改成%DOCFILE%可以識別中文路徑
]
},
...
主要參考資料:
Q3:Invalid filename `Times New Roman’, contains ’ '!
(1)一開始,我以爲是 xelatex 缺少字體,所以根據TEX Live 指南—2019做了一下:XeT E X 和 LuaT E X 的系統字體配置。但是仍然無法成功編譯。暫時沒有解決。
2. 在Windows10上裝texlive2019
因爲Q3沒有解決,所以我直接在Windows10上裝了= =
這裏有幾個重要的資料:
嗯,方便自己下次折騰= =