I want to write a simple article using an editor that seamlessly renders as I type, and control typographical details.
Example
Write main.md:
```{=typst}
// typst here
#import "template.typ": project
#show: project.with(…)
```
# Heading
markdown here.
```{=typst}
#figure(
table(…), // some complex table
caption: […],
) <tab>
```
You can reference the figure as `@tab`{=typst}.
Convert it to main.typ by running pandoc main.md --from markdown+raw_attribute --output main.typ. (pandoc.org/try.)
// typst here
#import "template.typ": project
#show: project.with(…)
= Heading
<heading>
markdown here.
#figure(
table(…), // some complex table
caption: […],
) <tab>
You can reference the figure as @tab.
Maybe this is obvious to someone who has more experience with Pandoc, but can you explain a bit more of the Why?
There are several options for editors that render a Typst document as you type, and of course Typst allows a lot of control over typographical details.
Hmm, I mean live previewing without a preview window, e.g., Typora, Obsidian for markdown and LyX for LaTeX. As far as I know, there is no such editor yet for typst?
I don’t know about the other editors you mention, but at least for obsidian there is a typst plugin which has worked for me in the past (just remember to enable the “override math blocks” setting, otherwise math blocks will use latex syntax by default)
Edit: I just realised this wasn’t posted in the #questions category. whoops.)
Thanks for sharing it, but it does not provide live previewing without a preview window. If I read its docs right, then it just gives results below typst code blocks.
Personally, I would like to stay in Markdown for as long as possible, until I need the control over typographical details. Markdown is super handy for all kinds of things.
Typst could not support the level of control it does if we were limited to Markdown, but it’s nice there’s a way to get at least a preview of markdown documents before we give them the full Typst treatment.
Hi! I’ve heard TyX before and I appreciate your work. However, TyX seems not quite the same as the kind of editor I expected. TyX uses a *.tyx format, which looks like a wrapper of *.typ. I guess it’s a trade-off made for the scripting capability of typst?
Typora’s design is as follows.
I can insert HTML fragments between regular paragraphs by entering <tag>…</tag>.
If my cursor is outside the HTML, the HTML is displayed as the result. (screenshot #1)
If my cursor is inside the HTML, the HTML is displayed the source code. (screenshot #2)