Start here

Getting started with Halmos

From an empty window to a formatted document: creating and saving, the block at the top of every file, basic formatting, and the View menu.

docs/getting-started.md in the Halmos Editor repository

Getting started with Halmos

Halmos is a Markdown editor for academic technical writing. You type Markdown on the left and see the finished document on the right, with maths, citations, charts and diagrams rendered as you go. The file you save is ordinary Markdown that any other markdown tool can read.

This guide takes you from an empty window to a formatted document. By the end you will know how to create and save a document, what the block at the top of every document is for, how to apply the basic formatting, and what each item under the View menu does. Citations, charts, diagrams and tables have their own guide: Writing documents for Halmos.


1. Creating a document

The first launch

The first time Halmos opens it gives you an untitled document with a short block of comments at the top. You can start typing straight away. Nothing is on disk until you save, so press ⌘S early; the save panel asks where to put the file.

On later launches Halmos shows the welcome pane instead: your recent files, a New Document button, Open… and Getting Started.

Help → Getting Started

The interactive tutorial. Halmos puts a short document, its bibliography and a small data set in a folder of their own (~/Documents/Halmos Tutorial unless you choose another place) and opens the document. Each section shows a finished example of an equation, a chart, a citation, a table or a cross-reference, then gives you tasks to do in the same document; the preview ticks each one when it sees it done. It is also on the welcome pane and in the command palette. The tutorial comes from halmoseditor.com, so it can improve between releases; offline, Halmos uses the copy it came with. Running it again offers to open the one you have or start fresh in a new folder; your edits are never overwritten.

File → New… (⌘N)

This is the normal way to start a paper. It asks a few things before the save panel opens:

  1. Start from — Blank is an empty document. The others each start with a title, an author and the sections that kind of document needs:

    • Research article: an abstract, and Introduction, Methods, Results, Discussion and Conclusion.
    • Assignment: your student ID and course under your name, a due date, and two numbered questions with parts (a) and (b), one with a worked, numbered equation. Your name is also in the page header, so every printed page says whose it is.
    • Lab report: Aim, Background, Materials and method, Results, Discussion and Conclusion. Results has a small data set as a captioned table and as a chart, both referred to in the text.
    • Essay: your course under your name, an introduction, two body sections and a conclusion.
    • Research proposal: an abstract, Background, Aims, Methods, a Timeline table and Expected outcomes.
    • Thesis or dissertation: an abstract, a paragraph for the degree and supervisor, a contents list, chapters from Acknowledgements to Conclusion, and an appendix.

    The document opens with the title selected, so you can type it straight away. Replace "Your Name" and the other placeholders in the frontmatter too, and replace or delete the sample table, chart or equation.

  2. Page header and footer — puts the title at the top of each page of an exported PDF, from page 2 on (page 1 already shows it in the title block), and "Page 1 of 5" at the bottom of every page. It is ticked for every starter except Blank; untick it if you don't want them.

  3. Include a bibliography — tick this if you will cite anything. A citation-style menu appears; pick one of the five bundled styles (apa, chicago-author-date, ieee, vancouver, harvard). You can change it later in the frontmatter.

  4. Bibliography — which .bib file the document will use: Same name as the document creates paper.bib beside paper.md; A new file named lets you choose the name; An existing file points at a library you already have.

Then the save panel names the document. Halmos writes the document with its frontmatter already filled in and, if you asked for one, creates the .bib file beside it.

Saving

  • ⌘S saves. The status bar at the bottom shows the file name, with — Edited after it while there are unsaved changes.
  • ⌘⇧S is Save As….
  • Halmos also keeps a recovery draft while you have unsaved changes (see Autosave under the View menu below), so a crash loses at most a couple of seconds of typing. The draft is never written over your file; only ⌘S changes the document on disk.
  • If another program changes the open file, Halmos reloads it for you when you have no unsaved edits, keeping your place. If you do have unsaved edits it asks whether to Keep Mine or Use File; Use File can be undone with ⌘Z. If you save over a file that changed since you opened it, Halmos asks first. If the file is renamed or moved, Halmos follows it; if it is deleted, the text stays open and ⌘S recreates it.

2. The window

  • Editor, left. Plain Markdown with syntax colouring.
  • Preview, right. Updates a moment after you stop typing. Links open in your browser.
  • Divider between them. Drag it, or focus it and use the arrow keys.
  • Toolbar across the top: Outline; Open…, Save; Cite…, Chart…, Table…; and Export PDF… at the right. Everything on it is also in the menus.
  • Outline, an optional column on the far left listing the document's headings (the toolbar's Outline button, View → Outline, or ⌘⌥O).

