emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: edgar@openmail.cc
To: emacs-orgmode@gnu.org
Subject: how to replace includegraphics?
Date: Wed, 31 May 2017 03:37:52 +0000	[thread overview]
Message-ID: <c4406be67c1f271d1d1f6cd7b9d01b91@openmail.cc> (raw)

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!  

             reply	other threads:[~2017-05-31  3:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-31  3:37 edgar [this message]
2017-05-31 13:55 ` how to replace includegraphics? 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c4406be67c1f271d1d1f6cd7b9d01b91@openmail.cc \
    --to=edgar@openmail.cc \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).