Embedding HTML in MD for manual page breaks

It doesn’t look like Bear and Lettera support the following:

Am I missing something to force a page break in an MD file. In the PDF export it just remains as plain text and is hidden in an HTML export but doesn’t appear to do anything different.

I’m going to have 10’s - 100’s of pages in a single MD file and would like to insert page breaks when exporting ideally as a PDF but I can export as HTML and then print and open in Preview.

If someone knows of another way to do this, I’m open to anything. I will also need to combine MD files either as MD or whatever export type I decide to go with. I could export to docx and then open with Pages and expect I’ll have some additional workflow beyond MD but one step at a time.

Ideally I’d like to be able to insert page breaks with MD but may end up using it strictly to capture text and other assets and deal with formatting afterwords.

thanks all -tom

Markdown is not layout-aware by design. Your best bet to write in markdown and still leave “make manual page break here” hints work is to convert to another format and use a ‘preprocessor’ script that takes something you invent and turns it into a page break in the target format.

Concrete suggestion: use pandoc to convert from Markdown to PDF via LaTeX, and have it inject page breaks during the Markdown→LaTeX→PDF conversion.

Pandoc is so widely used that there are community scripts for this:

There are also other tools that can help you and don’t require scripting, e.g. Marked is a popular Mac app to preview Markdown files and print them, and you can have manual page breaks there:

Bottom line is: pick how you convert to print, first, then look for ways to teach it to page break manually.

Thank you @ctietze .

I looked at both of those and Marked 2 is what I’m going with. I also am going to use PDFGear for adjusting image size & postiion and then cleaning up blank pages which can occur due to image placement.

Maybe I’m simply looking to make my writing more difficult because I could just use Pages but I use another Journaling app called Diarly which is using Markdown too and it’s just a joy to write with. Granted I could have used Bear too but the calendar based daily entry creation along with other helpful UX is great. I use Bear for note taking and is the best note taking app out there even before v2.

I’ll have to read up on it but what John Gruber was solving when he created Markdown as he and I would guess others will be printing or presenting their writings to others but that’s another day.

It all makes sense. Lettera does recognize the setting of size on images though yet gets lost on export except to HTML.

But I also want page numbers , headers & footers including borders for those too.

Between my two add-ons, I now have a workflow process yet changes might be time consuming. I do break down each chapter into separate MD files so it should be manageable.

What’s funny about all this, I could do it all in Pages and use one app but quite honestly things like typewriter mode and breaking down my doc into more manageable pieces along with quality and focus of the Shiny Frog team makes me want to get writing more again. This is what happened with Bear and Diariy too. Purpose built apps vs general-purpose bloated apps feel better when all the noise is removed.

I wouldn’t mind having an export option that combines my MD files into one but that presents an ordering complication which I can solve with Marked and other solutions. Having more control and separating functions (writing, presentation, etc) adds more time to the process but having that separation also provides me with finer control of each step.

In essence I’d be doing all the work somewhere whether in a single app or many.

It also forces me to simplify which is harder because I’m forced to rethink what’s really needed.

I have a lot of respect for the Shiny Frog team because simple is hard and requires folks to stick to their principles.

There’s been a lot of discussion around the sidebar but once I figured out its behavior I am able to leverage that and it actually works well. Using files and the OS file system actually can make it really simple and I’m not convinced you have to rewrite Finder in the app. It puts the organization back into my hands and using what Apple already provides as part of their Window subsystem makes it easier & simpler for all but I digress.

thanks again for the help. -tom

Marked is quite powerful; version 3 came out a few weeks ago. I use it for HTML conversions to paste articles in non-markdown compatible CMSs, as well as creating ePubs to upload to a Remarkable.

For combining multiple files into one, you want a transclusion file that lists all to-be-transcluded files in order, or at least have number prefixes for a stable sort order in filenames. Assembling 1 file from many selected files in Lettera would then be an Apple Shortcuts call away (if we had Shortcuts support already :sweat_smile: )

I renamed your discussion title to make finding the “manual pake break” topic easier in the future, hope that’s ok with you.

For transclusion/combining multiple files, feel free to open new discussions! The more the better :slight_smile:

thank you. I am using Marked 2 and it does exactly that, I create an MD file with a list of other MD files to combine in the order I want. It than pulls them all together.

I have come across some memory issues but haven’t zeroed in on the culprit but I think the Marked doc says some of this processing can take awhile especially when exporting; so, we’ll see.

I’ll take a look at those shortcuts too, thanks.

btw, no issue with renaming the post, all good.

That’s where Scrivener excels. Are you planning on offering such a feature?

If you do, transclusion is probably a term that few people have heard. I always think of it as concatenate, using the cat command in Terminal.

You and me both, but that’s the technobabble that made its way on the internet, so better mention it here when looking for tools that can do the thing OP requested

1 Like

While on the topic of transclusion…

It would be nice to have this in Bear as well. I have lots of snippets dotted around Bear, and it would be nice to have a place where I could include these snippets in other notes so that when I make one change, it displays in all those locations.

Please post in Bear Feedback so it’s in the right place for the right people!

I’ve always thought of concatenate as appending/merging and transclusion as including the dynamic “live” content of one document into another while still maintaining the two separate documents.

yea, I used Scrivener many many years ago and at some point the version I had was no longer available as I changed computers and had to pay full price again for the latest version. It is a powerful app for sure and more than I need. It’s also $60 now (which is cheap if you use it often). I didn’t purchase Marked v3 because it’s $70 and although much enhanced from what I can tell (have the trial) I don’t want to be having to buy 2-5 apps to put my workflow process together. And I know, just buy one, Scrivener. Maybe someday I will but right now, I want to give Lettera a try and I can always use Pages.

Right now, it’s going to be Lettera (editor)->Marked (page breaks, some header and footers)->PDFGear (image sizing and positioning, page #'s, more header & footer - longer story).

Marked 2 was only $14, PDFGear is free, and Lettera for now is free but will purchase if reasonable like Bear.

This “book” is a collection of field notes I collected as I am a Birder (Twitcher in EU). I do have other writings I’ll be doing as well some very small, 1-pager and other 100’s.

-tom