Autocompleting commands while typing in Texifier macOS
This article concerns the
See other variants:

Texifier has an advanced and configurable autocomplete system capable of autocompleting straightforward commands, autofilling the \ref,\cite and \begin families of commands, and autocompleting custom commands and environments defined via \newcommand and \newenvironment macros.

Command autocompletion

Type a standard LaTeX command and a small window will appear next to the cursor with a list of possible completions, and information about the highlighted entry at the bottom of the autocomplete list. You can accept an autocomplete with the Tab key, and dismiss the autocomplete window with the Escape key. Up and down keys will change the selected autocomplete. You can disable autocomplete entirely with the Auto Completion option in the preferences window.


Autofill command parameters

When typing commands with parameters such as \cite{}, \ref{} and \begin{}, Texifier will not only help complete the command itself, it will also fill the argument, known as autofill.

Texifier will parse any BibTeX or LaTeX files in your project, looking for \labels, \bibitems and .bib file entries. If you type one of the \ref{ family of commands Texifier will offer all known labels as possible completions.

Texifier knows many other autofills beside these, for example, it will autofill \bibliographystyle{ commands, \usepackage{ and \begin{ commands, amongst many others.

Automatching blocks

If you insert a \begin{ command from autocomplete and there is no matching \end{ command, Texifier will insert one. Texifier will also generate a matching

\end{some environment}

every time you press return on a line with

\begin{some environment}

This behaviour can be enabled or disabled with the Automatch \begin with \end option in the Preferences window.

Auto Indent

When you press return, Texifier will insert an equivalent amount of whitespace as there is at the beginning of the current line. This behaviour can be enabled or disabled with the Auto Indent option in the preferences window.

Auto itemise

In certain types of environment, e.g. the itemize and enumerate environments, Texifier will insert an \item command every time you press return on a line containing an \item command

Configuring Autocomplete

Custom Autocomplete commands are stored in the autocompleted_commands.txt file inside Texifier’s Application Support directory. You can open this file in Texifier by clicking the Add/Edit autocompleted commands… menu item in the Texifier menu. Once you have changed this file you must reboot Texifier for the changes to take effect.

This file consists of lines that are either a comment, and autocomplete command or an autofill identity. Their syntax is explained below.


The first non-whitespace character in the line should be a % symbol. E.g.

% This is a comment line


A line that describes a custom autocomplete. This consists of four parts, the first mandatory, the second, third and fourth optional.


The first entry should be the autocomplete key. For a regular command this should simply be the command without the preceding slash, e.g. for \documentclass write documentclass.

For an autofill autocomplete (e.g. \begin{someenvironment} or \documentclass{article}), write the first stage, followed by a colon, followed by the autocomplete. e.g. begin:someenvironment or documentclass:article.

Autocompletes will always be sorted alphabetically, but some autocompletes are more commonly used than others and there may be one you wish to prioritise over others. To prioritise an autocomplete, prepend a stars to the key, the more stars, the higher the priority. For example to prioritise \documentstyle so that it is selected by default instead of \documentclass, add an entry beginning ***documentstyle. In the case of an autofill complete, place the stars after the colon.


To add a description, append a | character followed by the description. This description is presented to you in the autocomplete menu when typing the command in the editor.

Files it is defined in

To note the file the command has been defined in, write an @ character followed by a comma separated list of files.

Files it is redefined in

To note the files the command has been redefined in, write an @@ followed by a comma separated list of files.

An example of a simple \documentclass command with no description is


An example of an environment with a full description is

begin:*fake | description here @ a.tex @@ b.cls, c.sty


Texifier’s autocomplete is capable of leaving placeholders in the text. These show as blue badges, and when there are placeholders in the editor, pressing tab will jump between them. This accelerates inserting commands, and filling out the arguments.

To create custom placeholders, please add the command and any arguments as an E.g.. For example, a single placeholder can be inserted as follows.

somecommand | Some example command E.g. \somecommand{argument}

And you can insert multiple placeholders the same way

frac | Fraction in math mode E.g. \frac{numerator}{denominator}

Autofill identity

In many cases different commands are autofilled in the same way. For example, begin and end are autofilled identically. To save you entering the options all again, you can add an autofill identity between, for this example begin and end. This should begin with an =, followed by the new autofilled command, followed by a colon, followed by a fully defined autofilled command (not another identity). There should be no whitespace at all on the line. To return to the begin and end example, where the autofills have been defined for begin, you would write.


This is useful if you have defined a custom referencing command. You could write


Texifier would autofill when you type \customref{.