Skip to content
Thomas edited this page Oct 16, 2020 · 28 revisions

Unsupported Unicode character

This inspections highlights Unicode characters which are likely to cause incorrect output if you have not explicitly chosen the right packages and compiler.

In general, you should use LuaLaTeX or XeLaTeX when working with Unicode characters.

An example file which uses Unicode characters and is compilable with LuaLaTeX:

\documentclass{article}

% For this document you may need the following (texlive) packages: luatex luaotfload fontspec babel-greek greek-fontenc gfsporson

\usepackage[no-math]{fontspec}

\usepackage[main=english,greek]{babel}
\languageattribute{greek}{ancient}

\newfontfamily\greekfont{GFS Porson}[Ligatures=TeX,%
ItalicFont = GFSPorson-Regular,%
SmallCapsFont = GFSPorson-Regular]

\addto\extrasgreek{\greekfont}

\newcommand\textgreek[1]{\foreignlanguage{greek}{#1}}

\begin{document}
    English and \textgreek{ελληνικά} and {\greekfont πιο ελληνικό}
\end{document}

Another example, tested with XeLaTeX:

\documentclass{article}
\usepackage{fontspec}

% Download from https://www.fontsquirrel.com/fonts/computer-modern and put ttf files in /usr/share/fonts/TTF
\setmainfont{CMU Serif}

\begin{document}
    This is a paragraph with a PI (π) in it, which looks different than a $\pi$.
\end{document}

Quick fixes

Escape Unicode character

In some cases, there is a plain LaTeX equivalent available. This will change for example ö into \"o.

Note that since TeX Live 2018 this is unnecessary: UTF-8 is assumed as the default input encoding (source: https://tex.stackexchange.com/a/370280/98850).

Include Unicode support packages

This will load

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

Note that since TeX Live 2018 loading inputenc does not solve anything: UTF-8 is assumed as the default input encoding (source: https://tex.stackexchange.com/a/370280/98850).

Also note that in general it is better to use \usepackage[T1]{fontenc}, see https://tex.stackexchange.com/questions/664/why-should-i-use-usepackaget1fontenc

Change compiler compatibility

File argument should not include the extension

Some commands with which you include files, especially \bibliography and \include, should not include the file extension. For example if you want to include a file section1.tex, then \include{section1.tex} will not work.

File argument should include the extension

Some commands with which you include files, especially \addbibresource, should include the file extension. For example if you want to include a bibliography in references.bib then \addbibresource{references} will not work, but \addbibresource{references.bib} will.

Missing documentclass

A LaTeX file that is the root of a document should contain a \documentclass{…​}.

This inspection is off by default.

Missing document environment

A LaTeX file that is the root of a document should contain a document environment.

This inspection is off by default.

Package is not installed

Since b0.6.9

This inspection is for TeX Live only, MiKTeX automatically installs packages on the fly. When using \usepackage or \RequirePackage, TeXiFy checks if the packages is installed. If it isn’t installed, it provides a quick fix to install the package.

Package may not exist

When using \usepackage or \RequirePackage, we check if the package exists. To do this, we check the project for use defined packages, and we check a list of all available CTAN packages. This list of CTAN packages is manually updated by us, and might be out of date.

Package name does not match file name

Since b0.6.10

The package name given in a \ProvidesPackage command does not match the name of the sty file the command is in. This inspection provides a quick fix to fix the package name.

Package name does not contain the correct path

Since b0.6.10

The package name given in a \ProvidesPackage command does not contain the correct path of the sty file. This package name should include the path relative to the main file where the package is used. This inspection provides a quick fix to fix the path in the package name.

Missing imports

For some common commands TeXiFy knows which package is needed to use them. A quickfix is available to add the missing \usepackage or \RequirePackage command. For more information, see Automagically import packages of common commands.

Note that if TeXiFy complains incorrectly that you did not import the package, you may need to tell TeXiFy which file is your root file, see Magic comments.

Unescaped #, & and _ symbol

Since b0.6.10

When using a # symbol outside of a command definition, an & outside a tabular environment or a _ anywhere, it should be escaped with a backslash, like \&.

Unresolved references

Non matching environment commands

Open if-then-else control sequence

File not found

If a Latex command takes a path argument TeXiFy checks wether the file or path exists and throws an error if not.

Absolute path not allowed

With some special commands absolute paths are not allowed. E.g. \include and \includeonly. A error is thrown if you still enter an absolute path.

Inclusion loops

When two files include each other, this will be detected. On one of the inclusions a warning will be shown.

Nested includes

Label is before caption

A label command in an environment (e.g., a figure or table environment) should go after the caption. This inspection shows a weak warning when the order is the wrong way around, and a quickfix is available to swap the commands.

Currently this inspection will only trigger when the label and caption are directly next to each other (only whitespace inbetween).

This documentation has moved to https://hannah-sten.github.io/TeXiFy-IDEA

Clone this wiki locally