# Hannah-Sten/TeXiFy-IDEA

LaTeX support for the IntelliJ platform by JetBrains.
Kotlin Java HTML Other
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
doc
gen/nl/hannahsten/texifyidea
lib
resources
scripts
src
test/nl/hannahsten/texifyidea
.gitignore
.travis.yml
CONTRIBUTING.md

# TeXiFy-IDEA

LaTeX support for the IntelliJ Platform by JetBrains.

No idea where to start? Have a look at the installation instructions. Otherwise, take a look at the tips instead.

Create the most beautiful LaTeX documents with the user friendliness of the IntelliJ platform. This plugin adds the tools to make creating LaTeX documents a breeze. We are currently doing our best to develop the plugin

## Feedback and support

You can share new ideas/feature requests/bugs/calls for help in multiple ways:

1. Live chat via gitter (you can login with your GitHub account). Gitter also has a nice app, we use it to get notified of new activity.
2. Issues. These may be bug reports, feature requests, user support, etc. Just generally anything you have a problem with/suggestion for. For general feedback we advice using the gitter.

Please bear in mind that this is just a side project for us. It might take a while to fully process your feedback. We try our best :3

## Contributing

We would love it if you want to contribute to this project! Please have a look at the contributing guidelines to get started.

## Features

• Syntax highlighting
• Autocomplete of labels, (custom defined) commands and environments
• Writer ergonomics - writing LaTeX made less cumbersome
• Compiler support for pdfLaTeX, LuaTeX, Latexmk, texliveonfly, XeLaTeX, bibtex, and biber
• Inspections. Intentions. And heaps more inspections
• Full BibTeX support
• Formatter for LaTeX and BibTeX
• Structure view for LaTeX and BibTeX with filters
• Code folding for imports, sections, and environments
• SumatraPDF (Windows) and Evince (Linux) support with forward and backward search
• Smart Quotes
• Unicode math preview
• Equation preview
• Gutter icons for quick compilation and file includes
• Fancy icons that fit in with the IntelliJ style
• Brace matching
• Word counting tool
• File templates for .tex, .sty, .cls and .bib files
• Automagically import packages of common commands
• Go to declaration of labels
• Shortcuts for styling text
• Line commenter
• Support for user-created document classes and packages
• Toggle star action
• Words of encouragement

A more extensive (but not complete) list can be found in the Wiki.

## Installation instructions: installing IntelliJ and the TeXiFy-IDEA plugin

### Installation instructions for Windows

These instructions were tested on Windows 7, 8.1 and 10.

