emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Re: change font-size in python plots depending on context
@ 2019-08-19 16:50 Thomas S. Dye
  2019-08-20  9:25 ` johanna.may
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas S. Dye @ 2019-08-19 16:50 UTC (permalink / raw)
  To: johanna.may; +Cc: emacs-org list

Aloha Johanna May,

This works:

#+name: fs
#+BEGIN_SRC emacs-lisp
10
#+END_SRC

#+RESULTS: fs
: 10

#+header: :var fontsize=fs() :results output
#+begin_src python
print(fontsize)
#+end_src

#+RESULTS:
: 10

Note "fs()" instead of "fs".

All the best,
Tom

--
Thomas S. Dye
http://tsdye.online/tsdye

^ permalink raw reply	[flat|nested] 4+ messages in thread
* change font-size in python plots depending on context
@ 2019-08-19  8:50 johanna.may
  2019-08-19 11:10 ` Fraga, Eric
  0 siblings, 1 reply; 4+ messages in thread
From: johanna.may @ 2019-08-19  8:50 UTC (permalink / raw)
  To: emacs-orgmode

Dear org-mode fans,

I have various files that go together in one document, either
chapterwise or the whole book. And just as with tikz (latex) I want the font
size of python plots to change automatically when the context changes.

So I tried to define a variable in one of the header files like this:

#+name: fs
#+BEGIN_SRC emacs-lisp
10
#+END_SRC

I also tried to define it like this

#+name: fs
#+begin_src python :results output :session :exports none
fontsize=10
return fontsize
#+end_src

And then, in another file (that is being included by the header file) I
added :var fontsize=fs to the header and replaced the number by this
variable. I understand it complained that fs could not be found if I
used C-c C-c directly to test, since apparently the variable fs only
belongs to the other buffer (This is the first problem).

However, it doesn't work either when I compile everything (the second problem). Probably it
is also possible to solve this with some function in elisp. But, I have
to admit, that I haven't started learning elisp yet.

Does anyone have a solution to this problem? Any hints to helpful blogs
or stackexchange pages would be appreciated. I did a search but probably
not using the right keywords.

Thanks!

J

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

end of thread, other threads:[~2019-08-20  9:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-19 16:50 change font-size in python plots depending on context Thomas S. Dye
2019-08-20  9:25 ` johanna.may
  -- strict thread matches above, loose matches on Subject: below --
2019-08-19  8:50 johanna.may
2019-08-19 11:10 ` Fraga, Eric

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