Scrivener / Document titles / Markdown Header

Jo

03 Dec, 2019 09:37 AM

I'm a Scrivener user and I currently test Marked 2 for the first time (thx for the job).
Just one question : When I use "Include document titles as Markdown headers", the hierarchy begins with

. It's annoying because I use Pandoc as custom processor (for pandoc-citeproc) and I usually use --number-sections.

but the result is :

0.1 Document title 1
0.1.1 sub-document title 1
0.2 Document tiltle 2

I have tried to use --shift-heading-level-by=-1 but a error occurs.

How can I fix it ?

1. Support Staff Posted by Brett on 03 Dec, 2019 01:52 PM

I don't know what structure Pandoc expects, but semantically a document
should not have more than one h1 in it. There should be a title as h1,
and then chapters marked as h2, which is the way that Marked handles it
by default.

I take it that --number-sections expects every section to have an h1?
I'm also not sure how pandoc handles shift-heading-level, but if it
offers anything equivalent to MultiMarkdown's "base header level",
setting that to 2 would fix the issue for you.

-Brett

2. Posted by Jo on 04 Dec, 2019 05:37 PM

To be more accurate, two command can be used with Pandoc.

When I try "--shift-heading-level-by=-1", a message box appears with :

When I try "--base-header-level=2", it doesn't work either. Without the command Header Level 2 was 0.1. With the command, it becomes 0.0.1 (see below).

I'll pursue my research.

3. Posted by Jo on 05 Dec, 2019 08:50 AM

Solved.

It will sounded stupid but I just realised that Pandoc wasn't updated on my system.
"--shift-heading-level-by=-1 Command" only works with Pandoc 2.8.

I've upgrade and now it works.

4. Support Staff Posted by Brett on 05 Dec, 2019 02:33 PM

Excellent!

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help Blurs the current field

Comment Form

r Focus the comment reply box Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

 01 Mar, 2021 02:00 PM Rendering Mermaid 01 Mar, 2021 01:56 PM Source Line Numbers 26 Feb, 2021 02:24 PM *manual* refresh needed when using mathjax from script 24 Feb, 2021 06:25 AM pdflatex not found 23 Feb, 2021 06:39 PM streaming preview beachballs when URL is supplied

Recent Articles

 Intra-document links in exported PDFs Using Ulysses with Marked Fenced code blocks inside indented code blocks Using JavaScript in Marked Custom CSS: Writing custom CSS for Marked