Skip to content

Command-Line Interface

To install for the first time, or update your installation of Texlish, run the following command (assuming you have NodeJS installed):

Terminal window
npm install -g texlish@latest

You can compile a .texlish file as follows:

Terminal window
# Compile to filename.tex and run pdflatex to make filename.pdf
texlish --pdf filename.texlish
# Compile to filename.tex and run xelatex to make filename.pdf
texlish --xe filename.texlish
# Compile to filename.tex and run lualatex to make filename.pdf
texlish --lua filename.texlish
# Compile to filename.tex and run latex to make filename.dvi
texlish --latex filename.texlish
# Just compile to filename.tex
texlish filename.texlish
# Override one compiler option for this run
texlish --config scriptGrouping=alpha filename.texlish
# Enable LaTeX-compat mode
texlish --config latexCompat filename.texlish
# Disable Markdown-compatible syntax
texlish --config -markdownCompat filename.texlish

When you use a LaTeX option such as --pdf, --xe, --lua, or --latex, Texlish runs a multi-pass LaTeX build. It runs BibTeX or Biber if needed, runs makeindex when an index changes, and reruns LaTeX if generated files such as .bbl, .toc, or cross-reference labels changed.

Texlish looks for a project config file in .config/, then in the current directory, named one of:

  • texlishconfig.yaml, texlishconfig.yml, texlishconfig.json, texlishconfig.js, texlishconfig.mjs, or texlishconfig.cjs
  • texlish.config.yaml, texlish.config.yml, texlish.config.json, texlish.config.js, texlish.config.mjs, or texlish.config.cjs

YAML config example:

colonCommands: true
colonEnvironments: true
citeShorthand: true
latexCompat: false
markdownCompat: true
markdownBackticks: 3
markdownBlockquotes: true
markdownEmphasis: true
markdownFootnotes: true
markdownHeadings: true
markdownHorizontalRules: true
markdownImages: true
markdownLinks: true
markdownLists: true
markdownStrikethrough: true
refShorthand: true
scriptGrouping: alphanumeric
scriptParens: true
smartQuotes: true
quotes:
'"':
open: "``"
close: "''"
styles:
"*": "\\textit"

You can also override config options in individual .texlish files using ::config directives.

Our VSCode plugin provides the following features in .texlish files:

  • Syntax highlighting
  • Automatic indentation after \command:, : environment, ::special