pandoc / dockerfiles

Dockerfiles for various pandoc images
GNU General Public License v2.0
364 stars 98 forks source link

Latex error with emojis #215

Closed cmahnke closed 4 months ago

cmahnke commented 1 year ago

Latex doesn't seems to be configured probably:

docker run --rm        --volume "$(pwd):/data"        --user $(id -u):$(id -g)        pandoc/latex:2.6 protokoll.md -o outfile.pdf
Error producing PDF.
! Package inputenc Error: Unicode character 😉 (U+1F609)
(inputenc)                not set up for use with LaTeX.

When running with --pdf-engine=xelatex:

[WARNING] Missing character: There is no 😉 in font [lmroman10-regular]:mapping=tex-text;!
daamien commented 1 year ago

Hi @cmahnke !

Emojis are not supported by the pandoc/extra variant.

Adding Emojis to the variant is not a simple task. It would required adding a font family that contains emojis such as Noto, but these kinds of fonts are HUGE and would probably double the size of the docker image.

https://fonts.google.com/noto/specimen/Noto+Emoji

cmahnke commented 1 year ago

Thanks, I also thought about it and it might be related to #29 ? How about updating the entrypoint to let it either check if required files are there or otherwise download them, if a parameter is provided? Example:

docker run  --volume "$(pwd):/data"  --user $(id -u):$(id -g)   pandoc/latex:2.6 --fonts=emoji,cjk protokoll.md -o outfile.pdf
daamien commented 1 year ago

yes this is related to #29. In facts, emojis is just another non-latin charset and could be treated like chineses, persian, russian, etc.

If we were to support emojis, we would probably create a dedicated variant that would also support all the main international charsets... But again this requires a significant amount of work and testing...

Regarding your last question : I think we should keep the entrypoint as simple as possible and avoid coding too much logic inside it. Especially in that case : downloading content on-the-fly is probably not a good idea.

However here's 2 ideas to look for:

https://tectonic-typesetting.github.io/en-US/ https://ctan.org/pkg/emoji

https://pandoc.org/MANUAL.html#option--epub-embed-font

tarleb commented 4 months ago

Closing; please use a custom image to include additional fonts. The README contains an example.