Import Markdown into Scrivener (with Tables)

Trying to make tables in Typst is a nightmare.

Yes, I know. But I didn’t want to make a new thread.

For standard tables, just use Scrivener: Scrivener tables becomes Markdown becomes Typst. This is the point for most workflows, to take advantage of Scrivener’s markdown support and isolate you from having to hand-code anything, and Scrivener tables are default if you import from RTF anyway.

For specialised tables then yes, you need to probably write in raw typst, which if you are used to HTML is clearly different, but not necessarily ā€œworseā€ IMO.

For example some HTML like:

  <tr>
    <td class="tg-0lax">Evelyn Archer</td>
    <td class="tg-0lax" colspan="2">Office</td>
    <td class="tg-8zwo" colspan="2">Remote</td>
    <td class="tg-0lax">Office</td>
  </tr>

Looks like this in Typst:

[Evelyn Archer],
    table.cell(colspan: 2, Office),
    table.cell(colspan: 2, Remote),
    Office,

But in theory you may not even need any markup, for simple tables Scrivener should suffice…

3 Likes

I was mostly messing with Typst because it exports to a PDF with a TOC, but I don’t use it much otherwise.

I love CSS and find it beautiful and elegant; the way rules cascade, semantic selectors, dynamic rules etc. But for print layout, paged CSS is less powerful than dedicated page layout tools like LaTeX and Typst. While I use LaTeX, decades of technical debt and layer upon layer of complex accumulated cruft and a language designed nearly 50 years ago make it hard to use for general users. Typst is just a few years old, and while PrinceXML is the ā€œbestā€ paged CSS engine (and Javascript support for dynamic control is mostly useable), Typst already exceeds its capabilities. As Typst is a programming language, extensions available in Typst Universe dedicated to page layout and graphical presentation and a dedicated core of users who can solve problems make it, IMO, the best visual layout system for print layouts.

2 Likes

All I wanted was a button in the web app to add a table, TBH.

Concerning tables, I will again say loud how much I love (and need) something like list tables. I deal with long and complex tables, to be translated in multiple languages, and the basic grid table format is unmanageable.

This is how I dealt with them, and maybe there is something that can be of use related to Scrivener.

Paolo

1 Like

I had the idea of making a Python script that produces .md files. The script itself would produce the tables. One issue I’ve been having is with importing docx and rtf (converter errors), but I’ve found a workaround with copy-pasting the compiled DOCX or RTF.

I solve this (in both the web app and Scrivener) using Espanso. It’s easy to configure and works in every environment on your computer.

Since in my current project all tables (ingredients lists) have the same format and columns, that is defined in the metadata, so in the main text I have one shortcut which simply enters…

#table(
[], [],
)

… with the cursor automatically placed in the first cell, ready to enter the data. Having filled in the cells, at the end of that line I then use another shortcut which puts in a carriage return and another row with two cells, again with the cursor ready in the first cell.

If all your tables in a project are the same, like mine, it is easy. If I needed to have tables with different configurations, I’d make another shortcut that entered the configuration fields and the first row with two cells set up, and another shortcut to simply add a single cell. Four easy-to-remember shortcuts would do the whole thing.

:slight_smile:
Mark

I’m glad that Espanso has a Windows version! I might give it a go for Typst, since I’m terrible at memorising metadata.

As you are a programmer (which I am not!) you should find it easy to set up. For my ā€œtriggersā€. I use a semi-colon immediately followed by two or three letters. I have it set up for quite a number of Typst code snippets.

:slight_smile:
Mark

Well…

Secret

I just vibecode in Python. I’m not a trained dev.

I couldn’t even do that! (I don’t even know how to make a ā€œsecretā€ like that!)

:rofl:
Mark

Use the + button in the editor to add secrets.

1 Like

Ah…

Secret

I had no idea about that; I hadn’t even noticed a + button!

Anyway, let me know if I can help with Espanso and Typst.

:slight_smile:
Mark

1 Like

I’ll shoot you a PM!

1 Like
Secrets...

…within Secrets.

3 Likes

Hi, Amber! Nice to see you here!