# Highlighting and indenting

## Syntax highlighting

TeXlipse supports real time syntax highlighting for both LaTeX and BibTeX files.

### The LaTeX editor highlights the following entries:

- LaTeX-keywords, i.e. a slash followed by one or more letters
- LaTeX command symbols, i.e. a slash followed by one symbol (non-letter, 7-bit ascii symbol)
- Special characters, e.g. \
- Comments, i.e. from a % to the end of the current line
- Mathematical commands, e.g. sequences limited by \begin{equation}...\end{equation} or $...$
- Command arguments, i.e. a sequence following a command and limited by { and }
- Optional command arguments, i.e. a sequence following a command and limited by [ and ]
- Verbatim environments, e.g. sequences surrounded by \begin{verbatim} and \end{verbatim} or \begin{lstlisting} and \end{lstlisting}

### The BibTeX editor highlights the following entries:

- BibTeX entry keywords, e.g. @MISC, @BOOK
- Reference keys and field names, e.g. title, author, year
- Strings, e.g. numbers representing years, text delimited by " and "
- Special characters, i.e. # = and ,
- Comments, but only from a % to the end of the current line — not all that is counted as a BibTeX -comment

The user can determine her own syntax highlight colors for both LaTeX and BibTeX files on the Texlipse preferences page.

## Indenting

TeXlipse supports the indentation of different environments, for example:

    \begin{enumerate}
      \item a
      \item b
    \end{enumerate}

In this case the environment used is `enumerate`. Default environments that are indented are `list`, `enumerate` and `itemize`. Indentation can be done automatically while writing or the user can correct the indentation of the selected area by pressing `ctrl + i` or Latex > Correct Indentation from menubar.

The user can configure which environments she wants to have indented. This can be done on the Texlipse preferences page. The Preferences page contains a checkbox that can be used to determine whether indentation is active. The Preferences page also contains a text field where the width of the indentation can be changed. The environments to indent can be seen in a list. The user can add more LaTeX environments to be indented by clicking the New... button and writing the name of the new environment in the pop up dialog. Environments can be removed by selecting the environment to remove and clicking the Remove button.