Pandoc plugin for exporting & Export to PDF

I really love Logseq’s default white theme!
It would be lovely if I could export my notes as

  1. As it is displayed
  2. In paragraph format
7 Likes

Being able to export as .doc (docx), odf (Libreoffice), and PDF would be useful. Notes made in Locseq could then be easily exported and coded and analysized in qualitative data analysis software like HyperResearch, MaxQDA, or Quirkos.

5 Likes

I will vote for export a note as PDF, which is convinient for sharing.

6 Likes

Logseq is getting better every week. My only worry, now that I have migrated all my notes and articles and book chapters in progress, is that exporting to pandoc/Panwriter (for push-a-button production of pretty publishable pdf files via LaTeX) will be very complicated or even impossible. The ideal export feature would…

  • transform selected Logseq pages to vanilla markdown
  • concatenate them so they become one markdown document
  • turn references into well-formed markdown internal linksº and include embeds as simply the text that was embedded
  • not leave any Logseq-specific syntax in the exported file

Please support my request!

º Markdown can link to headings only, so page titles should become headings during export, but I don’t know what to do with references to blocks…

8 Likes

I’ll vote for this! Currently the single page markdown export can be serviceable, but is cludgy for use with multiple pages, etc.

1 Like

Can we get the option to print the notes to pdf , it would really help with submitting papers.

2 Likes

Integrating Pandoc is being looked into by the devs to allow pdf (and other format) exporting

5 Likes

I would prefer integrated Pandoc support but in the meanwhile there is this plugin:

By setting Logseq to use Computer Modern (the default LaTeX font when exporting a PDF with Pandoc) and other adjustments like using Document Mode the result is pretty similar:

2 Likes

This is VERY nice. Could you send the font link?

NewCM10Regular:

https://ctan.mirror.garr.it/mirrors/ctan/fonts/newcomputermodern/otf/

1 Like

Upvoted!

Pandoc support would be much appreciated. Especially interesting for those working in science/research and full form writers. And likely to bring interest to LogSeq from those crowds.

This might not be feasible near-term, but the LogSeq<->pandoc Holy Grail would certainly be full Pandoc readers and writers for LogSeq. In that way, conversion to/from loads of interesting formats would be possible, like:

  • markdown of various flavours
  • Org-Mode
  • HTML
  • EPUB
  • Man pages
  • LaTeX, LaTeX Beamer
  • OPML
  • various bibliography formats
  • docx, RTF, ODT
  • pdf
  • Jupyter notebook
  • various Wiki flavours

Add to that all the citation styles and formats supported by Pandoc.

And, since the LogSeq graph can then be converted to and from the Pandoc AST, the possibility to apply Pandoc filters (written in Lua or JSON) to the AST tree and, hence, to the LogSeq graph.

7 Likes

Another way to export a page relatively easy is using the ‘Doc viewer exporter’ plugin. It exports the document as a html as shown in logseq. You can open this html in Word (sadly, it does not work great together with LibreOffice). Export it to the folder that holds your pages to ensure images are included. From there, export to pdf, or open the page in Chrome/Firefox and export there as pdf.

2 Likes

Very interesting resource, it would also be very good if it was possible to create a website using the notes in Logseq, a good example is Org Mode Hello Worg, the Org-Mode Community!, it supports exporting to full HTML or PDF.

It would be great, as it could be used for public documentation, articles, blogs and other uses, even more so if it were possible to export a clean and standard Markdown or other type of format, so the HTML could be generated by a static site generator like Zola , MkDocs and the like.

2 Likes

‘Doc viewer exporter’ plugin v1.11.1 works great but its big problem is that it does not display tags.

Hi Alex. I am new to logseq, I am wondering how do you manage to print the math equations

Hi and welcome,

Logseq supports LaTeX syntax for math formulas and there are two ways to insert it:

  1. Inline: wrap the formula between two $: $E=mc^2$. This is meant to be used in the same line with other text.

  2. Block (it will be centered), you need a line with two $$, then one or more lines of formulas and then a line with two $$:

    $$
    E=mc^2
    $$

To insert a new line inside the same block, press Shift+Enter (as opposed to Enter that by default create a new block).

This is how almost all Markdown editors support math formulas.

In case you don’t know LaTeX, it’s the industry standard to produce academic documents and math ones in particular, start from here to learn it:

That guide comes from a popular LaTeX online editor, Overleaf.

Logseq doesn’t support the whole LaTex but just the math formulas and does so thanks to a popular library to display LaTeX formulas on the Web: KaTeX.

Since people often need other features from LaTeX in their formulas, KaTeX adds some “functions” to bridge the gap: Supported Functions · KaTeX

The functions above are syntax you can use in Logseq too and in other Markdown editors that uses KaTeX for formulas.

2 Likes

Thank you for your great response! (I was using the block equation before, and I didn’t know the in line one). I had some difficulty in printing the latex math equations in my logseq document. When I’m using the pdf exporting plug-in you referred to, the latex equations will be printed as its source code form instead of the displayed form. Do you have any suggestions?

With reference to the plugin mentioned above, I use Download as PDF > Print with Retained Formatting.

The other option is export as Markdown and then use Pandoc to convert it to PDF.

1 Like

Thank you! That works great! Do you mind to explain how to update the font if you have a chance?

Sure, you need to open custom.css (it’s in /your-graph/logseq folder or you can open it from Logseq settings) and add the following.

This one if you want to change the font only in Document Mode (the one you activate with t d shortcut (press Esc, then t then d)) like me:

:root :is(.document-mode){
  font-family: "Only Emoji", "NewComputerModernMath", "cmr10", "Noto Sans";
  font-size: 20px;
}

Or use this one for the whole page content anyway:

{
  font-family: "Only Emoji", "NewComputerModernMath", "cmr10", "Noto Sans";
  font-size: 20px;
}

In case you also want to hide block&page Properties in Document Mode:

:root :is(.document-mode)  .block-properties.block-properties.block-properties {
    display: none !important;
}

Of course you need the font I linked installed in your system.

3 Likes