Zettelkasten Forum


Help with Printing/Exporting Zettels from the Archive

**TLDR: I want to create a macro to print a stack of Zettels from the Archive onto A6/4x6 cards. **

I've hunted around the forum here a few times, but wondering anyone can start pointing me toward the right direction.

The User Experience

I love The Archive and Zettelkasten method. But sometimes I just want to print off a pile of my cards when I'm going to do a writing project. There's just no equivalent to the tactile experience of having 10-20 cards on a desk, shuffling them around, pinning them to a board, etc.

Of course, this is possible in an analog Zettelkasten. But I like having my digital Zettelkasten 90% of the time. I just want to occasionally recreate the paper version from time to time. Or even to have a completely paper backup. I'm not a Luddite! But paper is nice.

The Idea

I'm looking for an easy way to bring these two together. I'd like to be able to simply convert a Zettel from the archive into an A6 (4X6 index card PDF) with a basic format: Title in the upper left, Zettel ID in the upper right, body and references in the center, and tags either at the bottom or under the title.

Even better if after running a search in The Archive, I could highlight 10 or 12 Zettels, and run a macro on Keyboard Maestro to compile that stack in a single PDF that I can then print. It seems like this could be easily doable through Pandoc or LaTeX, but the learning curve for formatting an A6 card is very steep. And I don't know how to extract the Zettel anatomy: Title, ID, Tags. And after repeated attempts, I have not successfully been able to make a keyboard maestro that can automatically run Pandoc.

Can Anyone Help Me?

This probably just exposes that I'm really way in over my head with automation and coding, and that I'm really not at all a programmer. But I'm hoping that someone here would find this laughably simple. It seems very straightforward in theory.

Has anyone else attempted anything like this? Is there anyone here who might be able to help me track this down? I'd gladly share the finished product here in case there's anyone else here (like me) who want to, from time to time, take a portion of their Archive completely offline.

Comments

  • @rydash88 I think I could use this same capability as well. I don't know how to do it, though...so I'll wait (patiently) hoping someone else does :smile:

  • @rydash88 you’re not alone; I’ve been looking for a way to print zettels as well. A specific format for printing, and ability to print 4-up per page would be fantastic.

  • Printing comes to The Archive!

    Printing a digital zettelkasten note from The Archive turns out trivial pretty damn complicated. There is a relatively high geek factor in this. Formating each note, so it looks pleasing to each note author is much harder.

    If you have any tips on how to improve this process, please let me know. Comments, criticisms, and your questions are welcome.

    Here's my attempt. It seemed easier when I created the macro. It sure isn't very easy to describe the setup. I hope I haven't missed anything. There are many steps to describe, and why it seemed initially easy for me because I had all these things already installed and working on my system for other projects, you might already have these apps installed, which will make it easy to print cards.

    Setup

    1. Homebrew
      brew install pandoc
    2. Install Latex - BasicTeX as a minimum (MacTeX if you want the package)
      https://sourabhbajaj.com/mac-setup/LaTeX/README.html
    3. Set ENV_PATH variable in Keyboard Maestro
      /usr/local/:/usr/local/sbin:/usr/local/opt/pandoc/bin/:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin
    4. Set variables in Keyboard Maestro Macro

    Keyboard Maestro Macro
    Printing

    There are three commands in the Execute Shell Script.
    1. cd
    2. pandoc
    3. lpr

    You could get away with just executing the pandoc command and then printing the resulting PDF. You'd still want to install pandoc and Latex.
    pandoc --pdf-engine=xelatex -V geometry=a6paper -V geometry=landscape -V geometry:margin=.9cm /path-to-file.md -o /destination-path/target.pdf

    Will Simpson
    I'm a zettelnant.
    Research areas: Attention Horizon, Productive Procrastination, Dzogchen, Non-fiction Creative Writing
    kestrelcreek.com

  • 😆 You continue to surprise with your KM tricks! What a neat idea!

    I didn't know you could tell the printer to print directly via the command line.

    My OCD forbids me to print without checking, so I would adjust the macro to open the PDF in Preview.app and print from there to avoid ugly notes :) But I really dig the format of the print-outs. LaTeX's defaults have an artisanal quality already, and the landscape format looks like a straight-up invitation to


    For a truly temp output path, you might want to look into the mktemp program. With the -d flag, it creates a directory, and with the -t PREFIX setting, you can customize the file name:

    $ mktemp -d
    /var/folders/62/8k21681d08z9lhq8h433z3rh0000gp/T/tmp.5XuikGGC
    
    $ mktemp -t printzettel
    /var/folders/62/8k21681d08z9lhq8h433z3rh0000gp/T/printzettel.SxsMDkHI
    

    Pandoc apparently takes care of the .aux and .log files during conversion on its own, so a directory might be overkill and dropping the -d flag could work as well; here's how I tried to put the output.pdf in a temporary folder:

    cd $KMVAR_zettelkastenPath 
    destination=`mktemp -d -t printzettel`
    pandoc --pdf-engine=xelatex -V geometry=a6paper -V geometry=landscape -V geometry:margin=.9cm "$KMVAR_noteName.md" -o "$destination/output.pdf"
    open "$destination/output.pdf"
    

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

  • @ctietze said:
    My OCD forbids me to print without checking, so I would adjust the macro to open the PDF in Preview.app and print from there to avoid ugly notes :)

    I know what you mean. I have a pile of 'ugly notes' from my trials. I used my pseudo temp location as a way to look and preview the format. ~/Downloads/ is my dumping grounds anyways and is periodically flushed.

    Thanks for the mktemp tip. It will make the macro more elegant.

    cd $KMVAR_zettelkastenPath 
    destination=`mktemp -d -t printzettel`
    pandoc --pdf-engine=xelatex -V geometry=a6paper -V geometry=landscape -V geometry:margin=.9cm "$KMVAR_noteName.md" -o "$destination/output.pdf"
    open "$destination/output.pdf"
    

    As I posted the comment, I discovered another way to print that is far less technical but far less configurable. You can print from your "Open with External Editor". Print from, say, Marked2 or IA Writer; you'd be restricted to their formatting options and your printer's capabilities.

    Printing sure is a mess.

    Will Simpson
    I'm a zettelnant.
    Research areas: Attention Horizon, Productive Procrastination, Dzogchen, Non-fiction Creative Writing
    kestrelcreek.com

  • @Will

    Why not just open the note in iA Writer or some other app that handles Markdown (like Scrivener) and go from there? Is it necessary to print from within The Archive?

  • It is not necessary to print at all, let alone from within The Archive.

    Until now, we've not been able to print from within The Archive, and it has not been a hindrance. Printing used to involve every time you wanted to print; you'd have to open a "note in iA Writer or some other app that handles Markdown (like Scrivener) and go from there." Now you don't have to do this; you can print right from within The Archive.

    Will Simpson
    I'm a zettelnant.
    Research areas: Attention Horizon, Productive Procrastination, Dzogchen, Non-fiction Creative Writing
    kestrelcreek.com

  • Now that you bring up printing via "External Editors" -- one could whip up an .app bundle based on the pandoc and printing steps you figured out with Automator. The resulting .app can then be added to external editors to print from there.

    All that being said, I'll be adding a more sensible printing option to The Archive based on the upcoming MultiMarkdown editor update, too. The default was just bonkers, so I disabled that early on, and now we're 3 years in, phew ...

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

Sign In or Register to comment.