Re: [BUG] Make SVG + LaTeX work by default [9.5.2 (release_9.5.2-9-g7ba24c @ /Users/salutis/src/emacs/nextstep/Emacs.app/Contents/Resources/lisp/org/)]

2022-01-30 Thread Tom Gillespie
I do not think we can add -shell-escape by default because it
is an arbitrary code execution vector. It might be good to add
a setting in org that would do the right thing without requiring
a user to understand the arcana of latex cli options though.
Best,
Tom



Re: [BUG] Make SVG + LaTeX work by default [9.5.2 (release_9.5.2-9-g7ba24c @ /Users/salutis/src/emacs/nextstep/Emacs.app/Contents/Resources/lisp/org/)]

2022-01-30 Thread Timothy
Hi Rudolf,

> To make SVG work in Org Mode and LaTeX, one must:
>
> (1) add “-shell-escape” to “org-latex-pdf-process”:
>
> OLD: latexmk -f -pdf -%latex -interaction=nonstopmode …
> NEW: latexmk -f -pdf -%latex -interaction=nonstopmode -shell-escape …
>
> (2) add the header line:
>
> #+latex_header: 
>
> With these two changes, SVG images show in both PDF and HTML exports.
>
> Why does Org Mode not have this configured out of the box?  I have just
> spent 2 hours figuring it out, and someone else will have to figure it
> out again sooner or later.

For what consolation it may be, I have a plan to make this (and more) work OOTB
while using the minimal set of packages needed. However, unfortunately I need
more time to refine my changes into patches I’m happy with.

All the best,
Timothy


[BUG] Make SVG + LaTeX work by default [9.5.2 (release_9.5.2-9-g7ba24c @ /Users/salutis/src/emacs/nextstep/Emacs.app/Contents/Resources/lisp/org/)]

2022-01-30 Thread Rudolf Adamkovič



Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


To make SVG work in Org Mode and LaTeX, one must:

(1) add "-shell-escape" to "org-latex-pdf-process":

OLD: latexmk -f -pdf -%latex -interaction=nonstopmode …
NEW: latexmk -f -pdf -%latex -interaction=nonstopmode -shell-escape …

(2) add the header line:

#+latex_header: \usepackage{svg}

With these two changes, SVG images show in both PDF and HTML exports.

Why does Org Mode not have this configured out of the box?  I have just
spent 2 hours figuring it out, and someone else will have to figure it
out again sooner or later.

Rudy

Emacs  : GNU Emacs 29.0.50 (build 2, x86_64-apple-darwin21.2.0, NS 
appkit-2113.20 Version 12.1 (Build 21C52))
 of 2022-01-26
Package: Org mode version 9.5.2 (release_9.5.2-9-g7ba24c @ 
/Users/salutis/src/emacs/nextstep/Emacs.app/Contents/Resources/lisp/org/)

current state:
==
(setq
 org-agenda-prefix-format "* % t%s"
 org-link-elisp-confirm-function 'yes-or-no-p
 org-agenda-skip-deadline-prewarning-if-scheduled t
 org-cite-insert-processor 'citar
 org-bibtex-headline-format-function #[257 "\300.\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 org-agenda-scheduled-leaders '("Scheduled: " "Scheduled %d×: ")
 org-agenda-custom-commands '(("a" "Agenda"
   ((agenda ""
 ((org-agenda-overriding-header "Fortune")
  (org-agenda-files nil) (org-agenda-span 1)
  (org-agenda-day-face-function
   (lambda (_) 'font-lock-comment-face))
  (org-agenda-format-date
   (lambda (_) (my/fortune-string)))
  )
 )
(agenda ""
 ((org-agenda-overriding-header "\nToday")
  (org-agenda-start-on-weekday nil)
  (org-agenda-span 1)
  (org-agenda-format-date
   'my/org-agenda-format-date-not-aligned)
  (org-agenda-day-face-function
   (lambda (_) 'calendar-today))
  (org-agenda-skip-function
   '(org-agenda-skip-entry-if 'todo 'done))
  )
 )
(todo "NEXT|NEXT-IN|ON-HOLD"
 ((org-agenda-overriding-header "\nNext 
actions")
  (org-agenda-todo-ignore-scheduled 'all)
  (org-agenda-todo-ignore-timestamp 'future)
  (org-habit-show-habits nil))
 )
(agenda ""
 ((org-agenda-overriding-header "\nTomorrow")
  (org-agenda-start-day "+1d") (org-agenda-span 
1)
  (org-agenda-format-date
   'my/org-agenda-format-date-not-aligned)
  (org-habit-show-habits-only-for-today nil)
  (org-habit-scheduled-past-days 0))
 )
(agenda ""
 ((org-agenda-overriding-header "\nNear future")
  (org-agenda-start-day "+2d")
  (org-agenda-start-on-weekday nil)
  (org-agenda-span 7) (org-habit-show-habits 
nil))
 )
(todo "WAIT-FOR"
 ((org-agenda-overriding-header "\nWaiting")))
)
   )
  )
 org-startup-folded t
 org-agenda-skip-scheduled-if-done t
 org-agenda-files '("~/agenda.org" "~/agenda-work.org")
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-link-descriptive nil
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cite-follow-processor 'citar
 org-file-apps '(("\\.pdf\\'" . emacs) (auto-mode . emacs) (directory . emacs)
 ("\\.mm\\'" . default) ("\\.x?html?\\'" . default)
 ("\\.pdf\\'" . default))
 org-html-postamble nil
 org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
 org-edit-src-content-indentation 0
 org-ascii-format-drawer-function #[771 ".\207" [] 4 "\n\n(fn NAME CONTENTS 
WIDTH)"]