Chktex For Mac

I have been using Overleaf, but will be building a powerful PC so I figure I should go back to running locally so I can get blazing fast compile. Download ChkTeX from chktex/. Untar the archive, e.g. Double-click it in the Finder, and move the resulting folder to a place of your liking (for example, /Applications/ChkTeX/ ). Open the Terminal application. In the Terminal 'cd' to the directory were.

Previously, I have written a poston how to write and compile LaTeX source code in Sublime Text. Now that I amfamiliar with Neovim, I want to do everything related to text editing insideNeovim. In this post, I would like to share how to configure Neovim for LaTeXediting and previewing.

Before we begin, you should make sure that you have installed the followingsoftwares and plugins.

  • TeX Distribution: TeX Live is preferred since it is bundled with the possible many tools you will ever need for writing LaTeX.
  • Auto-complete plugin: Since I use Neovim, so I recommend using deoplete.
  • Snippet Engine and snippet plugin: I recommend Ultisnips along with the many snippets provided by plugin vim-snippets.

Then we need to install the LaTeX plugin for Neovim.Vimtex is a great choice. To install it, wecan use vim-plug:

Auto-completion

In writing LaTeX source code, auto-completion is crucial for fast editing andimproves our efficiency dramatically. Vimtex supports completion for citations,labels (for figure, equation, table, section, etc.), commands, environments,packages and document classes and more. For more documentation on completion,see :h vimtex-completion.

Vimtex can work with several completion engines such as deoplete,YouCompleteMe, ncm2.Since I use deoplete for completion, I will just introduce how to configure itfor deoplete1. To make vimtex work with deoplete, add the following settingto your init.vim:

After that you should be able to use auto-completion.

How to quickly insert an environment?

Vimtex supports autocompletion through autocompletion engines such as deoplete.After configuring vimtex to use deoplete, you should be able to use the snippetprovided by Ultisnips2.

Ultisnips is a snippet engine, which usesvim-snippets to provide the actualsnippet for various file types. To insert an figure environment, type figin insert mode and press Tab.

To insert an enumerate environment, type enum in insert mode and pressTab. The complete list of snippets provided by vim-snippets can befound here.

How to close an environment?

After typing begin{ENV}, how do we automatically close it with end{ENV}?With vimtex, you can press ]] in insert mode to auto-close an environment.

Useful mappings and shortcuts

Vimtex provides the e text object to facilitatevim-surround like features formanipulating an environment quickly:

  • cse: change an environment
  • dse: delete an environment
  • tse:toggle stared environment and no-star environment, e.g., change fromequation* to equation and vice versa.

You can also use the standard Vim motion with this object. For example, viewill select the inside a environment, and vae will select the entireenvironment (including the begin and end part). D link dwm 156 driver for mac.

There are other shortcuts provided:

Mac
  • ]]: close an environment (only work in insert mode, in normal mode, itwill bring cursor to next subsection instead). After you have typedbegin{ENV}, use ]] to auto-close it with end{ENV}

For more mappings, see :h vimtex-default-mappings.

Jumping between references and the definition

It would be nice if we can jump to the definition of a label with the nativeVim shortcut Ctrl-]. You have to do several things.

First, you need to install a ctags executable. See here on howto install ctags.

Second, you need to install a plugin to manage tags file for you.vim-gutentags is a goodoption. It will update the tags file automatically once the source file hasbeen changed. To make gutentags work, you need to tell it where your projectroot is. The easiest way is to make your project a git repository.

Open the TeX source file again, the tags file should be created automatically.If the cursor is in ref{some_label}, you can press Ctrl + ] to go theposition where some_label is defined. BTW, to jump back, you can useCtrl-T.

Useful command

  • :VimtexInfo: show all relevant info about current LaTeX project.
  • :VimtexTocOpen: show table of contents window
  • :VimtexTocToggle: toggle table of contents window
  • :VimtexCompile: Compile the current LaTeX source file and opens the viewer after successful compilation.
  • :VimtexStop: Stop compilation for the current project.
  • :VimtexClean: clean auxiliary files generated in compliation process.

