Handwriting
Handwriting notes are sheets of digital paper to write and sketch on with a pen, a mouse or a finger. Unlike Canvas notes, which are aimed at diagrams, a handwriting note has only ink tools and stays responsive across many pages of writing, which suits taking notes on a tablet.
Creating a handwriting note
Right click an existing note in the Note Tree, select Insert child note and look for Handwriting.
Interaction
Writing and erasing
- To write, select the Pen and draw on the page. A pen that senses pressure draws a thicker line the harder it is pressed. With a mouse or a finger, the thickness follows the speed of the stroke.
- To highlight, select the Highlighter, which draws a wide, see-through line of even thickness.
- To erase, select the Eraser and drag across the ink. By default, the eraser removes every stroke it touches as a whole. While the eraser is selected, a rail on the side of the note offers the two ways to erase: to erase only the ink under the eraser, select Erase parts of strokes, and to go back, Erase whole strokes. A stroke cut that way becomes separate strokes on either side, which keep the thickness they had. The setting applies to the device it is changed on. The eraser end of a pen (on pens that have one) erases whichever tool is selected, in the same way, and so does holding the button on the barrel of the pen.
- To undo or redo, press the and buttons in the bottom-left corner. On a touch screen, a short tap with two fingers also undoes.
Color and thickness
While the pen or the highlighter is selected, a rail on the side of the note sets its color and thickness. Each of the two tools keeps its own.
- To change the thickness, select one of the three presets (Fine, Medium or Bold), or adjust it in small steps with the and buttons. The button between them shows the current thickness and resets it when pressed.
- To change the color, select one of the swatches, the same colors that a note can be given (see Note Icons & Colors), or the last one (Custom color...) to pick any other. The highlighter starts out yellow.
- The first color of the pen, Text color, follows the theme: such ink is dark on a light theme and light on a dark one, so it stays readable when the theme changes.
- Any other color that would be hard to see is shown lighter in a dark theme (a dark blue becomes a light blue, keeping its hue), and darker in a light theme if it is nearly white. The note keeps the color as it was chosen.
Pressure sensitivity
How much pressing harder thickens the pen's line is set in the menu of the toolbar, under Pressure sensitivity. The sensitivity goes from 0, where every line keeps the same thickness however hard the pen is pressed, to 100, where a light touch draws a hairline and a firm one a line several times as thick. With a mouse or a finger, the setting changes how much the speed of the stroke changes the thickness instead.
- To pick a sensitivity, select one of the presets: Off (0), Low (30), Normal (60, the default), High (80) or Maximum (100).
- To use a value between them, type it into the box of the Custom row and press Enter, or step it by 5 with Up and Down.
- The setting applies to the device it is changed on, like Finger drawing, as how a pen responds depends on the pen.
- Each stroke keeps the sensitivity it was drawn with, so changing it only affects new strokes and never reshapes the ink already on the page.
- The highlighter is not affected: it always draws a line of even thickness.
The cursor is a ring as wide as the line that the tool draws.
Moving around the note
- On a touch screen, drag with one finger to scroll and pinch with two fingers to zoom. Fingers do not draw, so the hand can rest on the screen while writing with a pen.
- While a pen touches the screen or hovers just above it, and for half a second after, touching the screen does nothing until every finger is lifted. A hand that lands shortly before the pen and moves the page puts it back where it was.
- Three or more fingers on the screen at once count as a resting hand too, and neither scroll, zoom nor undo.
- With a mouse, scroll to move up and down, hold Shift while scrolling to move sideways, and hold Ctrl while scrolling to zoom. Dragging with the middle button also moves the page, as does a pen button that the tablet maps to it.
- To move the page with a pen or a mouse, select the Pan tool and drag, or hold Space and drag with any tool. This also works with a drawing tablet whose pen has no button mapped to the middle button.
- With the Pages layout, the buttons beside undo and redo show which page is on screen and the number of pages. The and buttons, or Page Up and Page Down, go to the top of the previous or next page without changing the zoom.
- The buttons in the bottom-right corner zoom in and out, between 25% and 800%. Pressing the percentage goes back to 100%.
- To see the whole width of the page, press the Zoom to fit button. On an infinite canvas, it fits the width of the ink instead. Either way, the part of the note on screen stays in view.
- To give the note the whole screen, press the button. Press it again or Esc to go back.
A note opens at the place and zoom at which it was last left.
Drawing with a finger
To write with a finger on a touch screen, open the menu of the toolbar and turn on Finger drawing. One finger then draws, and two fingers scroll and zoom. The option only appears on devices with a touch screen and applies to that device alone, so a phone can draw with a finger while a tablet with a pen does not.
Shapes
A shape drawn by hand can be turned into a clean one. Draw the shape in a single stroke and, at the end, keep the pen on the screen (or the mouse button down) without moving for about half a second.
| Shape | How to draw it | Result |
|---|---|---|
| Line | A stroke that is roughly straight. | A straight line between the two ends of the stroke. While the pen stays down, the end of the line follows it, to aim the line or change its length. |
| Rectangle | Once around the four sides, ending near the start. The corners need to be roughly square. | A rectangle of the size drawn. It is made level if it was drawn nearly level and keeps its angle otherwise. |
| Triangle | Once around the three sides, ending near the start. | A triangle with straight sides between the corners drawn. If one side is nearly level or upright, the triangle is turned so that it is exactly so. |
| Circle or ellipse | Once around, ending near or past the start. | A circle if the shape is about as wide as it is tall, otherwise an ellipse. An ellipse drawn nearly level or upright is made exactly so. |
| Arrow | The shaft toward the tip, then, without lifting the pen, one side of the head out and back to the tip, and the other side out. | An arrow with a straight shaft and a head with two equal sides. |
- A shape has the same thickness all along, taken from how hard the pen was pressed on average.
- To get back the stroke as it was drawn, undo once. Undoing a second time removes it.
- A stroke that is not recognized as one of these shapes stays as it was drawn.
- Shapes work with the highlighter as well as with the pen.
Selecting
The Select tool picks strokes and images to move, resize, copy, restyle or delete them together.
- To select, pick the Select tool and draw a loop around the ink with the pen or the mouse. A stroke is selected when most of its length lies inside the loop, so a tail or a dot that crosses it does not keep a word out. An image is selected when most of it lies inside, so a loop around ink written on a large picture leaves the picture out.
- To select a single stroke or image, press it. Ink lies over images, so pressing ink on an image selects the ink.
- To add to the selection, hold Shift while drawing the loop or pressing a stroke or an image. Pressing a selected one with Shift held takes it out of the selection.
- To select everything, press Ctrl+A.
- To let go of the selection, press Esc or start a loop outside it.
- On a touch screen, a finger drags a stroke or an image but moves the page elsewhere, unless Finger drawing is turned on, in which case it draws the loop.
A box with handles at its corners and a bar above it surrounds the selection.
- To move the selection, drag it from inside the box, or drag the bar above it. A stroke or an image that is not selected yet can be pressed and dragged at once.
- To resize it, drag one of the handles at its corners. The selection keeps its proportions, and the ink becomes thicker or thinner with it.
- To duplicate it, press the button of the bar or Ctrl+D. The copy appears slightly below and to the right, and is selected.
- To delete it, press Delete or the button of the bar.
- To copy or cut it, press Ctrl+C or Ctrl+X, and paste it with Ctrl+V into the same handwriting note or another one. A copy pasted where it is in view keeps its place, or lies slightly beside the original if that is still there, and a copy whose place is not in view goes to the middle of the view. Images are pasted only into the note they were copied from.
- While strokes are selected, the rail on the side of the note shows their color and thickness. Choosing a color or a thickness there, or pressing [ and ], changes all the selected strokes. Selected highlighter strokes take the width that the highlighter draws at that thickness.
- Moving, resizing, duplicating, pasting, restyling and deleting a selection are undone and redone like ink, each in a single step.
Text boxes are not part of a selection; they are moved and deleted on their own (see Text boxes below).
Images
A picture, such as a photo of an exercise or a screenshot of a slide, can be placed on the paper and written over. Images always lie under the ink.
- To add an image, press the Insert button of the toolbar, select Image and choose one or more files. On a phone or a tablet, the file chooser also offers the camera.
- Alternatively, paste an image from the clipboard with Ctrl+V, or drag an image file onto the note.
- A new image appears in the middle of the view, at its own size or smaller: on pages it fits inside the page, and on an infinite canvas inside the view. It is selected, and the Select tool is picked, ready for the image to be moved into place.
- An image is moved, resized, duplicated and deleted with the Select tool, alone or together with ink (see Selecting above). Resizing keeps its proportions.
- Adding an image is undone and redone like ink.
- The pen, the highlighter and the eraser leave images as they are, so ink on an image can be erased without removing the image.
In a dark theme, images are shown with their colors inverted, as the paper is: a white sheet with dark print becomes a dark sheet with light print, so ink in the Text color stays readable over it. A photo therefore looks like a negative in a dark theme.
Each image is saved as an attachment of the note, and is compressed as the images of Text notes are. The attachment of a deleted image is kept for a while, in case the deletion is undone, and then erased.
Text boxes
Typed text goes in text boxes, which lie over the ink and the images.
- To add a text box, select the Text tool and tap or click the paper, then type. With this tool, dragging or pinching still moves and zooms the page.
- The text is formatted as in a Text note: select some of it to show a toolbar with bold, italics, the size and the colors of the text, and links.
- To add a heading, a list, a quote, an admonition (see Block quotes & admonitions), a code block, a table, a math equation (see Math Equations) or a horizontal line, press the sequence of dots to the left of the paragraph being typed. While Slash Commands are turned on for text notes, typing / in a text box offers them as well.
- To finish typing, press Esc or press outside the box. A box left without text is removed.
- To edit a text box later, double-click it with the Text tool or the Select tool.
- To move a text box, press it with one of those tools and drag the bar above it. To make it wider or narrower, drag its right edge; its height follows the text.
- To delete a text box, press it and then the button of the bar above it.
- With the other tools, the pen writes through the text boxes.
Showing another note
A handwriting note can show another note in a box on the paper, in the same way as a Canvas shows an embedded note: a text note is shown with its formatting, and a collection or a web view can be used inside the box. A collection is shown read-only, without the buttons that switch its view and open its settings: to change it, open the note itself.
- To add a note, drag it from the Note Tree onto the paper. Several notes dragged together each get a box. Alternatively, press Insert in the toolbar, select Note... and look for the note, whose box appears in the middle of the view. Either way, the Select tool is picked, ready for the box to be moved into place.
- With the Select tool, press a box to select it. Drag the bar above it to move it, and its bottom right corner to resize it. The content of the box scrolls and takes clicks.
- To open the note in a new tab, press the button of the bar. To remove the box, press the button; the note itself is not deleted.
- With the other tools, the pen writes through the box, and the ink shows over the note, so that the note can be annotated. The ink keeps its place on the paper: it does not follow the content of the box when that scrolls or when the note changes.
Writing on a PDF
A PDF, such as the slides of a lecture, can be the paper of a handwriting note, to write over its pages. A note can hold several PDFs, one after the other.
- To add a PDF, press the Insert button of the toolbar, select PDF and choose one or more files, or drag PDF files onto the note.
- Each page of the PDF lies on a sheet of the note, in order, under the images and the ink. The sheet takes the size of its page as printed, so a slide in landscape gets a sheet in landscape and an A4 page an A4 sheet.
- Ink is not held to the sheets. To write more than a page has room for, write beside it or below it.
- The note switches to the Pages layout and shows a sheet for every page of the PDF. Once the last one has ink, A4 sheets follow.
- The pages of a new PDF are added after the last sheet in use: after the pages of the PDFs already in the note, and after any sheet that has ink or an image. Nothing above them moves, and the view goes to the first new page.
- To take a PDF away, open the menu of the toolbar and select it by its file name under Remove PDF. Its sheets stay, empty, at their sizes, with the ink and the images on them, and the other PDFs stay on theirs.
- In a dark theme, the pages are shown with their colors inverted, as images are.
The PDF is saved as an attachment of the note and is not changed: the ink is kept in the note, not written into the file. To read the PDF with its text, links and outline, open the attachment, or keep the PDF as a File note as well.
Annotating a PDF note or attachment
A PDF that is already in Trilium can be annotated without adding it by hand:
- For a File note holding a PDF, open the Note menu and select Annotate by hand.
- For a PDF attachment, open the menu of the attachment (see Attachments) and select Annotate by hand.
This creates a handwriting note as a child of the note that holds the PDF, named after the PDF, with a page for each page of the PDF, and opens it. Selecting Annotate by hand again opens the same note.
The handwriting note keeps a copy of the PDF as its own attachment, so the ink stays on the pages it was written on if the original is later replaced or deleted. The copy takes no extra space while the original is unchanged. The original PDF is not modified: the annotations are in the handwriting note only.
Configuration
The layout and the paper are set from the menu of the toolbar and are saved with the note.
Layout
- Pages (the default) shows a column of A4 sheets, or of sheets the size of the pages of a PDF (see Writing on a PDF above). An empty page is added after the last page that has ink, so there is always room to continue.
- Infinite canvas removes the sheets and lets the ink extend in any direction.
Paper
The paper is Ruled, Grid, Dots or Blank. The rules and the dots follow the theme's text color, and the grid is pale blue. None of them are part of the ink.
Previews
Wherever a handwriting note appears outside its own editor, it is shown as a picture: in the previews of Collections, and when it is inserted as an image into a Text note (including a shared one). The picture shows the first page, or all the ink, the images and the text boxes of an infinite canvas, and is updated each time the note is saved. The text of a text box is shown line by line as in the note, in its fonts and colors; the bullets and the numbers of lists, the borders of tables and the images inside a text box are left out. Ink in the Text color turns light when the picture is viewed in a dark theme, and images are inverted as in the note.
Read-only mode
A read-only handwriting note hides the tools and can only be scrolled and zoomed. A pen or a mouse then moves the page instead of drawing. A handwriting note is read-only only when it is set to be, from Editable in the note menu or with the readOnly label: unlike a large code note, it never becomes read-only automatically because of its size.
A handwriting note that was saved by a newer version of Trilium is also shown without the tools, with a notice above the page. The note can hold content that this version does not know, which a save would lose, so it can be read but not changed until Trilium is updated on that device.
Keyboard shortcuts
| Shortcut | Action |
|---|---|
| P | Select the pen. |
| Shift+P | Select the highlighter. |
| E | Select the eraser. |
| V | Select the select tool. |
| H | Select the pan tool. |
| T | Select the text tool. |
| [ and ] | Make the line, or the selected strokes, thinner or thicker. |
| Ctrl+Z | Undo. |
| Ctrl+Shift+Z or Ctrl+Y | Redo. |
| Ctrl+A | Select all the strokes and images. |
| Ctrl+C and Ctrl+X | Copy or cut the selection. |
| Ctrl+V | Paste the strokes and images, or add the image, on the clipboard. |
| Ctrl+D | Duplicate the selection. |
| Delete or Backspace | Delete the selection. |
| Space (held) | Move the page by dragging with the pen or the mouse. |
| Page Up and Page Down | Go to the previous or next page. |
| Esc | Let go of the selection, or leave fullscreen. |
Converting a canvas note
A Canvas note can be turned into a handwriting note: open the canvas, go to the Note menu and select Convert to handwriting note. A revision of the canvas is saved first, so it can be restored from Note Revisions.
- The strokes of the Draw tool, the text and the images are kept at their position, on an infinite canvas with blank paper (or grid paper if the canvas showed its grid).
- Strokes keep their color, their thickness and the pressure of the pen. Black ink takes the Text color, and translucent ink becomes highlighter ink.
- Text becomes text boxes, with its color, its font size, its line breaks and its alignment. The font is that of text notes, so lines can be a little longer or shorter than on the canvas. Rotated text is laid out upright.
- Images stay attachments of the note and keep their position and size. A rotated image is laid out upright, and a cropped image is shown whole, with the part the canvas showed in its place.
- Rectangles, diamonds, ellipses, lines and arrows become images, one for each shape, drawn as on the canvas with their fill, their line style and their hand-drawn look. Like any image they can be selected, moved, resized and deleted, but not edited or erased in part.
- The shapes are taken from the preview that the canvas saves a few seconds after each change. Shapes are left out if the canvas has no preview yet, or was changed after its last one; in that case, restore the revision, wait a moment with the canvas open and convert again.
- Images, including the shapes, lie under the ink and text boxes over it, whatever their order on the canvas.
- Frames, embedded notes and web embeds are removed. A message says how many elements were left out.
- The attachments that only the canvas used are deleted: its library items, its preview and the images that the note no longer shows. Other attachments of the note are kept.
- A handwriting note cannot be converted back into a canvas. To get the canvas back, restore the revision.
Importing from RNote
A document of RNote (a .rnote file) is imported as a handwriting note. Drag the file into the Note Tree, or select Import into note (see Import & Export). The .rnote files inside a ZIP archive are imported the same way.
To keep an RNote document as it is, as a File note, turn off Import RNote and Xournal++ drawings as handwriting notes rather than files in the Options of the import dialog.
- Pen strokes keep their position, color, thickness and pressure. Black ink becomes ink in the Text color, so it stays readable in a dark theme, and translucent ink becomes highlighter ink.
- The shapes of the shape tool (lines, arrows, rectangles, ellipses, curves, polylines and polygons) become ordinary ink, drawn smooth even when RNote draws them in its rough style. A filled shape keeps only its outline.
- The note uses the infinite canvas, with the paper nearest to the background pattern of the document, and opens at the top of its ink, fitting its width.
- Images keep their position and size, and are saved as attachments of the note. A rotated image is imported upright, and a vector image is saved as an SVG.
- RNote keeps the pages of a PDF it annotates as vector images, not as the PDF, so they are imported as SVG images under the ink. Their text cannot be selected or searched. To read the PDF with its text, open it in another program, or add it to a handwriting note of its own (see Writing on a PDF above).
- Typed text becomes text boxes at the same place, keeping its size, line breaks and colors, and its italic, bold, underlined and struck-through parts. The text takes the font of the note, so its lines can break at other words than in RNote.
- A document with nothing that can be imported becomes a File note.
Importing from Xournal++
A document of Xournal++ (a .xopp file), or of Xournal (a .xoj file), is imported as a handwriting note in the same way as an RNote document (see above), and the same option of the import dialog keeps it as a File note instead.
- The note uses the Pages layout, with a sheet for each page of the document, at the size of that page. The paper is the one nearest to the background of the first page that has one: lined and staves become Ruled, graph Grid and dotted Dots.
- Pen strokes keep their position, color, thickness and pressure, and highlighter strokes become highlighter ink. Black ink becomes ink in the Text color, so it stays readable in a dark theme.
- Images keep their position and size, and are saved as attachments of the note.
- Text becomes text boxes at the same place, keeping its size, line breaks and color, and is bold or italic when its font is. The text takes the font of the note, so its lines can break at other words than in Xournal++.
- The layers of a page are merged, with their ink in the order of the layers.
- Xournal++ keeps the PDF under the pages in a file of its own, next to the document (such as
Lecture.xopp.bg.pdfforLecture.xopp). To bring it along, put both files in a ZIP archive and import the archive: the PDF is saved as an attachment of the note and its pages lie on their sheets, as after Insert PDF (see Writing on a PDF above). A PDF that Xournal++ names by its full path on another computer is looked for by its file name, in the folder of the document within the archive. Without the PDF, the sheets keep the size of its pages but are blank. - LaTeX formulas are left out, apart from those that older versions of Xournal++ saved as pictures, which become images. A document with nothing that can be imported becomes a File note.
Technical information
To see how smoothly a note draws (for example before reporting that writing or scrolling feels slow), open the menu of the toolbar and turn on Technical information. A panel in the corner of the note then shows, twice a second:
- The frames per second at which the page is drawn, and the time of the slowest frame. A screen at 60 Hz shows a frame every 16.7 ms, and one at 120 Hz every 8.3 ms.
- The time it takes to draw the stroke in progress, while one is drawn.
- The number of strokes in the note and the number of tiles that hold the ink around the view.
- The size of the note's surface in pixels of the screen, and the pixel ratio of the screen.
The panel stays on for every handwriting note until the application is reloaded.
Limitations
- A selection cannot be rotated, and its strokes and images keep their place in the drawing order when they are moved.
- Where a highlighter stroke crosses itself, erasing a part of it can leave two pieces that overlap, which show darker where they do.
- A shape becomes ordinary ink once the pen is lifted: it can be moved and resized with the Select tool like any ink, but not reshaped.
- An arrow is recognized only when it is drawn in a single stroke, in the order described above.
- Handwriting is not converted to text, so search does not find what is written.
- Outside the note itself, only a picture of the first page is shown (see Previews above), and a handwriting note shared on a page of its own is not displayed.
- The buttons of a pen work only if the tablet driver reports them as mouse buttons. A button mapped to a keystroke has no effect.
- On an iPad or iPhone with a 120 Hz screen, Safari shows web pages at 60 frames per second, so the ink trails the pen further than in a native app. To draw at 120 frames per second, open Settings → Apps → Safari → Advanced → Feature Flags on the device, turn off Prefer Page Rendering Updates near 60fps, and force-quit Safari. The flag applies to every website in Safari.
- Images cannot be rotated or cropped, and always lie under the ink.
- The pages of a PDF are pictures: their text cannot be selected or searched, and their links do not work. Zoomed in beyond about 200%, or 100% on a high-density screen, they are less sharp than the ink.
- The pages of a PDF cannot be reordered, removed or rotated, and a note with its ink cannot be exported as a PDF yet.
- Adding, moving, editing and deleting a text box cannot be undone with the undo button, and the text boxes always lie over the ink.
- A box showing another note lies under all the ink, also the ink written before the box was added. Adding, moving, resizing and removing a box cannot be undone with the undo button, and the boxes are left out of the picture of the note (see Previews above).
- Other kinds of content, such as shapes that stay editable, cannot be added. For those, use a Canvas note.
Under the hood
A handwriting note is stored as JSON that lists the objects on the paper from the lowest to the topmost, as well as the sheets with their size and the page of a PDF that lies on each. An object is a stroke with its color, thickness, pressure sensitivity and points, an image with its position, its size and the address of its attachment, or a text box with its position, its width and its text. Each object has an identifier that it keeps for as long as it exists, and the time at which it was made. To inspect the JSON, select Note source from the Note menu.
Internally, a handwriting note is a Code note with the media type application/vnd.triliumnotes.handwriting+json. A version of Trilium older than handwriting notes that syncs with the same document therefore leaves these notes intact, and shows them as code notes holding that JSON. Do not edit them there.