Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Get productive with vimtex for LaTeX

Get productive with vimtex for LaTeX

Avatar for Matthias Günther

Matthias Günther

June 17, 2016
Tweet

More Decks by Matthias Günther

Other Decks in Technology

Transcript

  1. Benefits I PDF viewer of your choice MuPDF, Zathura, Okular,

    qpdfview or SumatraPDF continuous compilation
  2. Benefits II text-objects: ae … LaTeX environments (e.g. \begin{itemize}) ac

    … commands i$ … inline math structure a$ … whole math structure
  3. Benefits III motions and mappings: [[|]] … move to next/previous

    section % … move between matching delimeters dse|cse … delete/change the surrounding environment dsc|csc … delete/change the surrounding command
  4. Prerequisite I latexmk is a perl script that runs the

    desired/necessary LaTeX command the correct number of times to resolve cross references. grab the latest one 22 April 2016. Version 4.45
  5. Install latexmk $ cd /tmp $ wget http://users.phys.psu.edu/%7Ecollins/software/latexmk-jcc/latexmk-445.zip $ unzip

    latexmk*.zip $ sudo cp latexmk/latexmk.pl /usr/local/bin $ sudo mv /usr/local/bin/latexmk.pl /usr/local/bin/latexmk
  6. Install libsynctex #!/bin/bash cd /tmp && rm -rf libsynctex* if

    [ "$(uname -m)" == "x86_64" ] then wget http://de.archive.ubuntu.com/ubuntu/pool/main/t/texlive-bin/libsynctex1_2015.20160222.37495-1_amd64.deb wget http://de.archive.ubuntu.com/ubuntu/pool/main/t/texlive-bin/libsynctex-dev_2015.20160222.37495-1_amd64.deb else wget http://de.archive.ubuntu.com/ubuntu/pool/main/t/texlive-bin/libsynctex1_2015.20160222.37495-1_i386.deb wget http://de.archive.ubuntu.com/ubuntu/pool/main/t/texlive-bin/libsynctex-dev_2015.20160222.37495-1_i386.deb fi sudo dpkg -i libsynctex1* && sudo dpkg -i libsynctex-dev*
  7. Install girara and zathura #!/bin/bash GIRARA_VERSION=0.2.6 ZATHURA_VERSION=0.3.6 rm -rf /tmp/girara

    /tmp/zathura # otherwise the own girara compilation will not work sudo apt-get remove libgirara-dev # need for zathura compilation sudo apt-get install libmagic-dev cd /tmp && git clone https://git.pwmt.org/pwmt/girara.git cd girara && git checkout $GIRARA_VERSION && make && sudo make install cd /tmp && git clone https://git.pwmt.org/pwmt/zathura.git cd zathura && git checkout $ZATHURA_VERSION && make WITH_SYNCTEX=1 && sudo make install
  8. vimtex: Basics \ll|:VimtexCompileToggle: compile and it will open the pdf

    in your prefered pdf- viewer watch for latexmk compile: started continuous mode in the statusline
  9. vimtex: forward search \lv|:VimtexView: Open the generated PDF works with

    vim’s servername feature or with gvim/MacVim out of the box for zathura
  10. vimtex: backward search press <C-Click> on the PDF and you

    jump right to the place in the terminal. works with gvim/MacVim out of the box for zathura
  11. vimtex: Commands I :VimtexTocOpen|:VimtexTo cToggle: open a clickable toc in

    the left pane (q will close the window) :VimtexLabelsOpen|:Vimte xLabelsToggle: open table of labels.
  12. vimtex: Commands II :VimtexInfo: print basic information :VimtexCountWords|:Vimte xCountLetters: count

    the number of words/letters in the document. It will also show the number of math environments, and similar.
  13. vimtex: Commands III :VimtexCompileOutput: show the output form the compilation

    command (i.e. from latexmk) :VimtexClean: clean auxilliary files like *.aux, *.out, etc. Use :VimtexClean! to