emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: edgar@openmail.cc
To: John Kitchin <jkitchin@andrew.cmu.edu>
Cc: John Kitchin <johnrkitchin@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: filter for svg latex-export
Date: Fri, 07 Sep 2018 01:22:41 +0000	[thread overview]
Message-ID: <d822acec31d95b2ee645a487a9bb9e1e@openmail.cc> (raw)
In-Reply-To: <m2mv1nogcx.fsf@andrew.cmu.edu>

[-- Attachment #1: Type: text/plain, Size: 3285 bytes --]

Hi,

I want to report that I can use the new version  of the SVG (2.00b) 
LaTeX directly. The developer (Falk; Bcc) said that there will be a new 
release soon. I attach an example of the strange things that I can 
achieve. I hope that it's useful :) .

Cheers!

On 2018-01-09 03:34, John Kitchin wrote:
> If all you are doing is replacing includesvg with simplesvg, then you
> might try this:
> 
> #+BEGIN_SRC emacs-lisp
> (let ((org-export-filter-link-functions  '((lambda (txt _ _)
> 					     (replace-regexp-in-string "includesvg" "simplesvg" txt)))))
>   (org-latex-export-as-latex))
> #+END_SRC
> 
> If you are doing more than that (it looks like you are adding options?)
> then one alternative option is just put a copy of your modified 
> function
> in your init file after you load org, and then it will shadow the
> ox-latex function and you might not have to change anything when you
> update as long as no incompatible changes are in the update. I know,
> that is hacky, but it works in cases like this.
> 
> 
> 
> edgar@openmail.cc writes:
> 
>> Hello,
>> 
>> I once tried to create a filter (is that the name?) to modify the
>> function which exports SVG files. Verdict: I suck! Thus, I keep
>> modifying the ox-latex.el every time that I upgrade (see attached).
>> Would someone please tell me what is the right way to achieve that
>> (without modifying the code, please? Thanks!
>> 
>> -------------------------------------------------
>> 
>> 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!  *** 
>> org-20180103/ox-latex.el	2018-01-07 16:53:43.477464348 -0700
>> --- plugins/ox-latex.el	2018-01-07 16:39:52.117462098 -0700
>> ***************
>> *** 2425,2434 ****
>>   			  (t (format "[%s]" options)))
>>   		    path))
>>         (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
>> --- 2425,2437 ----
>>   			  (t (format "[%s]" options)))
>>   		    path))
>>         (when (equal filetype "svg")
>> !         (setq image-code
>> !               (format "\\simplesvg%s{%s}"
>> !                       (cond ((not (org-string-nw-p options)) "")
>> !                             ((string-prefix-p "," options)
>> !                              (format "{%s}" (substring options 1)))
>> !                             (t (format "{%s}" options)))
>> !                       path))
>>   	(setq image-code (replace-regexp-in-string "\\.svg}"
>>   						   "}"
>>   						   image-code
> 
> 
> --
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu


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

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!  

[-- Attachment #2: svg-sample.tar.gz --]
[-- Type: application/octet-stream, Size: 40596 bytes --]

  parent reply	other threads:[~2018-09-07  1:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-08  0:10 filter for svg latex-export edgar
2018-01-09  3:34 ` John Kitchin
2018-01-09  3:47   ` edgar
2018-09-07  1:22   ` edgar [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-09-09 20:03 Falk Hanisch

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=d822acec31d95b2ee645a487a9bb9e1e@openmail.cc \
    --to=edgar@openmail.cc \
    --cc=emacs-orgmode@gnu.org \
    --cc=jkitchin@andrew.cmu.edu \
    --cc=johnrkitchin@gmail.com \
    /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).