My latex template
Four modes are provided within the template, specify using document class arguments
- Article mode:
\documentclass[article]{huangfusl-template} - Beamer mode:
\documentclass[beamer]{huangfusl-template} - Book mode:
\documentclass[book]{huangfusl-template} - Standalone mode:
\documentclass[standalone]{huangfusl-template}
- Abbreviation for single letter
\mathbb,\mathbf,\mathcal,\mathrmand\boldsymbol. - Abbreviation for some math operators.
- CJK support provided by
ctexpackage, usecnargument to enable,ento disable. \ssection,\ssubsectionand\ssubsubsectionto hide section numbering while keeps table of contents entry.- Produce PDF-A documents.
\rememberand\recallto repeat equations.ctheorem,clemma,cdefinition,cexample,cnotice,calgorithmenvironments provided bytcolorbox.- Asterisk version to disable numbering.
- Double asterisk version to disable numbering and hide title.
Packages automatically loaded:
listings: Code listingbiblatex: Bibliographytcolorbox: Colored boxescalligra: Calligraphy fontspgf: Plottingbooktabs: Better tablesalgorithm2e: Algorithms
- Pre-configured font, spacing, header and footer.
\subtitlecommand to set document subtitle.\articlefrontas shortcut for a title and toc page.\watermarkonand\watermarkoffto toggle watermark.
- Theme pre-configured and locked.
- Support for Présentation.app
- Pre-configured font, spacing, header and footer.
\watermarkonand\watermarkoffto toggle watermark.
Use version=<version> to specify the template version. Newer version of template is backward-compatible.
\documentclass[article, cn, version=2.0]{huangfusl-template}For changelog, refer to Releases
Before compiling any documents, simply add the path containing huangfusl-template.cls to TEXINPUTS environment variable.
export TEXINPUTS=/path-to-template//:Notice that XMP metadata will NOT be available if you don't use makefile. (PDF-A standard will still be met)
-
Copy or link
makefile.latex.templateto/usr/include. -
Edit
export TEXINPUTS = /opt/template//:line to match the path tohuangfusl-template.cls -
Create a
makefilein the project:TARGET = <file-to-compile-without-extension> include makefile.latex.template
-
Execute
make defaultto compile the document.
Use make help to check all the build targets and environment variable options.
The docker image contains the template itself, together with a full texlive installation. Using docker, one can achieve compiling .tex documents pure remotely on a docker host. It does not require the local machine to have texlive installed. However, as all texlive packages have been installed in the docker image, the size of image is kind of large (~5GB).
The workflow has been integrated into makefile process. Simply pass DOCKER=1 environment variable to switch to docker.
make default DOCKER=1Add env option to toolchain in settings.json:
{
"name": "XeLaTeX",
"command": "xelatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOCFILE%"
],
"env": {
"TEXINPUTS": "<path-to-template>//:"
}
}First configure makefile.latex.template, write a makefile. Add the following compile tools in latex-workshop.latex.tools section of settings.json.
{
"name": "Make",
"command": "make",
"args": [ "default" ]
}Add DOCKER=1 environment variable to use docker, add DOCKER_CONTEXT environment variable to switch context