politza / pdf-tools

Emacs support library for PDF files.
GNU General Public License v3.0
1.57k stars 162 forks source link

render latex inside popup when hover over annotation #560

Closed jstaursky closed 2 years ago

jstaursky commented 4 years ago

Is it possible to preview a latex fragment written in an annotation inside a popup window? e.g. pdftools-question

politza commented 4 years ago

The text is rendered as latex in the tool-tip, if it starts with a backslash or dollar. See also pdf-annot-print-annotation-functions.

jstaursky commented 4 years ago

right, I do use the dollar sign in the above screenshot (see for e.g. towards the bottom of the tooltip it shows "$(n_1,n_2)$) I am just using latex snippets here and there. also I am using

    (setq pdf-annot-edit-contents-setup-function
          (lambda (_annot) (org-mode) (px-preview)))

where px-preview comes from preview-latex package which makes it actually an org tooltip, latex render happens when I try and edit the annotation, just not in the tooltip.

jstaursky commented 4 years ago

whoops realized my mistake. I'll followup when I have a solution.