org-roam-server icon indicating copy to clipboard operation
org-roam-server copied to clipboard

Display pdf export instead of org file

Open deb75 opened this issue 3 years ago • 1 comments

Hello,

On some org files, I have some latex environments, some figures which are not rendered when I preview the file on the server. But of course, they are nicely rendered by latex to pdf export.

Should it be possible that the server sends the pdf export in place of the org file if there exists a pdf file with same name as the org one ?

Currently, the workaround is to link the exported pdf directly into the org file itself

Regards

deb75 avatar May 05 '21 11:05 deb75

I have been having the same issue. An example of such misrendering is:

I have custom LaTeX commands that I use when writing LaTeX, so when migrating to org-mode, I copy+pasted my custom preamble.tex into a setupfile.org that I include in each org-roam file. The following is an excerpt from my setupfile.org:

...

#+latex_header: \newcommand{\Prob}[1]{\mathbb{P}\left\{ #1 \right\}}
#+latex_header: \newcommand{\EV}[1]{\mathbb{E}\left[ #1 \right]}
#+latex_header: \newcommand{\EVt}[1]{\widetilde{\mathbb{E}}\left[ #1 \right]}
#+latex_header: \newcommand{\VAR}[1]{\mathbb{V}\left[ #1 \right]}
#+latex_header: \newcommand{\Cov}[1]{\text{Cov} \left( #1 \right)}
#+latex_header: \newcommand{\Corr}[1]{\text{Corr} \left( #1 \right)}

...

Now, this approach works fine for previewing LaTeX fragments in Emacs and even for exporting, but when viewing the note's preview in org-roam-server, the following happens (screenshot of org-roam-server in Chrome):

image

As @deb75 mentioned, it would be a nice feature to add an option so that the pdf is shown instead of the MathJax preview.

Another possible route to take is: instead of using MathJax to preview the LaTeX, you could the LaTeX preview fragments that org-mode stores in the folder ltximg/ instead.

MeetThePatel avatar Jun 25 '21 18:06 MeetThePatel