Troubleshooting
If you run into troubles while using TeXiFy, you can try the following things.
If you have problems with installation, make sure you followed the installation guide.
Search this wiki using the search bar in the top right corner.
Search through the GitHub issues to find similar problems, and if your issue has already been resolved
Look through the list of common problems at this page
Ask for help at gitter
Debugging performance issues
If you are experiencing UI freezes, IntelliJ will generate a thread dump, please upload this file as well.
For any performance issue: if you do not have a favourite profiler yet, you can use VisualVM. Install it using your package manager or go to https://visualvm.github.io
First, just run TeXiFy like usual.
Start VisualVM.
In the Applications panel on the left, identify the instance of IntelliJ where TeXiFy is running, probably it is named Idea. Right-click on it and open.
Go to the Sampler tab.
Click Settings, and click Profile only packages. Specify
nl.hannahsten.**
(or a specific class you want to filter on. Note that if you want to filter for a Kotlin class you have to appendKt
to the class name, e.g.nl.hannahsten.texifyidea.editor.UpDownAutoBracketKt
. However, not all classes will appear in the view.)Click CPU to start profiling
Reproduce the performance issue
Stop the profiling
Take a Snapshot to view and save results. Note that you may have to click a few more levels open to see the actual methods.
Now you can zip the nps file and upload it here on GitHub.
Main file is not detected correctly
If TeXiFy does not detect which file is your main/root LaTeX file, you may experience problems like package imports being placed in the wrong file, or imports not being resolved correctly. If this is the case, please report a GitHub issue. Until the problem is fixed, you can use a Magic comment as a workaround.
Known parser issues
TeXiFy relies on a lexer and parser for most of its functionality. The parser is relatively strict, and it will not accept all valid LaTeX. This has the advantage that it is relatively easy to implement features which make use of this imposed structure, but you will always be able to create cases of valid LaTeX which break TeXiFy. We intend to make the parser such that it will accept almost all LaTeX that we think is well-structured and readable.
If you do encounter a parse error that you think is incorrect, please raise an issue. As a workaround, if you want to keep syntax highlighting for that part you can use magic comments to disable the formatter (see Code formatting) to avoid it incorrectly formatting your file:
If you are fine without the syntax highlighting for that part, you can disable the parser entirely (see Magic comments). This will ensure that TeXiFy completely ignores this part of the code, and other parts should remain working fine.
Examples of known parser bugs
We have two \begin
commands but only one \end
command, so the parser will be confused. (#2141) Since it isn’t clear which \begin
should be matched with the \end
, ideally it wouldn’t try to match them at all. But the only reason this is valid LaTeX at all is the \if
, and whether we need to match depends on many things, for example whether the \end
is inside the \if
or not.
A similar example is using the before
and after
parameters of setlist
,
In this case, it may be rewritten to something that can be parsed by TeXiFy, for example,
Pasting images and tables into LaTeX
If you drag and drop an image file into a LaTeX file, or paste an image or table from your clipboard, TeXiFy will start a wizard to help you inserting the image or table into your document. See Insert Graphics wizard and Table Creation Wizard for starting these wizards manually.
Pasting images from the clipboard
Since b0.7.3
You can paste images from your clipboard directly into your LaTeX document. When pasting, you will be prompted by a dialog for saving the image to your workspace. The default folder is "resources", then any source root that is not "src/source(s)", then the source root itself. You can customize the location where the image is going to be saved. You can also specify the file name and the format ("jpg" and "png") are supported. Other formats get converted to "jpg" or "png".
An Insert Graphic dialog will be opened immediately after saving the pasted image.
The equation/TikZ preview is not working
Make sure you have installed the dependencies as described in the Preview page.
If that doesn’t help and you can run Kotlin programs, you can run the program below and report the output in your (new) issue.
+++ <details><summary> +++ preview.kt
+++ </summary><div> +++
+++ </div></details> +++
Error running 'main': Cannot run program "pdflatex"
Make sure you have followed all the installation instructions at https://github.com/Ruben-Sten/TeXiFy-IDEA#installation-instructions-installing-intellij-and-the-texify-idea-plugin
Check if
pdflatex
is properly installed by running in a terminal or command promptpdflatex -v
. Probably this is not the case. If it is the case, then for some reason pdflatex cannot run. Test this withpdflatex small2e
in a location where you have write access.Check if
pdflatex
is installed: if you have MikTeX start the MikTeX console and check that thepdftex
package is installed. If you have TeX Live, check withtlmgr install pdftex
.If so, make sure you have logged in and out to complete the installation of LaTeX, and especially with TeX Live make sure that TeX Live is added to your PATH.
Make sure you did install MikTeX or TeX Live for your user only, so not for all users. If not, uninstall, install the right way and reboot.
If you are on Windows or Mac and installing MikTeX, you can also try installing TeX Live instead.
Ask on https://tex.stackexchange.com, providing as much details as possible (at least operating system, results of the tests of the first step, any attempts to solve it).
What should my document structure look like?
In general you have a main file which contains the documentclass and the document environment (the \begin{document}
and \end{document}
). From here you can include other files which can then include even more files and so on. An example is:
where the files introduction.tex
and example-theorems.tex
contain just the content, for example these could be the complete file contents of introduction.tex
:
I have an error which complains about openout_any = p
When you get during compilation the error
or
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. This is a TeX Live security setting which you can change by editing /path/to/texlive/2019/texmf-dist/web2c/texmf.cnf
and changing openout_any = p
to openout_any = a
.
My index is not generated correctly
If you have TeXiFy version 0.6.7 or later, make sure that makeindex is run by TeXiFy, so you should see a run window called makeindex with the output. See Makeindex.
Version 0.6.6 or older
Note that you have to disable both the auxil/
(in case of MiKTeX) and out/
directories in the run configuration, otherwise the .idx
file will not be found by the index package.
In general we would recommend using the imakeidx
package like below, but equivalent index packages should also work.
Example:
How can I set-up shortcuts for e.g. \emph{} or the itemize environment?
You can define a live template via itemize
environment, you could use the following template:
Set the template to be applicable in LaTeX files. Also see https://github.com/Hannah-Sten/TeXiFy-IDEA/wiki/Live-templates
Once the live template is created, close the Settings dialog. Use Ctrl + Alt + Shift + I.
, assign the macro a key binding such asNow, you can use the macro key binding and hit Enter to insert a new itemize
environment with an item. The cursor will automatically move to the first \item
.
For commands, you can define templates for e.g. \emph{$PARM1$}
.