PDF previewing

Vimtex supports several PDF viewer based on the platform. On Windows,SumatraPDF is a goodchoice. Below is the settings needed for SumatraPDF to work as the defaultviewer for the compiled PDF files.

After the above settings, if you use :VimtexCompile command, the compiled PDFwill be opened in sumatraPDF automatically. If it does not show up, you canalso use :VimtexView to open the PDF manually.

On Mac, you can install Skim and use it as a PDF viewer. My current settingsfor previewing PDF on Mac is:

Click to see the code.

Linting and syntax checking

I use neomake for syntax checking. For LaTeX source file, neomake providesseveral makers:

Among the makers, lacheck and chktex are installed if you have installed TexLive. Proselint can be installed via pip:

Setting up table of contents

Vimtex can show a nice little table of contents window on the left side if youuse command VimtexTocOpen. By default, the lables in each section is alsoshown, which makes the TOC clutter with texts. We can customize TOC withfollowing settings:

For detailed meaning of the keys in the above dictionary, refer to :h g:vimtex_toc_config.

TeX directives

If you are compiling a LaTeX source file written in non-English character. Youmay want to use the TeX directive to specify the compiling program. Vimtexsupports two TeX directives: TeX root and TeX program. TeX programdirective is useful when we want to compile the LaTeX source code withxelatex instead of pdflatex. In order to compile your LaTeX source filewith xelatex, add the following directive to the first line of the sourcecode:

My complete settings for vimtex can be found here.

  • Setting up PDF viewer for Mac.
  • TeX directives provided by different programs.
  1. For configuring vimtex to work with other completion engines, please refer to :h vimtex-complete-auto. ↩︎

  2. See this post on how to configure Ultisnips for Neovim. ↩︎

May 14May 13May 12May 11May 10May 9May 8May 7May 6May 5May 4May 3May 2May 1Apr 30Apr 29Apr 28Apr 27Apr 26Apr 25Apr 24Apr 23Apr 22Apr 21Apr 20Apr 19Apr 18Apr 17Apr 16Apr 15Apr 14Apr 13Apr 12Apr 11Apr 10Apr 9Apr 8Apr 7Apr 6Apr 5Apr 4Apr 3Apr 2Apr 1Mar 31Mar 30Windows011121Mac100122Linux110010. SublimeLinter-chktexThis linter plugin for provides an interface to.It will be used with files that have use LaTeX (or LaTeXing) syntax. InstallationSublimeLinter must be installed in order to use this plugin.Please use to install the linter plugin.Before installing this plugin, ensure that chktex is installed on your system.ChkTeX is available on and comes with e.g. Starting with TeX Live 2011, and available for many platforms.If you are using a TeX distribution which does not include ChkTeX (for example MiKTeX) follow the instructions below to compile ChkTeX manually:.Make sure you don't have any.Install with the make and gcc compiler packages.Download and save in home directory of cygwin (default is C:cygwinhomeUSER).In the cygwin bash, run. Cd c:cd cygwin64/home/USERcd chktex-1.7.2configuremakemake install.The resulting chktex.exe along with cygwin1.dll should now be saved in a directory which is registered in the PATH environment variable (for example%MiKTeX Install%miktexbin is appropriate)Please make sure that the path to chktex is available to SublimeLinter.The docs cover. Settings.

SublimeLinter settings:. Linter settings:By default, SublimeLinter-chktex ignores Warning 22 (Comment displayed) and Warning 30 (Multiple spaces detected in output). It also sets Warning 16 (Mathmode is still on at end of LaTeX file) as an error.Additional settings for SublimeLinter-chktex:.

nowarn: A comma-separated list of warnings to ignore. erroron: A comma-separated list of warnings to output as errors.© 2020.