The command palette (⌘⇧P)

Press ⌘⇧P (or choose View → Command Palette…), type part of a command's name, and press Return to run it. Every Halmos command in the menus is there (the edit commands such as Undo and Copy are not), listed as Menu: Item (for example Insert: Table… or View: Appearance › Dark) with its shortcut on the right, so the palette is also the place to look a shortcut up.

  • The letters you type only have to appear in order: tab finds Insert: Table…, and so does instab.
  • ↑ and ↓ move through the list. On/off items such as Autosave show a ✓ when they are on.
  • With nothing typed, the last few commands you ran from the palette come first. Halmos remembers them between launches.
  • Esc closes the palette and puts the cursor and selection back where they were.
  • On the welcome pane, with no document open, it lists only the commands that work there.

3. The frontmatter

Every new document starts with a block like this:

---
# To cite: name a .bib file below, then type [@ in
# your text. Styles (or Format → Citation Style):
# apa, chicago-author-date, ieee, vancouver, harvard.
# bibliography: references.bib
# csl: apa
# toc: true  # a [[toc]] paragraph positions the contents
---

The two lines of --- fence off the frontmatter: settings for the document, written as key: value lines. Halmos reads it and then removes the block before rendering. Most keys are settings and do not appear in the preview; title, author, date and abstract make a title block at the top of the page. If you set title:, do not also type it as a # heading, or it shows twice. Put quotes around a value that contains a colon followed by a space, or that starts with {, [ or a quote mark: title: "Yield: a study". If the frontmatter is not valid YAML, the title block is left out (and Word and LaTeX exports may not get one either). A # starts a comment, whether it begins a line or follows a value, so to switch the contents on delete just the # at the start of the toc: line and leave the rest.

Halmos reads exactly ten keys. Everything else is left alone.

