• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

XuehaiPan/LaTeX-Templates: A collection of LaTeX templates in English/Chinese, w ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

XuehaiPan/LaTeX-Templates

开源软件地址(OpenSource Url):

https://github.com/XuehaiPan/LaTeX-Templates

开源编程语言(OpenSource Language):

TeX 99.7%

开源软件介绍(OpenSource Introduction):

LaTeX Templates

A collection of LaTeX templates in English / Chinese, with VS Code settings for LaTeX Workshop. (screenshots)

Table of Contents

Editor Preparation

1. Preliminaries

Download and install a TeX distribution (e.g., TeX Live) on your device.

Install TeX Live

Windows: download and invoke the TeX Live installer install-tl-windows.exe. Or install TeX Live using Chocolatey:

choco install texlive --params="'/scheme:full'"

macOS: install MacTeX using Homebrew:

brew install --cask mactex

Linux: manual installation:

wget -O - http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz |
    tar -xz --strip-components=1 --one-top-level=install-tl-unx &&
    cd install-tl-unx &&
    sudo ./install-tl

(Optional) Install dependencies for minted and latexindent

# Install Pygments for code highlighting with minted in LaTeX
pip3 install Pygments  # for Windows / macOS / Linux
brew install pygments  # for macOS

# Install dependencies for latexindent
cpan -i -T File::HomeDir Log::Log4perl Log::Dispatch::File \
        YAML::Tiny Unicode::GCString

2. Install VS Code and Extensions

Visual Studio Code is strongly recommended as the editor for LaTeX projects. You can download and install it from the official site at https://code.visualstudio.com.

Recommended extensions:

  • LaTeX Workshop: boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
  • LaTeX Utilities: An add-on to LaTeX Workshop that provides some fancy features.
  • Local History (optional): maintain local history of files.

You can find them in Visual Studio Code Marketplace (shortcut: Ctrl / Cmd + Shift + X).

3. Setup Editor for LaTeX Projects

# Clone this repository
git clone --depth=1 https://github.com/XuehaiPan/LaTeX-Templates.git

# Open the project with VS Code
code LaTeX-Templates

Then install recommended extensions in ".vscode/extensions.json", and copy the settings in ".vscode/settings.json" to your user settings. Refer to XuehaiPan/Dev-Setup/my-vscode-settings as a reference.

Usage

4. Compile and Preview with LaTeX Workshop

code --new-window Assignment   # open a template folder using VS Code

Open the main.tex file in a VS Code tab, then compile it with LaTeX-Workshop extension tool in the left panel, or use keyboard shortcut Ctrl / Cmd + Alt + B. See the wiki page of LaTeX-Workshop for more details about the extension features.

Some useful keyboard shortcuts (may be overridden by keymap settings):

  • View LaTeX PDF file (Ctrl / Cmd + Alt + V)

  • Build with last used recipe (Ctrl / Cmd + Alt + B)

  • Clean up auxiliary files* (Ctrl / Cmd + Alt + C)

  • SyncTeX from cursor in TeX file to PDF (Ctrl / Cmd + Alt + J)

  • SyncTeX from PDF to TeX file (hold the Ctrl / Cmd key and click on the PDF in the preview panel)

  • Format source files using latexindent (Ctrl / Cmd + Shift + I)

    * You don't need to do cleanup frequently, please do it only when necessary (e.g., on build failed). (Keep these auxiliary files can speed up the next compilation.)

* Manual Compilation

cd Assignment  # navigate to a template folder first

Compile with Latexmk (Recommended)

latexmk -xelatex -synctex=1 -shell-escape \
    -interaction=nonstopmode -file-line-error \
    -output-directory=out main
  • clean up auxiliary files*

    latexmk -c -output-directory=out
  • build and do cleanup if failed

    latexmk -xelatex -synctex=1 -shell-escape \
        -interaction=nonstopmode -file-line-error \
        -output-directory=out main ||
        latexmk -c -output-directory=out

Compile with XeLaTeX and Biber

Execute xelatex multiple times to resolve cross-references in the document.

# XeLaTeX ➞ Biber ➞ XeLaTeX × 2
xelatex -synctex=1 -shell-escape \
    -interaction=nonstopmode -file-line-error \
    -output-directory=out main
biber --output-directory=out main
xelatex -synctex=1 -shell-escape \
    -interaction=nonstopmode -file-line-error \
    -output-directory=out main
xelatex -synctex=1 -shell-escape \
    -interaction=nonstopmode -file-line-error \
    -output-directory=out main

Screenshots

Templates


Assignment Essay
Presentation NeurIPS 2021

Workspace


  • set "latex-workshop.view.pdf.viewer": "tab"

View PDF in a VS Code tab.

  • set "latex-workshop.view.pdf.viewer": "external" // or "browser"

View PDF in the external viewer or a web browser (for multi-monitor setup).




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap