Why does the preview of code suddenly not appear in preview pane?

For some reason, the result of code I am drafting does not show up in the preview pane. By that I mean nothing shows up in the preview pane even when I put the code back to the last time the preview shoed the effect of the code.

Hi. The first thing to try is to reload the page. The next is to comment out everything, until the document is empty, and then revert parts of content until it doesn’t work again. If there are no errors, then it’s probably working correctly, and you just have different behavioral expectations toward a piece of code.

It might also be the problem that the wrong .typ file is selected for the preview. Check if the eye icon is next to the correct file in the sidebar:
image

Usually, if an auxiliary/template/utility file is selected for the preview (eg. template.typ) the preview is empty as that file generates no content.

(You can choose a file for the preview by clicking the “closed eye” icon next to the file.)

1 Like

Thank you all for your helpful responses. Turns out there was an errant # in the code. It was pretty far down the document but it caused the preview pane to be completely blank even though the code before the # was good.

1 Like

Typst always compiles your whole document, not just a part. If any part of the document contains an error, Typst can’t update the preview. Always look out for the red exclamation mark in the left sidebar :slight_smile: