Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display pdf export instead of org file #151

Open
deb75 opened this issue May 5, 2021 · 1 comment
Open

Display pdf export instead of org file #151

deb75 opened this issue May 5, 2021 · 1 comment

Comments

@deb75
Copy link

deb75 commented May 5, 2021

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

@MeetThePatel
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants