emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* how to replace includegraphics?
@ 2017-05-31  3:37 edgar
  2017-05-31 13:55 ` John Hendy
  2017-05-31 17:01 ` Charles C. Berry
  0 siblings, 2 replies; 6+ messages in thread
From: edgar @ 2017-05-31  3:37 UTC (permalink / raw)
  To: emacs-orgmode

Hello dear list,

* Summary
I want to know if someone could tell me how to replace (the macro, 
function, string) includegraphics for something else when exporting to 
LaTeX. In my case, simplesvg.

* Why
I have my own version of the svg package (I only extracted bits and 
pieces from it long time ago), and I want to make clear for others who 
may use my files that I'm not using includesvg (I could just change the 
definition of simplesvg to includesvg).

* What I have tried
** Stealing from the webz
This does not work. I think that the list doesn't exist in org-mode 
anymore:
#+BEGIN_SRC emacs-lisp
   ;; Export svg (does not work)
   ;; 
https://lists.gnu.org/archive/html/emacs-orgmode/2013-08/msg00221.html
   ;; 
https://github.com/tsdye/tufte-org-mode/blob/master/ox-tufte-latex.el
   (defun my-svg-graphics (contents backend info)
     (when (eq backend 'latex)
       (replace-regexp-in-string 
"\\`\\\\includegraphics.+\\({.+\.svg}\\)"
                                 "\\\\simplesvg\1" contents))
     )
   (add-to-list 'org-export-filter-link-functions 'my-svg-graphics)
#+END_SRC

** Looking into org (ox-latex.el)
I found this (around line 2375 in ox-latex.el):
#+BEGIN_SRC emacs-lisp
(when (equal filetype "svg")
   (setq image-code (replace-regexp-in-string "^\\\\includegraphics"
                                              "\\includesvg"
                                              image-code
                                              nil t))
   (setq image-code (replace-regexp-in-string "\\.svg}"
                                              "}"
                                              image-code
                                              nil t)))
#+END_SRC

I could just change the code here (simplesvg instead of includesvg), but 
before f\#\#cking up my system, I would like to know if there is another 
alternative.

Thanks, as always :D !

-------------------------------------------------

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-05-31 23:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-31  3:37 how to replace includegraphics? edgar
2017-05-31 13:55 ` John Hendy
2017-05-31 22:35   ` edgar
2017-05-31 23:29     ` John Hendy
2017-05-31 17:01 ` Charles C. Berry
2017-05-31 22:36   ` edgar

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).