Key What it does
title The document's title, shown large and centred at the top. Also used for {title} in a header or footer, and as the page title of an HTML export.
author One name, a list of names, or a list of entries with name and affiliation. Shown under the title.
date Shown under the authors, exactly as you write it.
abstract Shown under the date. Write it with `abstract:
bibliography The .bib file citations resolve against. Relative paths are relative to the document, so references.bib means the file beside it.
csl Citation style: one of the five bundled names above, or the path to a journal's .csl file. Format → Citation Style writes it for you. A name Halmos does not know falls back to APA with a warning.
toc true renders a table of contents, at the first paragraph containing [[toc]] or, if there is none, at the top.
toc-depth How many heading levels the contents lists. Default 3.
header A line of text at the top of every page of an exported PDF (from page 2 when there is a title block). See Getting the document out.
footer The same, at the bottom of every page.

The lines in the new-document template begin with #, which makes them comments. To switch one on, delete the # and the space:

---
bibliography: references.bib
csl: apa
---

A document created with File → New… and a bibliography already has these two lines live. A document without one keeps the commented template, so the instructions are there when you need them.

You can leave the frontmatter out entirely; a document with no --- block at the top is fine.


4. Writing and formatting

Halmos documents are Markdown, so every format has a plain-text spelling you can type by hand. The Format menu and its shortcuts write the same characters for you, and they toggle: apply a format to text that already has it and it is removed.

Two rules hold for every command. Formatting never touches the frontmatter or the inside of a code block, so a stray ⌘B on a line of code does nothing. And ⌘Z undoes it.

Paragraphs

A paragraph is a run of lines. Leave a blank line to start a new one; a single line break inside a paragraph is treated as a space.

Headings

Put the cursor on a line and press ⌘1 to ⌘6 for heading levels one to six, or ⌘0 to turn it back into a paragraph. In Markdown a heading is a line starting with # signs, one per level:

# The title of the paper
## 1. Introduction
### 1.1 Background

The title is a level-one heading. Sections and subsections are levels two and three. The outline panel lists these in order, and the table of contents (if you turn it on) is built from them.

Pressing the same level again removes the heading. Pressing a different level changes it.

Bold, italic and the rest

Format Shortcut Markdown
Bold ⌘B **text**
Italic ⌘I *text*
Inline code ⌘⇧K `text`
Strikethrough ⌘⇧X ~~text~~

Select some text and press the shortcut. With nothing selected, the command inserts the pair of marks and leaves the cursor between them, so type the word and press the right arrow to step out. Bold and italic combine: ***text*** is both.

Lists

Put the cursor on a line (or select several lines) and press ⌘⇧8 for a bulleted list or ⌘⇧7 for a numbered one. The command adds the marker to the start of each line and removes it if every line already has one.

- First point
- Second point
  - A sub-point, indented by two spaces

1. First step
2. Second step

For a nested list, indent the line. Numbered lists renumber themselves in the preview, so the numbers you type do not have to be right.

Blockquotes

Format → Blockquote prefixes the line with > . There is no shortcut.

See [the project page](https://example.org) for details.

![The alt text becomes the caption](figure.png)

An image sits beside the document (or at a path relative to it). Give it alt text and Halmos turns it into a numbered figure with that text as the caption. Leave the alt text empty for a plain image with no number.

Code

Insert → Code Block offers a list of languages and inserts a fenced block:

```python
print("hello")
```

The language name after the opening fence switches on syntax colouring in the editor and the preview. Blocks can be folded out of the way with View → Fold Block (⌘⌥[) while you write the prose around them.

In the preview, a highlighted code block has a Copy button in its corner. It puts the code on the clipboard and reads "Copied" for a moment. Charts and diagrams have no button, and it does not appear in the PDF or HTML export.

Task lists and alerts

Start a list item with [ ] or [x] for a read-only checkbox in the preview and the PDF. Start a blockquote with [!NOTE], [!TIP], [!IMPORTANT], [!WARNING] or [!CAUTION] on a line of its own for a coloured box:

- [x] Write the introduction
- [ ] Add the second figure

> [!TIP]
> Alerts are blockquotes, so the next lines start with `>` too.

Pasting images

Copy an image (a screenshot, say) and paste it into the editor. Halmos saves it in an images folder beside the document as pasted-20261017-143005.png, never over an existing file, and inserts the link with the cursor in the alt text. Type a caption there to make the image a numbered figure. JPEG, GIF and WebP images keep their type. A document that has not been saved has no folder yet, so Halmos shows "Save the document before pasting images". If the clipboard holds text and an image, the text is pasted.

Tables

Insert → Table… (⌘⇧T) opens a grid where you type the cells and set each column's alignment; it writes a Markdown pipe table into the document. Put the cursor inside an existing table and use the same item to edit it. The grid has a Caption field; a captioned table is numbered "Table 1: …".

To refer to a figure, table or equation, type @fig:, @tbl: or @eq: and pick from the list, or choose Insert → Cross-reference… (⇧⌘R). Halmos writes the label for you and the reference shows "Figure 2" or "Table 1". See the writing guide for the details.

Maths

Inline maths goes between single dollar signs and display maths between double:

The energy is $E = mc^2$.

$$
\int_0^1 f(x)\,dx
$$

Anything KaTeX accepts works. The spell checker leaves the inside of maths alone.

Citations

With a bibliography set in the frontmatter, [@smith2020] cites the entry whose key is smith2020 and a References section appears at the end of the document.

  • Type [@ to pick from the .bib: a list of keys, authors and titles narrows as you type.
  • Insert → Citation… (⌘⇧C) picks from Zotero instead.
  • Hover over a key to see the full reference. A key that is not in the .bib gets a red underline, and the status bar counts them; click the count for the list.
  • Format → Citation Style changes the style, including a journal's own .csl file.

The whole process, from connecting a bibliography to checking every citation before you submit, is in Citing in Halmos. Keeping a .bib in step with Zotero is in Setting up Zotero.


5. The View menu

Every choice here is remembered between launches.

Sync Scrolling. When on, scrolling the editor scrolls the preview to match. When off, the two panes scroll independently. Clicking an entry in the outline moves both panes regardless, because you asked to go there.

Outline (⌘⌥O). Shows or hides the headings panel on the left. Click a heading to put the cursor on it and scroll both panes to it. The toolbar's Outline button does the same as the menu item, and looks pressed while the panel is shown.

Autosave. On by default. While the document has unsaved changes, Halmos writes a recovery draft a couple of seconds after you stop typing. The draft lives beside Halmos's own settings, never over your file. If Halmos quits without saving (a crash, a force-quit), the next time you open that document it asks whether to restore the draft. Saving, or choosing Don't Save, removes the draft. Turning this off stops the drafts; ⌘S still works exactly as before.

Check Spelling. On by default. Misspelled words are underlined as you type them, using the Mac's own spelling checker, and a right-click offers corrections. Code, maths, citation keys, link addresses, HTML and the frontmatter are not checked. Two things to know: macOS checks the word you just typed and the word you leave, not a document you open, so an existing paper shows no underlines until you edit or move through it; and turning the setting off stops new underlines but leaves the existing ones until their line is edited or the document reopened.

Appearance. System, Light, Dark or Sepia. System follows the Mac's setting. Sepia is a cream page on screen; the PDF and the HTML export stay white.

Body Font. New York (the default), Charter, Iowan Old Style, Palatino, Georgia or System Sans. It sets the font of the preview, the PDF and the HTML export.

Figure Alignment. Left, Centre or Right, for every figure, chart and image in the document at once.

Chart Width. Small, Medium or Large, for every chart in the document.

Fold Block (⌘⌥[) and Unfold Block (⌘⌥]). Collapse or expand the block the cursor is in: a heading's whole section, a list, a blockquote, or a code block, chart or diagram. A folded block shows as one line, so a long chart specification does not fill the editor while you write the prose around it. Fold All Code Blocks folds every fenced block at once, and Unfold All opens everything. Folding changes only what the editor shows; the preview and the file are unaffected.


6. Getting the document out

Export → Export PDF… (⌘E) writes a PDF of the preview: maths, figures, charts, the contents page and the References section included. File → Paper Size (A4 or Letter) and File → PDF Orientation set the page, and the preview is drawn at that size so what you see is what prints.

To put a line at the top or bottom of every page, set header or footer in the frontmatter. Each is one line of text, centred, in small type, and can use {title} (the title: key, else the first heading, else the file name), {date} (today), {page} and {pages}:

---
header: "{title}"
footer: Page {page} of {pages}
---

Quote a value that contains : or #, or that starts with {, as header is quoted above. Headers and footers appear in Export PDF only, not in Print… or the other formats. When the document has a title block (a title, author, date or abstract), the header starts on page 2, since page 1 already shows the title; the footer is on every page.

Export → Export HTML… writes the document as one file you can send or open in any browser, offline. It holds the styles, the maths with its fonts, charts and diagrams as drawn, and local images embedded in the file. Images that are links to the web stay links. It contains no scripts. It always uses the light theme on a white page, in the body font you chose. The save panel opens in the document's folder, and export waits for charts to finish drawing. Large images make a large file.

Word and LaTeX export come with Halmos accounts, which are not open yet: the released app does not have them. When they arrive, Export → Export Word… and Export → Export LaTeX… convert the document with Pandoc on halmoseditor.com, with citations and the reference list in the document's citation style. They need a Halmos account with a subscription: the first time, Halmos shows a code and opens halmoseditor.com in your browser, where you sign in and approve this Mac. Halmos Editor → Account… shows which account this Mac is connected to.

  • The document, the cited part of its bibliography, its citation style and, for Word, its images are sent to halmoseditor.com, converted, and not kept.
  • Word gets charts and diagrams as pictures, as the preview draws them.
  • LaTeX gets no images: the .tex names them by their paths, so save it in the document's folder, beside them.
  • Raw HTML and raw LaTeX in the document come out as text.

File → Print… (⌘P) opens the system print panel.

Quick Look in Finder

Select a .md file in Finder and press the space bar to see it drawn the way the preview draws it: headings, maths, task lists, alerts, code, charts and diagrams. If Finder shows plain text instead, open Halmos once so macOS registers its preview. Quick Look works only from the file itself, so it differs from the preview in a few ways:

  • Citations show as written ([@smith2020]), with no References section; the .bib file is not read.
  • Images show as their file name in brackets rather than the picture, except images embedded in the file itself as data:image/ links, and nothing is fetched from the internet. A chart whose data comes from a web address is drawn empty.
  • It is always light, on an A4 page.
  • A file over 5 MB shows its first 5 MB, with a note at the top.

Where next

  • Citing in Halmos: inserting, checking and styling citations, start to finish.
  • Writing documents for Halmos: citations, charts, diagrams, figures and the table of contents in full.
  • Setting up Zotero: the citation picker and keeping a .bib file in sync with your library.
  • The test document: every feature, one section each. Open it in Halmos and read it beside the preview.
  • Help → Discussions opens the project's discussions on GitHub: ask a question, suggest an improvement, or vote for one already proposed.
  • Help → Report an Issue… opens a bug report with the version already filled in.