Simplest support for PDF (for print) and epub?

Inexperienced with Scrivener, but it looks promising. I published a technical book this year which I wrote in LaTeX, but I am about to begin another, and hope to find a reasonable tool set with fairly simple workflow to deliver both a PDF suitable for KDP or Lulu, and an epub, as well.
Things looked good until I found there seems to be no way in Scrivener to set a custom page size, nor to manage inner and outer margins. Is that correct? Or have I simply failed to find the right place?
I would guess I can select letter size, then set larger than normal margins to approach what is needed for print, except for the inner/outer issue.

Would greatly appreciate help from anyone who has gone down this path.

I’m not sure why you are posting in the Markdown+LaTeX forum as it sounds from your question you just want to compile directly to PDF and separately to EPUB?

For direct PDF output from Scrivener, check whether Scrivener 3 on Windows support PDF Page Options in the compiler or Project Settings?:


If you are looking for a LaTeX or Markdown workflow, then you can control the page geometry as you prefer using the LaTeX preamble and/or HTML templates; depending on what workflow you are looking for?

Sorry to say, the entire Pag Settings entry is missing from the list.

As to why I posted here, I am at ease with Markdown, and I recognize that Scrivener can output PDF and epub, and anticipated it more likely to find knowledgeable people here.

Make sure you are set for PDF. Epubs don’t have pages. So… no page settings.
image

@nontroppo’s answer seems accurate to me.

I was correctly set to PDF in the Compile Overview, but had not found my way to the Compile Format Designer. I do see it now, and will explore the possibilities in the morning.

Thanks!

@wmeyer — give the native PDF output a try and see how that works for you. The benefits of the direct Scrivener formats are more WYSIWYG, clear visual GUI for tweaking the compile; these Compiler tools should work for 94.78% of most needs. Read through §24.20 of the User Manual.

If you do not care for WYSIWYG, or prefer having a more tweakable markdown workflow, then the question of layout gets deferred to the tool you want to use (LaTeX, PrinceXML, Adobe ICML etc.), and that depends on what you’d be most comfortable with.

The native PDF is good, but for the fact that it appears the Windows version lacks support for placing chapter start on the recto page. That’s a full stop for me on this project.

Also noticed that text I have formatted as italic loses that in the compile. Similarly, a word set to a different font for emphasis, appears in the PDF in the paragraph style’s font.

The epub also seems good, but with issues on bulleted lists, which get a span in the format, for some reason, and it buts the bullets behind the text.

These seem like basic issues, and I am struggling to understand why they should need special handling.

It seems unlikely, but I am wondering whether it may be better to work in MMD?

Well I expect the chapter start features should be coming to Windows (it is supposed get to feature parity?), and in the mean time you could just add blank pages in a PDF editor?


The compiler is a deep tool with a lot of flexibility, if you want you can transform italics to underlines, remove emphasis or change it a color etc. It does take some time to grok the workflow. However regarding something like italics or emphasis I cannot reproduce, here is the editor text and resultant PDF using the PDF → Modern format (I replace Avenir with “Alegreya Sans” as Avenir is a poor font with fake italics etc.):

Scrivener replaced my editor font (a serif) with Alegreya Sans, and still both the RTF inline formatting (including small caps typography) and the emphasis character style is present. If you can’t see that (using the same compile format, remember some formats will strip features), make a sample project and we can have a look…


EPub, I’m sure others may have a solution to the list problem. In general I think the quality of the underlying HTML is better via Pandoc but this is not really an issue for most people.


