# &ktikz; Interface

## &ktikz; Main Window

Screenshot of &ktikz; main window &ktikz; main window

The &ktikz; main window consists of a (1) menu bar, (2) toolbar, (3) template selector, (4) text editor, (5) preview panel, (6) messages panel and (7) status bar.

The Preview and Messages panels can be shown or hidden in Settings Sidebars. The visible panels can then be dragged around the &ktikz; window by clicking and dragging the panel title.

### &ktikz; Editor

In the editor the source code of a TikZ picture (everything between \begin{tikzpicture} and \end{tikzpicture}) can be edited. While editing, a preview of the TikZ picture is generated on the fly in the Preview panel. The TikZ code is highlighted in different colors according to the syntax. Text-completion is provided for TikZ commands: when the user types the first letters of a TikZ command, the commands starting with those letters are listed and can be selected by the user using the arrow keys and pressing Enter. If a TikZ command is selected in this way or if it is selected from the Insert menu, the syntax of the command is shown in the status bar. In the inserted text the options or arguments that must be filled in are marked with &bullet;. The first of these symbols is automatically selected and can be overwritten by just typing. You can select the next or previous &bullet; by pressing Tab or &Shift;Tab.

Screenshot of &ktikz; find and replace panel &ktikz; find and replace panel

Screenshot of &ktikz; replace current occurrence panel &ktikz; replace current occurrence panel

If the user triggers the Find or Replace action, a Find & Replace panel appears at the bottom of the editor. In the Find text field, the text to be searched is entered. In the Replace with text field the text to replace with can be entered. Pressing the Find button will only search for the text, while pressing the Replace button will show a Replace bar with the following options: Replace the first occurrence, Replace All occurrences, Don't Replace the current occurrence, or Cancel the replace operation. Checking the Whole words option will cause the find to match only complete words, checking the Case sensitive option will cause the find to match only those occurrences which have exactly the same case (otherwise the find works case insensitive). Two arrow buttons are available which allow the user to specify the direction in which the search should be done (move backwards or forward in the text). Finally there is a Cancel button which causes the panel to be closed.

Screenshot of &ktikz; go to line panel &ktikz; go to line panel

If the user triggers the Go to Line action, a Go to Line panel appears at the bottom of the editor. In the Go to line spin box, the line number to which the cursor should be moved is entered. Pressing Enter or the Go button closes the panel and moves the cursor in the editor to the specified line. Finally there is a Cancel button which causes the panel to be closed without moving the cursor.

Screenshot of &ktikz; indent panel &ktikz; indent panel

If the user triggers the Indent action, an Indent panel appears at the bottom of the editor. The indentation character (space or tab) can be selected and the number of times that character is inserted at the start of each to be indented line can be chosen in the corresponding spin box. Pressing Enter or the Indent button closes the panel and indents the selected lines (or the current line if no line is selected) in the editor. Finally there is a Cancel button which causes the panel to be closed without indenting.

### &ktikz; Preview Panel

In the Preview panel an image which is the result of compiling the current TikZ code in the editor is shown. If there are errors in the TikZ code, an error message is shown instead. The preview can be enlarged or made smaller by pressing the Zoom In and Zoom out buttons or by changing the zoom percentage. The zoom percentage can also be changed by rolling the mouse wheel while pressing the &Ctrl; button.

If the TikZ code contains several pictures (enclosed by \begin{tikzpicture} and \end{tikzpicture}), then the preview will only show one picture. The other images can be shown by pressing the Previous Image and Next Image buttons which become available in this case.

### &ktikz; Messages Panel

If there are errors in the TikZ code, an error message is shown in the Messages panel. If the error message is not clear enough, then the user can press the View Log button and the complete LaTeX log file will be shown in the Messages panel.

### &ktikz; Template Selector

Screenshot of &ktikz; template selector &ktikz; template selector

The template selector consists of a text field in which the path to a template file is given, a button which opens a file selector dialog in which the template file can be selected, a reload button which can be pressed to regenerate the preview when the template file is edited in an external editor, and an Edit button which opens the template file in an external editor.

See the section on templates for more details on how to use templates in &ktikz;.