From mboxrd@z Thu Jan 1 00:00:00 1970 From: edgar@openmail.cc Subject: how to replace includegraphics? Date: Wed, 31 May 2017 03:37:52 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFuSd-0001Il-Tc for emacs-orgmode@gnu.org; Tue, 30 May 2017 23:38:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFuSa-0004E2-QZ for emacs-orgmode@gnu.org; Tue, 30 May 2017 23:38:15 -0400 Received: from onethreetwo.vfemail.net ([199.16.11.132]:3454 helo=vfemail.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dFuSa-0004CE-IC for emacs-orgmode@gnu.org; Tue, 30 May 2017 23:38:12 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org 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!