emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to not include newlines in strip-export?
@ 2021-01-17 15:40 karol.wojcik--- via General discussions about Org-mode.
  0 siblings, 0 replies; only message in thread
From: karol.wojcik--- via General discussions about Org-mode. @ 2021-01-17 15:40 UTC (permalink / raw)
  To: Emacs Orgmode

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

I'm using the following snippet for saving the plot  in python snippets

#+NAME: save-file
#+BEGIN_SRC python :results silent :var filename="filename" plt="plt" :exports none
return f"\nfname = 'assets/' + filename + '.png'\nplt.savefig(fname)\nfname"
#+END_SRC

Using it like so
#+BEGIN_SRC python :var fig=1 filename="some-filename" :noweb strip-export :results file :session t :exports both :cache yes
import matplotlib.pyplot as plt

plt.plot(1, 1)

<<save-file("filename", "plt")>>
#+END_SRC

The issue is that `save-file` adds some extra newlines in export which I would rather omit. What am I doing wrong?

Best Regards,
Karol Wójcik

[-- Attachment #2: Type: text/html, Size: 1103 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-17 15:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-17 15:40 How to not include newlines in strip-export? karol.wojcik--- via General discussions about Org-mode.

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).