1. Configuring TeXstudio

Before using TeXstudio, you should configure the editor and latex related commands via the "Configure TeXstudio" command in the "Options" menu ("Preferences" under Mac OS X). Note that there are two levels of detail. More advanced or less often used options are only visible if you toggle "Show advanced options" in the lower left corner.

1.1 Configuring the editor

You may change the default encoding for new files ("Configure TeXstudio" -> "Editor" -> "Editor Font Encoding") if you don't want utf8 as encoding. Don't forget to set the same encoding in the preamble of your documents. (e.g. \usepackage[utf8]{inputenc}, if you use utf-8).
TeXstudio can auto detect utf-8 and latin1 encoded files, but if you use a different encoding in your existing documents you have to specify it in the configuration dialog before opening them. (and then you also have to disable the auto detection)

• "Folding" toggles the editors code-folding capability (hide sections of the text).
• The selection box "Indentation mode" lets you select, wether indented lines are followed by lines of the same indentation after pressing Enter or letting TeXstudio do automatic indentation.

1.2 Configuring the latex related commands

LaTeX comes with a number of command line tools to compile and manipulate LaTeX documents. The commands section defines there location and arguments.

The default settings should work with the recent and standard LaTeX distributions, but you could have to modify them ("Configure TeXstudio" -> "Commands"). To change a command, just click on the button at the end of the corresponding line and select the command in the file browser : TeXstudio will automatically adapt the syntax of the command.

You can use a number of special characters / character sequences to address the context of the current document. They are expanded at runtime:
Special CharacterExpands to
%filename of the root document for of current document without extension
@current line number
? followed by further charactersSee the instruction at the bottom of the configuration dialog.
[txs-app-dir]Location of the TeXstudio executable (useful for portable settings)
[txs-settings-dir]Location of the settings file (texstudio.ini)

The section Forward/Inverse search gives some example commands for common viewers.

You can always restore the original settings using the revert button to the right.

1.3 Configuring the build system

TeXstudio provides general commands for translating latex.
The default settings use "pdflatex" and the internal pdf viewer. Other commands and viewer can be selected as well as a different bibliography translator.
The "embedded pdf viewer" does not open a new window for viewing the pdf document but presents it directly next to the text in the editor.
A useful alternative might be using the "latexmk" as compile command (if the command is installed on your system), as it handles dependencies with biblatex and index very well.
The advanced options allows finer customization which is in general not necessary.

User commands can be defined here by "adding" them. Each user command has a name with a pattern <command id>:<display name>, e.g. user0:User Command 0. The command id has to be unique and must not contain spaces. In advanced mode, you can reference it using txs:///"<command id>. The display name will be shown in the tools menu. The user commands can be activated either by short cut (alt+shift+F%n) or by the tools menu (Tools/User).
User commands can either consist of a combination of known commands by selecting them from a list of available commands. This is triggered by clicking the spanner-symbol.
Alternatively a command can be directly selected through the file system.

1.3.1 Advanced configuration of the build system

If you enable the advanced options, you can configure the build system in more detail.

Every txs-command is a list of external programs/latex-commands and other txs-commands to call. An external program can be called with its usual command line, while a txs-command with id "foobar" is called by txs:///foobar.
The commands in the list are separated by |, which is just a separator (i.e. it will not pass the stdout from one program to the stdin of the next).

Each of these txs-command has a unique id, which is shown as tooltip of the displayed name for "normal" commands and in the edit box for user commands. Some important commands are usual: txs:///quick (Build & View, the old quickbuild), txs:///compile (Default compiler), txs:///view (Default viewer), txs:///latex (latex), txs:///pdflatex (pdflatex), txs:///view-pdf (Default Pdf Viewer), txs:///view-pdf-external (External pdf viewer).

For example, in a typical build configuration you might call txs:///quick by pressing F1, which calls txs:///compile, which first calls txs:///pdflatex that calls the actual pdflatey, and then calls txs:///view, which calls txs:///view-pdf, which calls txs:///view-pdf-internal, which displays the pdf.

