-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from soulmachine/master
Added vscode devcontainer
- Loading branch information
Showing
3 changed files
with
34 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "TeX Live", | ||
"image": "soulmachine/texlive:latest", | ||
"extensions": [ | ||
"James-Yu.latex-workshop" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "typeset", | ||
"type": "shell", | ||
"command": "xelatex", | ||
"args": [ | ||
"-synctex=1", | ||
"-interaction=nonstopmode", | ||
"typeset.tex" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,23 @@ | ||
用 LaTeX 排版技术书籍 | ||
===================== | ||
# 用 LaTeX 排版技术书籍 | ||
|
||
## PDF下载 | ||
|
||
<http://code.google.com/p/chenshuo/downloads/detail?name=typeset.pdf> | ||
|
||
以下说明由网友 Frank Dai (https://github.com/soulmachine) 编写。 | ||
|
||
## 在Windows下编译 | ||
1. 安装Tex Live 2015 <http://www.tug.org/texlive/>。把bin目录例如`D:\texlive\2015\bin\win32`加入PATH环境变量。 | ||
1. 安装字体。这个LaTex模板总共使用了10个字体,下载地址 <http://pan.baidu.com/s/1jIgyuRc> ,有的字体Windows自带了,有的字体Ubuntu自带了,但都不全,还是一次性安装完所有字体比较方便。 | ||
1. 安装TeXstudio <http://texstudio.sourceforge.net/> | ||
1. (可选)启动Tex Live Manager,更新所有已安装的软件包。 | ||
1. 配置TeXstudio。 | ||
|
||
启动Texstudio,选择 `Options-->Configure Texstudio-->Commands`,XeLaTex 设置为 `xelatex -synctex=1 -interaction=nonstopmode %.tex`; | ||
|
||
选择 `Options-->Configure Texstudio-->Build` | ||
|
||
Build & View 由默认的 PDF Chain 改为 Compile & View; | ||
|
||
Default Compiler 由默认的PdfLaTex 修改为 XeLaTex ; | ||
|
||
PDF Viewer 改为 “Internal PDF Viewer(windowed)”,这样预览时会弹出一个独立的窗口,这样比较方便。 | ||
|
||
1. 编译。用TeXstudio打开`typeset.tex`,点击界面上的绿色箭头就可以开始编译了。 | ||
|
||
在下方的窗口可以看到TeXstudio正在使用的编译命令是`xelatex -synctex=1 -interaction=nonstopmode "typeset".tex` | ||
|
||
## 在Ubuntu下编译 | ||
1. 安装Tex Live 2015 <http://www.tug.org/texlive/> | ||
|
||
1.1. 下载TexLive 2015 的ISO 光盘,地址 <http://www.tug.org/texlive/acquire-iso.html> | ||
|
||
1.2 mount 光盘,`sudo ./install-tl` 开始安装 | ||
|
||
1.3 加入环境变量 | ||
|
||
sudo vi /etc/profile | ||
export PATH=$PATH:/usr/local/texlive/2015/bin/x86_64-linux | ||
export MANPATH=$MANPATH:/usr/local/texlive/2015/texmf-dist/doc/man | ||
export INFPATH=$INFPATH:/usr/local/texlive/2015/texmf-dist/doc/info | ||
|
||
1. 安装字体。这个LaTex模板总共使用了10个字体,下载地址 <http://pan.baidu.com/s/1jIgyuRc> ,有的字体Windows自带了,有的字体Ubuntu自带了,但都不全,还是一次性安装完所有字体比较方便。 | ||
1. 安装TeXstudio <http://texstudio.sourceforge.net/> | ||
1. 配置TeXstudio。 | ||
|
||
启动Texstudio,选择 `Options-->Configure Texstudio-->Commands`,XeLaTex 设置为 `xelatex -synctex=1 -interaction=nonstopmode %.tex`; | ||
## 如何编译PDF | ||
|
||
选择 `Options-->Configure Texstudio-->Build` | ||
### 命令行编译 | ||
|
||
Build & View 由默认的 PDF Chain 改为 Compile & View; | ||
```bash | ||
docker run -it --rm -v $(pwd):/project -w /project soulmachine/texlive xelatex -interaction=nonstopmode typeset.tex | ||
``` | ||
|
||
Default Compiler 由默认的PdfLaTex 修改为 XeLaTex ; | ||
### vscode下编译 | ||
|
||
PDF Viewer 改为 “Internal PDF Viewer(windowed)”,这样预览时会弹出一个独立的窗口,这样比较方便。 | ||
本项目已经配置好了vscode devcontainer, 可以在 Windows, Linux 和 macOS 三大平台上编译。 | ||
|
||
1. 编译。用TeXstudio打开`typeset.tex`,点击界面上的绿色箭头就可以开始编译了。 | ||
用 vscode 打开本项目,选择右下角弹出的 `"Reopen in Container"`,就会在容器中打开本项目,该容器安装了 Tex Live 2022 以及所需要的10个字体。 | ||
|
||
在下方的窗口可以看到TeXstudio正在使用的编译命令是`xelatex -synctex=1 -interaction=nonstopmode "typeset".tex` | ||
1. 懒人版镜像。如果不想进行上面繁琐的安装过程,我做好了一个Ubuntu VMware虚拟机镜像,已经装好了 TexLive 2015, TexStudio和字体(详细的安装日志见压缩包注释),开箱即用,下载地址 <http://pan.baidu.com/s/1cLWkgA>。 | ||
点击vscode左下角的齿轮图标,选择 `Command Palette`,输入`tasks`, 选择 `Run Task`, 选择 `typeset`,即可启动编译。 |