Overall, I suppose the way I balance this:

  1. You want to just write general material without too many tweaks or features, and would like to not resort to using code to modify layout: Use Scrivener’s native outputs — remembering Scrivener is not a layout engine and customisation is limited. You can tweak any remaining issues in a PDF editor or EPub editor like Calibre. This is probably what most authors using Scrivener do.
  2. You are happy to do work with layout in a dedicated program: Use a format that Adobe Indesign or Affinity Designer can import, and spend your time there. Markdown > Pandoc can export Adobe’s ICML which means you get lots of structure carried over, but there is still work to do. Or get someone else to do the layout for you.
  3. You are comfortable with using a LaTeX template or tweaking CSS, or you know you are happy with default LaTeX class output and default EPub from e.g. Pandoc. Or you need to do things (like a bibliography, index etc.) that Scrivener can’t. Then a MMD workflow is great. There is a huge amount of control available under the hood, but it means you need to comfortable with a spanner :stuck_out_tongue_winking_eye:

As you have some previous LaTeX experience then an MMD > LaTeX workflow seems doable, and you have to decide where you will be most comfortable.

1 Like

I appreciate the detailed response. I will find some time today to see whether I can replicate the font behavior you report here.

I think that MMD may be the path I need to explore. It seems like a restart, in some ways. At the moment, if I can resolve my editing concerns with MMD and produce acceptable PDF from Scrivener, then I can accept using Pandoc as a solution to produce epub. My main concern is to avoid the need for two separated documents to achieve PDF and epub. The book I published was all in LaTeX, using the kaobook template, which is a Tufte variation. I was very happy with the result, but of course, it meant reformatting all of my text in a different tool to get to epub. If I am going to continue publishing, I need to be more streamlined.

I have Affinity Publisher and Designer. Can’t use Publisher, as it lacks support for footnotes or endnotes. If they would remedy that, I might commit to that tool, but again, I would lack a solution for epub.

I guess if I were wiling to subscribe to Adobe tools, I could get both output forms from InDesign, but I loathe subscription products.

Yes, if you want to follow the one-source → many-outputs philosophy then Markdown is a great base format to work from. No need to change your work at all, just apply different settings and templates to get multiple outputs.

Looking through the Scrivener User Manual project (the macOS version of the manual is the only one with the project source available IIRC), or my recent Quarto Template example or scrivomatic workflow will give you the idea of how to write with Scrivener-native tools (styles, section types, table, lists, links, cross-references), and get these transformed to markup useful for the next step. You don’t need the tools installed just look through the Scrivener project and the compiled PDF to see what is going on behind the curtain. For any MMD/TXT compile, Scrivener’s Styles and Section Formats are the main key.

As you have some previous LaTeX experience, both MMD and Pandoc use templates for LaTeX, so you can edit a template and compile to PDF as you wish[1]. Pandoc has a large bunch of metadata variables which can modify the LaTeX for you so often you may not need to actually look at the template (changing document class, class options, fonts, link colors etc). TeX can be obtuse and infuriating, but there always seems to be a solution to any problem a few searches away.


[1] There are also tools to transform HTML to PDF using CSS Paged Media, this means you can export to PDF and EPub using the same intermediate format applying different CSS rules to the content (see https://print-css.rocks for an intro and there are many other resources on CSS Paged Media out there). So a MD → HTML → PDF route is very viable (I’ve used Pandoc → PrinceXML before, Pandoc also recently added PagedJS as a new PDF engine too: Paged.js — Made with paged.js).

Regarding Pandoc → ePub (which you’ll see added to the Compile for dropdown after installing Pandoc and restarting Scrivener), one trick to know about is that if you have it create an .epub without providing a stylesheet, then it will insert a sensible starter for you. Using the “Basic Pandoc” compile format, in the left sidebar, will give you that result.

You’ll probably want to make the design your own though, and maybe you like indents instead of spacing for paragraphs, et cetera:

  1. So after creating a test .epub, open it up in Sigil and copy the contents of the “stylesheet1.css” file.
  2. Back in Scrivener, go into Compile, and double-click on the Basic Pandoc format to edit it.
  3. Select the Pandoc Options section, and paste the CSS into the “Custom CSS” field.

Personally I like to design in Sigil, because you get real-time feedback in the preview pane. Once I design an element the way I want, I copy and paste into my compile settings and build a new .epub to make sure the whole book looks good with that tweak, and move on to the next batch of adjustments.

1 Like