• If you don't have the latest version yet, download and install IntelliJ IDEA, the Community edition is free. You may want to install the Jetbrains toolbox instead, so you can manage projects and editors easily (Jetbrains has editors for more programming languages as well).
• Download and install LaTeX for Windows. During installation, choose the option Install missing packages on the fly: yes.
• Open IntelliJ, in the welcome menu choose Configure - Plugins (or when you already have a project open, use File - Settings - Plugins).
• Search for texify, click search in repositories and click install.
• Restart your pc to finish the LaTeX and the plugin installations.
• Click on Create New Project (in welcome menu) or File - New - Project, select LaTeX in the left column and click next. Specify a name for your project, and a location. A project can contain multiple LaTeX files, so for example if you make a new document for each new homework you get, place them all in the same project.
• Double-click or click on the arrow next to your project name on the left to open the directory.
• A standard document is already made for you, you can find it in the src folder. This folder will contain all your LaTeX. Double-click on the .tex file to open it. If you cannot see any directory structure (the folders on the left side), hit Project (it's written on its side) on the left of your screen.
• Type some text between the \begin{document} and \end{document} lines, hit the compile icon next to the \begin{document} line and click Run, or use Ctrl+Shift+F10. If you see a pdf appearing, congratulations!
• If you see LaTeX error: file a4.sty not found then you did not restart your pc. Do it now.
• The next time you can also compile using the Run button (looks like a Play button) in the top-right menu, or using Shift+F10 on Windows.

#### Configuring forward and inverse search

• When your cursor is in IntelliJ and you have just compiled a document, you can look up which line in the pdf corresponds to the line your cursor is at by going in IntelliJ to the Tools - LaTeX menu in the top menu bar and clicking SumatraPDF - Go to line in PDF, or using the shortcut which is listed there. This shortcut can also be used to bring the SumatraPDF window in view when you do not see it.
• If you don't see a SumatraPDF option, reboot your computer.
• You can also do the reverse: you have to configure it once by clicking Tools - LaTeX - SumatraPDF - Configure inverse search. Then double-click in SumatraPDF in a pdf you just compiled, and it should make your cursor go to the correct location in IntelliJ.
• Have a look at the tips.

### Installation instructions for linux

These instructions were tested on at least Ubuntu 16.04, 18.04, Fedora and Arch Linux.

• If you don't have the latest version yet, download and install IntelliJ IDEA, the Community edition is free. You may want to use the Jetbrains toolbox instead, so you can manage projects and editors easily (Jetbrains has editors for more programming languages as well). Download and save the .tar.gz file to your Downloads folder.
• You can extract in your Downloads folder with, in case you downloaded IntelliJ, (change the exactly version number to the correct one, you can use tab for autocompletion) sudo tar xf ideaIU-2018.1.5.tar.gz -C /opt/, then run /opt/idea-IU-181.5281.24/bin/idea.sh, or in case you downloaded the toolbox, sudo tar xf jetbrains-toolbox-1.11.4269.tar.gz -C /opt/ and run /opt/jetbrains-toolbox-1.11.4269/jetbrains-toolbox, then install IntelliJ.
• To install LaTeX, you can use the TeX Live distribution. If something is already installed, check that the version is at least 2017 with latex --version. If not, for example if you are on Ubuntu 16.04, you have to first remove the old TeX Live (see for example these steps) and then install a newer TeX Live (based on the LaTeX3 setup):
• Run in your Downloads directory sudo wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
• sudo tar -xzf install-tl-unx.tar.gz
• sudo install-tl-20*/install-tl -scheme scheme-basic

#### The Equation Preview does not work

Make sure you have installed the dependencies, instructions are in the Equation Preview section.

#### makeindex or bibtex not writing to file (openout_any = p)

When you get during compilation the error

makeindex: Not writing to /path/to/project/latexfile.ind (openout_any = p).
Can't create output index file /path/to/project/latexfile.ind.


or

bibtex: Not writing to ../out/latexfile.blg (openout_any = p).


this probably happens because you are trying to use makeindex or bibtex with a separate output directory. You should either disable the out directory in the run config or change the security setting in texmf.cnf, see this tex.stackexchange.com answer.

#### How to integrate a latex compiler other than pdflatex:

Most tex distributions contain a commandline tool called arara. Arara uses a small configuration in your main *.tex file

For example:

 % arara: lualatex: {shell: yes,  action: nonstopmode}
% arara: biber
% arara: lualatex: {shell: yes,  action: nonstopmode}


when you add these small code snippets and call

arara -v yourFavoritTexFileHere.tex


Arara calls lualatex biber and lualatex again. Any Jetbrains IDE allows you to add something they call "tools". There you can add the arara call and add a shortcut. Arara pipes the full output from all subsequent commands, which is not all the time usefull to find errors. So I put the arara call into a small bash script and add a grep filter.

#!/usr/bin/env bash

arara thesis.tex -v | grep -C 1 -E "((E|e)rror|ERROR|SUCCESS|FAILURE|Undefined control sequence)"

##### Alternative for integrating a latex compiler other than pdflatex:

In your run configuration, tick the box select custom compiler executable path (required on Mac OS X). You can now provide the path to any latex compiler. When using Windows and MiKTeX, these executables are located in

C:\Program Files\MiKTeX 2.9\miktex\bin\x64


or (in some cases)

C:\Users\user\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64


For example, to use lualatex:

C:\Program Files\MiKTeX 2.9\miktex\bin\x64\lualatex.exe


You can run this run configuration by pressing Shift+F10 (on Windows), by clicking the play button, or by clicking the gutter icon.

#### Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine"

If you get this warning, it is not critical so you could ignore it but to solve it you can install the mentioned gtk engine, in this case Murrine. For example on Arch Linux, install the gtk-engine-murrine package. Arch Linux sets the default theme to Adwaita, so install that with the gnome-themes-extra package. For more information see wiki.archlinux.org.

#### Unable to find method 'sun.misc.Unsafe.defineClass' or Please provide the path to the Android SDK when syncing Gradle

This probably means your Gradle cache is corrupt, delete (on Windows) C:\Users\username\.gradle\caches and C:\Users\username\.gradle\wrapper\dists or (on Linux) ~/.gradle/caches and ~/.gradle/wrapper/dists, then reboot your system.

#### Error: java: package com.google.common.base does not exist

• Update IntelliJ (help - check for updates).
• Update your IntelliJ SDK: go to Project Structure - SDKs.
• Hit the plus in the middle column and select IntelliJ Platform Plugin SDK.
• Select your IntelliJ installation directory (e.g. C:\Program Files (x86)\JetBrains\IntelliJ IDEA xxxx.x).
• Remove your old SDK. It is called 'IntelliJ IDEA IU-xxx' where xxx is anything but the highest number.
• Go to Project Structure - Project and select the new SDK.
You can’t perform that action at this time.