I’ve come back to working on this after a long break… the family were over from Australia!
I’ve been struggling to get my trial typst project working. Basically, I’ve been trying to reproduce a couple of examples from my recipe collection. In the RTF-based original, I use tabs to create the ingredients list, but of course, with MMD etc. tabs are not available, so I wanted to use a table without borders.
I am able to do it easily on Typst.com, but I kept getting error messages with the desktop version of Typst, whether I used the Raw Typst section type or the Raw Typst style.
I’ve finally narrowed the problem down: the desktop version of Typst not only chokes if you try to set column widths in terms of points rather than fractions, it also chokes on “stroke” assignment. Using fractions for columns is not really a problem, but the default strokes are heavy and cannot be changed.
So, for the moment I am stymied. I will try communicating with the developers to see if getting the desktop version to accept stroke assignment is anywhere on the roadmap.
But I’ll carry on experimenting and learning any new enhancements, like the lapreprint.typ.
Mark, go to the Typst discord server, there is a questions section and people are generally friendly and helpful there. Do you have a minimum test case that reproduces your problem (you can share a typst online doc)? The online and desktop versions should be close to identical (the underlying code is the same engine), so it is surprising that there is a difference…
EDIT: and we can set a default to not use a stroke for the whole document:
#set table(stroke: none)
Tested with pandoc table to typst with no stroke borders, all locally. This is the markdown
# Introduction
`#lorem(60)`{=typst}
`#set table(stroke: none)`{=typst}
+-----+------+-------+
| Sun | Moon | Stars |
+=====+======+=======+
| A | B | C |
+-----+------+-------+
| D | E | F |
+-----+------+-------+
: This is a Pandoc table
`#lorem(60)`{=typst}
Command:
pandoc -s -t typst -o Test.pdf Test.md
So this should be compatible with Scrivener compiler…
I got a message that Typst had been updated and so immediately installed the new version. I’ve skimmed through the new documentation on Tables. Although, at a quick glance, it didn’t seem to be saying anything new in relation to what I was trying, the fact that many developments have been made may explain why I could create borderless tables easily on the web editor, but the same code didn’t work when I tried in Scrivener.
Sadly, I haven’t had time to spend on it since before Christmas, and with the migration of the website, I still have much to do on that before I can get back to Typst.
A really cool Pandoc 3.2 release means a nice way to generat Typst properties. This was contributed by the Typst guys as they want to take some HTML+CSS like:
<p>Here is some <span style="color:orange">orange text</span>.</p>
To generate the equivalent Typst properties:
Here is some #text(fill: orange)[orange text].
Documentation:
In another thread on making an index, I made a filter that supports a nice indexing engine for Typst (in-dexter), the output works well from Scrivener ⇨ Typst:
Typst V0.12 is out (well a release candidate), a huge release with at least two layout features that are IMO essential and make the layout engine almost feature complete:
Floating figure / table placement for multi-column documents.
Line numbering, essential for a lot of manuscript drafts.
There is a ton more in the changelog, and still quite a bit of work to go to generate tagged PDFs etc. but Typst is already incredibly useful for many tasks. They even managed to somehow speed it up, soooooo much faster than LaTeX…
Thanks for the update on Typst. It’s hard to keep up. When I started working in Quarto, I was initially excited by Typst support; however, my project relies very heavily on TikZ for causal diagrams. At the time, TikZ had not been ported over to Typst, so at that time I gave up and stuck with LaTeX as the backend. One day, I might revisit Typst. I think it has lots of potential.
CeTZ has potential, but it’s pretty new and lacking some features. At least, it was lacking features when I checked around a year ago. I should give it another try sometime. This extension looks pretty useful for arrow diagrams: fletcher
Quarto has an extension to support TikZ, both directly in HTML and in PDFs. So that is a plus. I’m not sure whether CeTZ does too.
I hear you about drawing your own SVG. I like OmniGraffle and Affinity Designer for that. For my textbook, most figures are arrow diagrams, so programmatic figures are perfect, especially if I tweak the examples then I can easily update the figure (in TikZ code) without having to revise (draw) manually.
The blog post announcing the changes for V0.12. From the discussion the cool bits are that the current changes for layout for floats should mean Typst will be well placed for layout of flowing text around shapes and images, which is one of those hard to do layout features that usually require a DTP app to handle properly…
Ian, do you have a new scrivener template for Typst which takes in the recent developments, or is the one you posted up above here still current?
I’ve had a year where many other matters, family and daily life issues have prevented me from continuing to work on Typst and I’d like to get back to it. But I’m pretty much going to have to go back to square one. So if you have a more recent update of the template that would speed the process, I’d be really grateful. If not, as I have to start again from the beginning, I’ll just build it up as I go along. from everything in this thread.
Hi Mark, I just checked the template from Oct 2023 and apart from some tiny details the compile is working, both the Pandoc>Typst and Pure Typst outputs. I continue to think the Pandoc>Typst route for Scrivener is more flexible.
Here are the tiny details:
For pandoc>typst, the gentle-clues package was updated to V1.0.0, pretty simple to edit the Pandoc+Typst meta-data file to #import "@preview/gentle-clues:1.0.0": info, success, warning, error
There is a deprecation warning that will need fixing before the next version, but it is minor and easy to change.
For pure typst compile, the post-processing command that runs typst now doesn’t support -v so that needs to be removed in compile format post-processing pane command.
Thanks Ian. Good to know. I tried compiling the Typst.scriv as pure Typst (when I finally got it opened… Scrivener kept telling me there was no .scrivproj file!… but it didn’t work and the log merely said: “unexpected argument -v found”. I hadn’t got round to seeing what happens if I delete it.
I loaded the lapreprint… file way back when along with your other lua scripts from this thread, but I’d better go and check that everything is in place still. I’ve upgraded the MBA to Sequoia; I’ve been holding off from upgrading the Mini until I’m sure I won’t have problems with other apps.
Thanks Ian. I’ve got a bit more experimenting and checking to do, and I’m away for this next week so it’ll have to wait till I get back.
At the moment, trying to compile your project, with pure Typst I’m having a problem with the bibliography, because when I put Core.bib where it says it wants it, it just gets deleted before being referenced and throws an error; Pandoc → Typst throws another error re gentle-clues even though I’ve updated it to 1.0.0, though I’ll have to check.
This is a Scrivener problem when compiling text, see @AmberV post from Nov 2023 – my workaround is to to use Finder’s “Get Info” and “Lock” the .bib file so Scrivener can’t delete it. @AmberV suggested this was fragile, but it works well enough for me in stopping Scrivener from wiping the files needed for compile.The other workaround solution is to copy files manually and running Typst yourself, but locking saves a bit of fussing…
Hello. I’m considering working in Scrivener to output to Typst. Since the last post was more than six months ago, I wanted to ask if by chance there have been any changes to the starter Typst.scriv file kindly provided in this thread, in light of some updates to Typst in the meantime?
Right, the previous version was not compiling with Typst V0.13.1[1], so I made a couple of fixes and this one compiles for me (I only tested the markdown > typst compile format
The PDF generated by Pandoc+Typst direct from the Scrivener compiler: Typst.pdf.zip (162.0 KB)
NOTE: just a reminder this won’t compile as-is on your system, you will need to change paths in the post-processing panel for markdown and plain text typst outputs, provide the lua filters or remove them in the commandline etc. For plain text (Pure Typst compile) you need to fiddle with locking the bibliography file or accepting you use typst compile after Scrivener.
[1] for geeks, Typst made a pretty major breaking change replacing an older syntax with a #context command that is used when dynamic contents like figure numbers are needed. Context is more unified and an important part of Typst: Context – Typst Documentation