# Exporting Notes to PDF or HTML

First a confession.
We all have varied use cases for maintaining a Zettelkasten. One of mine is probably not what was originally intended. I have been writing a commentary on the 12-century Tibetian texts called Lojong Slogans. There are 59 of them and my commentary is intended to be only 500 words or so. So The Archive seemed prefect. Having them in separate notes helped with the workflow in establishing some commentary and in revising it. Each of these 59 notes has been obsessed over unlike any of my other notes. Reviewed and revised so far 3 times each.

Now for the questions and requests for help.
My current plan is to see if I can extract these notes and compile them into a single PDF and/or HTML code. Sounds simple yet I'm not sure exactly how to preserve formatting nor how to preserve the inter note links? (All links reference other Lojong slogans.) There are 59 slogans and one table of contents note. Also, each note has an associated image (link to a file in the media folder). How might this be extracted from the media folder and placed in a PDF and/or HTML?

What I've done so far.
Use The Archive to "reveal in finder" the 60 notes and copied them to a directory where they can be safely be worked with without danger to other notes or originals.

What is the next step?

Note Format
1. Title
2. Number
3. Commentary
4. Footnotes
5. Links to relative Lojong notes
6. Alternate titles
7. Picture in the media file
8. Note errata

Here is a sample.

# Begin with the beginning

(1)

You have the freedom to start. Just start and see.

First, become familiar with the territory Mind-Training then develop motivations and aspirations. Create an environment in which to engage with the slogans. Stabilize your attention, be mindful in daily behavior, realize that your life is the only one you know you'll have, determine to let go of pattern-based activities, and genuinely desire to be of service to others.

Be kind to yourself. ‘Connected with the realness we are up against in our everyday lives.'

Work with these 4 traditional reflections
1. The preciousness and rarity of my life.
2. The inevitability of my death.
3. The awesome and indelible power of my actions.
4. The inescapability of suffering.

The Buddha's Five Remembrances

1. I am of the nature to grow old. There is no way to escape growing old.
2. I am of the nature to have ill health. There is no way to escape ill health.
3. I am of the nature to die. There is no way to escape death.
4. All that is dear to me and everyone I love are of the nature to change. There is no way to escape being separated from them.
5. My actions are my only true belongings. I cannot escape the consequences of my actions. My actions are the ground upon which I stand.

            Thich Nhat Hanh


Always train in the 3 basic elements ...........................[[201903220513]]
Begin Tonglen with yourself ....................................[[201903090508]]
Remedy obstacles with one intention ............................[[201904080510]]
Tonglen Instructions ...........................................[[201901200704]]

## Alternate Titles

• Train in the preliminaries
• First, do the groundwork
• First, train in the preliminaries
• First of all train in the Preliminaries
• First train in all the preliminary practices.
• First, study the preliminaries

02-28-2019 - 6:02 AM
[[201902280602]]
#slogans

Will Simpson
“Read Poetry, Listen to Good Music, and Get Exercise”
kestrelcreek.com

• Sascha and I do a lot of manual work to compile manuscripts from notes.

One thing I used at least once to automate the draft compilation is this script:
https://zettelkasten.de/posts/zettelkasten-outline-script/

The problem with automatic link following is: when do you stop? In the worst case, this could print your whole Zettelkasten, ordered in a particular way I think one could add a level-limit, like "follow links 2 levels deep" and that's it. This is not part of the outline script at the moment.

Author at Zettelkasten.de • https://christiantietze.de/

• Thanks, @ctietze. I'll give this script a try. I've been able to isolate the target notes in their own Archive. All links are internal to the 60 notes and don't link out. So they are only one level deep. I just want to create a link in the PDF, not insert the linked text.

Will Simpson
“Read Poetry, Listen to Good Music, and Get Exercise”
kestrelcreek.com

• edited August 2019

@ctietze, first pass was great. One problem. Note named 201904130501 - Adopt three key elements.txt Repeats 4-5 times. 3 in a row sometimes, once sometimes. I can't find anything unique with that file or its placement in the outline. It looks like any of the others. And there are 5-6 that are in the outline but not in the output file.

My outline file doesn't look like the example you provide but still works. I'm unfamiliar with Ruby and don't know where to start looking and tweaking. Can you enlighten me?

This is what the first part of my outline file looks like.

# Lojong Slogans

**I dedicate this practice to the universe.**

# 1. Groundwork

Begin with the beginning [[201902280602]] (1) ✔︎✔︎

# 2. The Practices

## Awakening to what is ultimately true

Treat experiences as a dream [[201903010555]] (2) ✔︎✔︎
Examine the nature of awareness [[201903020514]] (3) ✔︎✔︎
Don't get trapped by emptiness [[201903030457]] (4) ✔︎✔︎
Rest in the openness of mind [[201903040448]] (5) ✔︎✔︎
In the intervals be a conjurer of illusions [[201903050446]] (6) ✔︎✔︎

## Awakening to what is apparently true

Practice giving and receiving on the breath [[201903060456]] (7) ✔︎✔︎
3 Objects, 3 Poisons, 3 Seeds of Virtue [[201903070509]] (8) ✔︎✔︎
Always train with slogans [[201903080539]] (9) ✔︎✔︎
Begin Tonglen with yourself [[201903090508]] (10) ✔︎✔︎


Will Simpson
“Read Poetry, Listen to Good Music, and Get Exercise”
kestrelcreek.com

• Coming in late here, but @Will : I forget if you are a mac user or not, but if you are, the app Marked will do transclusion, so it will pretend that all of the files you list are one big file, and then allow you to export to whatever. So, if I were trying to solve this problem, I would make a file in that directory that lists the files to be transcluded, and view that in Marked.

If you are not a mac user, I recall playing with some other apps that had a similar feature. "Transclusion" is the magic word you want to google for, for this method.

• @mediapathic, thanks for the pointer to Marked2. Looks intriguing. I got around this part of my project by using good old cat. Concatenating all the individual files in one. But this has to be done every time one of the files is updated whereas Marked2 will handle this seamlessly. There look to be other benefits. I have been using Typora for markdown rendering but it does not have transclusion support.

Thanks again.

Will Simpson
“Read Poetry, Listen to Good Music, and Get Exercise”
kestrelcreek.com