There is no difference between commands defined as command on the command config page, commands defined as build on the build config page, or commands defined as user commands. They are just separated in the GUI to simplify the interface.
This also means that you can change every command as you want, ignoring its old definition (you could even change its id, when editing the ini file.).

There are however three always defined internal commands, which can only be called and not modified:

 txs:///internal-pdf-viewer Opens the internal viewer for the current document txs:///view-log Views the log file for the current document txs:///conditionally-recompile-bibliography Checks if the bib files have been modified, and calls txs:///recompile-bibliography, iff that is the case

The internal pdf viewer also accepts the following options (txs:///internal-pdf-viewer) to modify its behaviour:

 --embedded Opens the viewer embedded --windowed Opens the viewer windowed (default if no option is given) --close-(all|windowed|embedded) Close all open viewers, or just viewers of a specific kind --preserve-existing Does not change any existing viewers (i.e. always opens a new one) --preserve-(embedded|windowed) Does not change any existing embedded/windowed viewers --preserve-duplicates Only opens the pdf in the first opened viewer --(no-)auto-close Determines whether the viewer should be closed, when the corresponding tex file is closed (default: auto-close iff embedded) --(no-)focus Determines whether the viewer should be focused (default: focus iff windowed) --(no-)foreground Determines whether the viewer should be brought to front (default: foreground) filename Determines the file to open. Like in other commands, file patterns are supported. If this parameter is not provided, TXS uses "?am.pdf", i.e. the absolute path of the main file. If the parameter is not an absolute filename, it is searched for in the directory of the main file as well as in Options -> Build -> Build Options -> Additional Serach Paths -> PDF Files

It is also possible to modify the arguments of called subcommands with argument modifiers or by adding a new argument . These modifiers are passed through called lists, so it will always change the arguments of the finally called program, even if the directly called subcommand is just a wrapper around another command:

 txs:///foobar --xyz This will add the xyz option txs:///foobar[--xyz=123] This will change the value of the xyz option to 123 (i.e. removing any xyz option defined in foobar) txs:///foobar{--xyz=123} This will remove --xyz=123 from the foobar command line, ignoring xyz options with other values txs:///foobar{--xyz} This will remove any --xyz option from the foobar command line, regardless of its value txs:///foobar{} This will remove all options from the foobar command line, leaving only the name of the executable

Finally, there are also hidden options, which can only be changed by modifing the ini-file: Tools/Kind/LaTeX, Tools/Kind/Rerunnable, Tools/Kind/Pdf, Tools/Kind/Stdout, Tools/Kind/Viewer, which give a list of commands that are treated as latex compiler (e.g. show the log afterwards), rerunnable (repeat command call, if there are warnings), pdf generators (e.g. pdflatex), commands that prints to stdout (e.g. bibtex), and viewers (e.g. only open once).

1.3.2 Details of the execution environment

Environment Variables

The environment variables available within the execution are the same as the ones that are available in the context in which TeXstudio was started. In particular this is true for the PATH. On Linux/OS X the PATH may depend on the way you started TeXstudio. Programs started from the GUI may have a different PATH setting than programs started from a shell (because some variables may only defined in the context of a shell (e.g. via ~/.bashrc).


<sequence id="python/number" format="python:number">[0-9]+</sequence>

<list id="python/keyword" format="python:keyword">
<word>return</word>
<word>if</word>
<word>elif</word>
<word>else</word>
</list>
</QNFA>


python.qxf

<!DOCTYPE QXF>
<QXF version="1.0" >
<!-- full specification -->
<format id="python:keyword" >
<bold>false</bold>
<italic>false</italic>
<overline>false</overline>
<underline>false</underline>
<strikeout>false</strikeout>
<waveUnderline>false</waveUnderline>
<foreground>#B200FF</foreground>
</format>
<!-- but it is sufficient to specify deviations from default -->
<format id="python:number" >
<italic>true</italic>
<overline>false</overline>
<foreground>#007F0E</foreground>
</format>
<format id="python:definition" >
<bold>true</bold>
</format>
</QXF>


The results is the following highlighting:

Changelog

The changelog can be found at http://texstudio.sourceforge.net/manual/current/CHANGELOG.txt.