OliverBalfour / obsidian-pandoc

Pandoc document export plugin for Obsidian (https://obsidian.md)
MIT License
692 stars 57 forks source link

Emoji from Obsidian markup to LaTeX via Pandoc #193

Open voltel opened 1 year ago

voltel commented 1 year ago

Feature request: In Obsidian, the community plugin Emoji toolbar (see GitHub repo oliveryh/obsidian-emoji-toolbar) enables inserting emojis into Obsidian markup. Unfortunately, I didn't find an easy way to export a document with emojis into LaTeX (to produce PDFs) in a sensible way.

One way, though, is through using the LuaLaTeX pdf engine. As far as I understand, it's impossible to recreate this approach with XeLaTeX pdf engine, which is used in obsidian-pandoc by default.

With the following Pandoc command-line options, and the code snippet in the LaTeX document (I inserted that manually), I managed to get the desired result -- a PDF with valid emojis.

Pandoc command-line options:

--template voltel_article.latex
--pdf-engine lualatex

LaTeX snippet:

\newfontfamily\emojifont[Renderer=Harfbuzz]{NotoColorEmoji.ttf}
%Use \emojifont in a group to keep its effects local
{\emojifont \Uchar"1F6AA}

I had the font installed from here: https://fonts.google.com/noto/specimen/Noto+Color+Emoji

The whole idea is provided here: Oveleaf site

Can this transformation of the Unicode symbols outside the Basic Multilingual Plane into the LaTeX markup be done by obsidian-pandoc plugin to produce the LaTeX markup capable of being built into PDFs with proper emojis.

keyvanm commented 4 months ago

Seconded