Settings

Zettlr offers you a plethora of options to customise your experience with the app. It comes with three different settings-dialogs that will be explained in detail here, so you know which option does what.

General Preferences

You can display the general preference dialog using either the shortcut Cmd/Ctrl+,, the toolbar button (the cog) or the respective menu item. The dialog will then show up and present to you all configuration options you may customise. They are ordered in five tabs that you can see at the top of the dialog.

  • General: These options affect Zettlr as a whole.
  • Editor: These settings concern only the editor itself.
  • Export: Control how your files are exported in this tab.
  • Zettelkasten: Adapt Zettlr to match your Zettelkasten system.
  • Attachments: This tab controls what the attachment pane (shortcut: Cmd/Ctrl+3) should do.
  • Advanced: Options for experienced users.

General

General Settings

In the general tab you find options that you might want to adjust if you begin using Zettlr to fit it to your needs. The application language is pretty self-explanatory — it is the language for all menu items and all other strings that Zettlr might use to present information to you.

The "Night Mode" and "Snippets"-checkboxes control the display. The "Night Mode" is simply the dark theme Zettlr is capable of (and which you might want to control using the shortcut Cmd/Ctrl+Alt+L instead). Check the "Snippets"-checkbox to display text snippets in the preview pane (although you can control this behaviour as well using its respective shortcut Cmd/Ctrl+Alt+S).

The sidebar mode controls how the sidebar is displayed to you. You have two options:

  • Thin: In thin mode, the sidebar only displays either the list of files or the directory list. You can switch between both using the shortcuts Cmd/Ctrl+1 and Cmd/Ctrl+2. Alternatively, you can switch from preview to directories using the arrow that will appear if you move your mouse to the top of the file list. Switch from directories to file list by simply selecting a directory. If you move files from and to different locations, the sidebar will act intelligent and switch either to the directory or the file list — depending on what you will need.
  • Expanded: The expanded mode is basically how you knew Zettlr until the thin mode was introduced: It displays both the directory list and the file list side by side. In this mode, you have both lists always present. In this mode, the shortcuts (and the respective menu items) for displaying and hiding the directories and file lists have no effect, because both are always visible.

If you want to hide the sidebar completely, please use the distraction-free mode (Cmd/Ctrl+J).

Editor

Editor Settings

The editor tab currently exposes two options to you. First you can select all languages against which a spellcheck should be conducted. This means, if you check both en_US and fr_FR, Zettlr will check all your text both against French and American English. This way you can select all languages in which you might ever write something. But please note the performance warning: Too many languages can significantly slow down the app (dictionaries are big).

If you want to disable spell checking completely, simply uncheck all boxes. You must restart the app to apply the changes.

The second option the editor tab features is whether or not you want to mute all lines of text you are not editing in the distraction free mode. This basically boils down to making everything transparent except the line in which your cursor is, while you are in the distraction free mode. This can help focusing on one paragraph and not being distracted by images, tables or other text above and below your current focus. If you disable the checkbox, all text in the distraction free mode is displayed the same, just as if you were not in the distraction free mode.

Export

Export Settings

In the export tab you have two groups of options at your disposal. The first group of options simply lets you choose where Zettlr should save exported files to. If you choose your temporary directory, the files will be deleted once they are not used anymore. This is a mode you should consider using if you export at a high frequency, but don't want to use most of your exports (e.g., if you tend to preview exported files a lot before you are satisfied with how they look). The second mode is that Zettlr directly saves to the currently selected directory. This mode is useful for people who know that they need to collect all exported files in a certain directory. Zettlr will then save your exports to the currently selected directory (and overwrite already existing files, so be careful!)

The second group of options simply tell Zettlr what to do with Zettelkasten-elements that are found in your files. As you can see in the chapter on the Zettelkasten-method, there are three: Hashtags, as you know them from Twitter, IDs in the form @ID:<your-id> and internal links. Normally, these are only needed inside the app itself for navigation and linking of documents against each other. As soon as you export to any other format, they lose their usefulness. Therefore, it makes sense to completely remove the IDs, unlink the internal links and maybe even remove the keywords you were using. Here you can decide what to do.

Zettelkasten

Zettelkasten settings

In this tab you can customise the way Zettlr works with your existing Zettelkasten system. In most cases you won't need to touch these options, but it may be you want to use a custom system.

You have four options that are important for Zettelkästen: The ID regular expression, the link start and ending, and the generator pattern.

The ID RegEx

Zettlr uses regular expressions internally to filter out the ID of a file. It looks for that pattern, and if it finds a string that matches this pattern, it assumes that as the ID of the file. Please note that the first ID in a file will be assumed the ID, never the last! This means: If you choose to use only four digits as your ID, the regular expression would also match years inside your file. As Zettlr simply takes the first ID, make sure that the very first thing in your file is the ID of that file.

The default regular expression (which you can restore by pressing the reset button next to the text field) is (\d{14}). This means Zettlr will look for 14 consecutive digits — exactly the number of digits that you get when you concatenate a year, a month, a day, an hour, a minute and a second; like this: 20181012143724. It is extremely unlikely that a file contains a second string that includes fourteen (!) digits, therefore it's a great method to use as an ID. Another great thing is that the ID is unique to the second. So each second you can create a new, fully unique ID.

The braces around the \d{14} create a so-called "capturing group". A capturing group's purpose is that the regular expression not only matches a certain string, but also extracts a part of it — in this case the full match. In previous versions of Zettlr, IDs were identified by @ID:<your-id>. The regular expression to detect this kind of ID was @ID:(\d{14}). As you can see, the pattern only matches strings in the form of @ID:20181012144047, but the capturing group only captures the real ID, and omits the prefix @ID:. This way you can use almost any structure of IDs you want.

