MacOS安装latex的方法
MacOS安装latex文章目录MacOS安装latex基于MacTeX安装latex安装mactexvscode 设置使用基于docker安装latex依赖环境过程安装docker拉取镜像配置vscode插件配置文件使用更多基于MacTeX安装latex安装mactex下载mactex下载地址:http://tug.org/mactex/mactex-download.htmlps:实验室校园网
·
MacOS安装latex
文章目录
基于MacTeX安装latex
安装mactex
- 下载mactex
下载地址:http://tug.org/mactex/mactex-download.html
ps:实验室校园网下载,嗷嗷快,(不用挂科学上网) - 安装mactex
双击下载好的dmg文件,下一步,下一步~
vscode 设置
-
安装LaTeX Workshop插件
-
vscode 配置文件
"latex-workshop.latex.autoBuild.cleanAndRetry.enabled": true,
"latex-workshop.latex.autoClean.run": "onFailed",
"editor.wordWrap": "on", // 自动换行
"workbench.startupEditor": "newUntitledFile",
"latex-workshop.view.pdf.viewer": "tab",
"latex-workshop.latex.clean.fileTypes": [
"*.aux",
"*.bbl",
"*.blg",
"*.idx",
"*.ind",
"*.lof",
"*.lot",
"*.out",
"*.toc",
"*.acn",
"*.acr",
"*.alg",
"*.glg",
"*.glo",
"*.gls",
"*.ist",
"*.fls",
"*.log",
"*.fdb_latexmk",
"*.gz"
],
"ltex.enabled": true, // 启用插件
"ltex.language": "en-US",
"ltex.en-US.dictionary": [
"CKBQA",
"KGQA"
],
// 安装MacTeX 就能直接用,要个锤子的docker
"latex-workshop.showContextMenu": true, //右键菜单
"latex-workshop.intellisense.package.enabled": true, //根据加载的包,自动完成命令或包
"latex-workshop.latex.autoBuild.run": "never", //禁止保存文件时自动build
"latex-workshop.synctex.afterBuild.enabled": true,
"latex-workshop.view.pdf.internal.synctex.keybinding": "double-click",
"latex-workshop.latex.recipes": [
{
"name": "xelatex",
"tools": [
"xelatex"
]
},
{
"name": "latexmk",
"tools": [
"latexmk"
]
},
{
"name": "xelatex ➞ bibtex ➞ xelatex`×2",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
},
{
"name": "pdflatex -> bibtex -> pdflatex*2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
},
],
"latex-workshop.latex.tools": [
{
"name": "xelatex",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"%DOC%"
]
},
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"%DOC%"
]
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}
],
把上面的配置文件的内容粘贴到vscode的配置页,然后保存并重启vscode软件就行
- vscode配置页打开方式👇
使用
- 打开文件夹,选择主tex文件,LaTeX Workshop插件回自动跳出
- 编译
保存自动编译 orctrl+alt+b
- tex跳转到pdf
ctrl+alt+j
- pdf跳转到tex
双击
orctrl+单击
基于docker安装latex
- 不推荐
- 占用磁盘空间多于上一种方法
- 使用时docker要一直开着
依赖
- vscode
- docker
环境
macOS Catalina 10.15.7
过程
安装docker
拉取镜像
docker pull mirisbowring/texlive_ctan_full:2019
地址: https://hub.docker.com/r/mirisbowring/texlive_ctan_full
配置vscode
插件
LaTeX Workshop
配置文件
"latex-workshop.latex.autoBuild.cleanAndRetry.enabled": true,
"editor.wordWrap": "on", // 自动换行
"workbench.startupEditor": "newUntitledFile",
"latex-workshop.view.pdf.viewer": "tab",
"latex-workshop.latex.clean.fileTypes": [
"*.aux",
"*.bbl",
"*.blg",
"*.idx",
"*.ind",
"*.lof",
"*.lot",
"*.out",
"*.toc",
"*.acn",
"*.acr",
"*.alg",
"*.glg",
"*.glo",
"*.gls",
"*.ist",
"*.fls",
"*.log",
"*.fdb_latexmk",
"*.gz"
],
"ltex.enabled": true, // 启用插件
"ltex.language": "en-US",
"ltex.en-US.dictionary": [
"CKBQA",
"KGQA"
],
"latex-workshop.docker.enabled": true,
"latex-workshop.docker.image.latex": "d46f027f062f",//镜像id
"latex-workshop.intellisense.package.enabled": true,
"latex-workshop.synctex.afterBuild.enabled":true,
"latex-workshop.view.pdf.internal.synctex.keybinding":"double-click",
"latex-workshop.latex.recipes": [
{
"name": "xelatex",
"tools": [
"xelatex"
]
},
{
"name": "latexmk",
"tools": [
"latexmk"
]
},
{
"name": "xelatex ➞ bibtex ➞ xelatex`×2",
"tools": [
"xelatex",
"bibtex",
"xelatex",
"xelatex"
]
},
{
"name": "pdflatex -> bibtex -> pdflatex*2",
"tools": [
"pdflatex",
"bibtex",
"pdflatex",
"pdflatex"
]
},
],
"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-pdf",
"-outdir=%OUTDIR%",
"%DOCFILE%"
],
"env": {}
},
{
"name": "xelatex",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-outdir=%OUTDIR%",
"-xelatex",
"%DOCFILE%"
],
"env": {}
},
{
"name": "bibtex",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-outdir=%OUTDIR%",
"-bibtex",
"%DOCFILE%"
],
"env": {}
},
{
"name": "pdflatex",
"command": "latexmk",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-outdir=%OUTDIR%",
"-pdflatex",
"%DOCFILE%"
]
}
],
使用
- 启动docker desktop
- 打开文件夹,选择主tex文件
- 编译
保存自动编译 orctrl+alt+b
- tex跳转到pdf
ctrl+alt+j
- pdf跳转到tex
双击
orctrl+单击
更多
https://72b27340.wiz06.com/wapp/pages/view/share/s/1OIDd00vu4cV2ZGM4M3sXIVT3gkoll2JBANr2pPcyP3vXX01
更多推荐
已为社区贡献1条内容
所有评论(0)