aslushnikov / latex-online

Online latex compiler. You give it a link, it gives you PDF
http://latexonline.cc
MIT License
491 stars 89 forks source link

insert image when compile with API #59

Closed nguyen179son closed 3 years ago

nguyen179son commented 4 years ago

Are there anyway to insert image when using api https://latexonline.cc/compile?... I tried to used base64 to image but its not working.

MonsieurV commented 4 years ago

Hi @nguyen179son,

There exist another (experimental & not related) project with support of base64 encoded files in the compile payload.

With Latex-Online I think the solution is to create a tar with all your file structure.

nguyen179son commented 4 years ago

This message comes out when I try with a tar file. I compress main.tex and image file into a tar.xz file.

pdflatex -interaction nonstopmode -recorder -output-directory latex.out /tmp/downloads/tmp_14/main.tex /tmp/downloads/tmp_14/main.tex:1: error: Missing \begin{document} at �7zXZ^^@^^@^^D�ִF^^B^^@!^^A^^V^^@^^@^^@t/��'�^^Vi]^^@6^^[�^^Z`қ^^O^^D... ^

nguyen179son commented 4 years ago

@MonsieurV This message comes out when I try with a tar file. I compress main.tex and image file into a tar.xz file.

pdflatex -interaction nonstopmode -recorder -output-directory latex.out /tmp/downloads/tmp_14/main.tex /tmp/downloads/tmp_14/main.tex:1: error: Missing \begin{document} at �7zXZ^^@^^@^^D�ִF^^B^^@!^^A^^V^^@^^@^^@t/��'�^^Vi]^^@6^^[�^^Z`қ^^O^^D... ^

MonsieurV commented 4 years ago

Maybe this is an character encodage issue? Does it work using laton command-line tool?

cf https://github.com/aslushnikov/latex-online#example-2-compile-files-with-dependencies

laton main.tex some-image.jpg 
aslushnikov commented 3 years ago

This works fine with laton CLI tool & git repo fetch. Closing this since discussion has stalled.