From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Fraga, Eric" Subject: Re: change font-size in python plots depending on context Date: Mon, 19 Aug 2019 11:10:20 +0000 Message-ID: <87o90ls95w.fsf@ucl.ac.uk> References: <87o90l5yje.fsf@th-koeln.de> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:53883) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hzfYP-0007pA-1f for emacs-orgmode@gnu.org; Mon, 19 Aug 2019 07:10:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hzfYN-0003Fe-U5 for emacs-orgmode@gnu.org; Mon, 19 Aug 2019 07:10:24 -0400 Received: from mail-eopbgr60108.outbound.protection.outlook.com ([40.107.6.108]:10574 helo=EUR04-DB3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hzfYN-0003CU-Jy for emacs-orgmode@gnu.org; Mon, 19 Aug 2019 07:10:23 -0400 Content-Language: en-US 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: "johanna.may@th-koeln.de" Cc: "emacs-orgmode@gnu.org" Hi Johanna, > 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 f= ont > size of python plots to change automatically when the context changes. What I do, for a similar use case, is to define values using properties and then extract these values with a little function I wrote (see below). For example, #+begin_src org ,#+property: myvariable 10 ... ,#+begin_src ... :var v=3D(esf/get-parameter "myvariable") ... (use v in here) ,#+end_src #+end_src The esf/get-parameter function is: #+begin_src emacs-lisp (defun esf/get-parameter (p) (let ((value (org-entry-get (point) p 'inherit))) (message "parameter %s value obtained %s" p value) (if value (if (string-match-p "^[-+ ]*[[:digit:].]+$" value) (string-to-number value) value) (error "Property parameter \"%s\" not known." p)))) #+end_src I'm sure there are better ways but this is what I have developed organically over the years... HTH, eric --=20 Eric S Fraga via Emacs 27.0.50, Org release_9.2.4-401-gfabd6d