Note that you can omit the capturing group's braces — Zettlr will encapsulate your RegEx internally, if there is no capturing group.

The Internal Links

The internal links are explained pretty quick: Simply choose how you'd like to write internal links. The default are Wiki-Style-Links: [[your-link]]. You could also use curly brackets: {{your-link}}. Or you could use exclamation marks: !your-link!. Whatever suits you!

The internal links are used for two things: First, if they either contain an existing file name or an existing ID, clicking them will directly open the respective file (identified either by its name without the extension, or by its ID). Second, if they don't contain any of that, they won't open any file, but they will work as a search function, so ALT-clicking them will start a search — this is great for saving searches you do often!

Please note that any links will be ignored during the search for an ID, so don't worry if your links contain IDs — the file will not assume any link as an ID!

The ID generator

The last field in the Zettelkasten tab in the preferences window concerns the way the IDs are generated. It is a simple string that may contain variables that are replaced when an ID is generated. Currently, you have the current year, month, day, hour, minute, and second available. The default ID generator pattern is: %Y%M%D%h%m%s, which means it will replace %Y with the current year (4 digits), %M with the current month (with leading zeroes), and so forth. You could also include some static part in your IDs, if you wish to (for instance, you could separate the parts of the date with dashes). So with the ID pattern set to %Y-%M-%D_%h:%m:%s Zettlr would generate an ID like this: 2018-10-12_12:03:56. You can also reuse the variables in your pattern, e.g. to use only seconds as your ID, you could use something like this: %s%s%s and would get 565656.

Always remember to adapt your regular expression so that it matches what the ID generator spits out. To successfully identify the ID with the pattern, %Y-%M-%D_%h:%m:%s, Zettlr would need the following regular expression: (\d{4}-\d{2}-\d{2}_\d{2}:\d{2}:\d{2}).

You can test both the generation of IDs and the detection of them by clicking the Test-button below the text fields. Zettlr will then generate an ID and immediately tries to match it using your custom regular expression. Whether or not Zettlr was able to detect the ID will be indicated.

If you are happy with your choices, hit "Save" to apply the settings. You may need to restart the app so that the settings are in full effect.

Attachments

Attachment Settings

As you may notice, the attachment pane (Cmd/Ctrl+3) shows all non-markdown files present in the currently selected directory. In this tab you can simply decide which files you actually want to see. Simply enter the filename-extensions, separated by commas. For instance, if you would want to hide PowerPoint-presentation files by default, simply remove the .pptx-entry from that list.

Advanced

Advanced Settings

As the title suggest, you shouldn't need to access these options very often. Yet for some cases they can be useful.

The pandoc- and xelatex-text fields are used in case Zettlr is unable to locate any of these two programs. As you know, Zettlr uses both to export your files. In rare cases it may be that Zettlr is unable to find them, although you installed them already. If that happens, simply put in the full, absolute path to both programs in the textfields to point Zettlr where to look.

The debug option is used to control whether or not you are able to "reload" the graphical user interface (GUI) by pressing F5 and display the Chrome developer tools to inspect what the app is doing. Naturally, you would want to do this as a developer.

PDF Preferences

We've moved the PDF Preferences to another dialog because there are many you can use. These options control how the LaTeX-engine will render your files on PDF-exporting. They do not have any effect on all other export formats. You can bring up the dialog using either its shortcut Cmd/Ctrl+Alt+, or using the respective menu entry. The PDF options are also divided by tabs. Currently, there are three:

  • Metadata: This controls the metadata field of PDF files.
  • Page: Adjust the layout of pages using this tab.
  • Font: All options regarding the font used in your exports are collected in this tab.

Metadata

This data can be shown in your PDF readers using a dedicated menu item. Normally they are hidden from view, but in some circumstances they are used. The only thing that should be of concern really is the author field, which is prefilled by the information "Generated by Zettlr". You can change this to your own name (or the name of your company). Keywords and the "topic" field are rarely used.

Page

In this tab you can control the layout of the page. These options work just as you would expect them from the similar dialogs that are used in LibreOffice or Microsoft Office. You can change the size of the paper, adjust the margins around the content and tell Zettlr whether or not you want to use page numbers (and which numbering system you want to use).

Font

Here you can control how the font is displayed. The main font is the font used for all text. The LaTeX-engine will fetch this directly, so the name you type here must match exactly a font installed on your computer. If the LaTeX-engine is unable to locate the font, it will spit out an error. To know whether you've encountered such an error or another error that does not relate to the font, simply search for the font name you typed here in the error message. If your font name appears, there is a high chance that the font is called differently. Then please open your operating system's font preferences and check the name.

The font-size should be rather obvious. The line height specifies the spacing between lines (this only applies to paragraphs). For instance a line height of 150 percent would create a space of half a line between the lines (i.e. each line is followed by a space 50 percent of a normal line height before the next line begins).

Manage Tags

The tags dialog does not have a shortcut associated, so you'll need to call it using the respective menu item. But normally you shouldn't need the dialog that often. Here you can assign colours and descriptions to tags.

To add a new tag-colour-relationship, simply press the +-button at the bottom of the dialog. In the first field, enter your tag without the preceding hashtag symbol (e.g. if you wanted to assign a colour to the hashtag #todo, simply enter todo). Next, choose a colour to be assigned to that tag. If you click the second bar after the tag name field, a color picker should appear that lets you choose a colour. In the third field, you can enter a short description for that tag. This description will be shown if you hover over the tag symbols in the preview pane.

If you want to remove a tag-colour-association, simply click the --button at the end of such a tagline (pun intended).