From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id SBDvCJD5K2BXZQAA0tVLHw (envelope-from ) for ; Tue, 16 Feb 2021 16:57:52 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 8PfHBJD5K2A9CAAA1q6Kng (envelope-from ) for ; Tue, 16 Feb 2021 16:57:52 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 55B4D23927 for ; Tue, 16 Feb 2021 17:57:51 +0100 (CET) Received: from localhost ([::1]:42310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lC3fa-00010I-6M for larch@yhetil.org; Tue, 16 Feb 2021 11:57:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lC3FU-0008Ls-Ts for emacs-orgmode@gnu.org; Tue, 16 Feb 2021 11:30:52 -0500 Received: from mout01.posteo.de ([185.67.36.65]:37740) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lC3FQ-0004j4-Uc for emacs-orgmode@gnu.org; Tue, 16 Feb 2021 11:30:52 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 101E2160064 for ; Tue, 16 Feb 2021 17:30:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1613493046; bh=E1uQeNw0fUEJ3vfkp9/SkkYOUT9l088sAG+rkQjw7fk=; h=From:To:Subject:Date:From; b=UBZ2u+L/tEj8QTUK1Do4dD9IvjSBWlcseVyS2jaU+SLKFDHvWDtxPGn4JSd7oiQIh SW5vuAF6nTuqm5MAgpfjY0zVl8vt2pvvdF8AZ7alNldr5x7BU+/tnmvl0B4Izj+oQe VHkatZA6/C1PrkG8wdZcp3LYa7BJIo7NwntGDXxtU/eAE7qnrccpXaBb5n0bO/S8ea JLDEAUh4nAgvEH76K5dofTvnTbkR8ch5I9FAghlZRR+jPhJL9+hJ1eKs48cIlnXREb y6tByvH3Fu3YgjBYt6kuF+Hmy7kGQvi2xy+e+JTTdYOSFHpYmYhv3np9na/y7A9rhT d2TyLSf5FIIIA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Dg60P36K4z9rxd for ; Tue, 16 Feb 2021 17:30:45 +0100 (CET) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: orgmode Subject: [question] lisp code in :results header arg.? Date: Tue, 16 Feb 2021 17:30:44 +0100 Message-ID: <87zh040ybv.fsf@posteo.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=maciaschain@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -0.06 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="UBZ2u+L/"; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 55B4D23927 X-Spam-Score: -0.06 X-Migadu-Scanner: scn0.migadu.com X-TUID: msjO5OgC7DLX Hi, I'm exploring some ways to include a complex LaTeX preamble using source blocks. Consider this (code at the end of this message), that works fine. My question is: In order to do it all in a single block, would there be any way to pass the output of the first block as an argument to a function, and put that function as a header arg (results)...? Best Regards, Juan Manuel #+NAME:preamble #+begin_src latex :results silent :exports results \usepackage{luacode} \usepackage{fontspec} \directlua { fonts.handlers.otf.addfeature { name = "ktest", type = "kern", data = { ["A"] = { ["V"] = -45 }, }, } } \setmainfont{Linux Libertine O} [RawFeature={+ktest}] #+end_src #+begin_src emacs-lisp :var x=preamble :results raw :exports results (let* ((lines (split-string x "\n" nil)) (headers (mapconcat (lambda (line) (unless (equal line "") (format "#+LaTeX_Header: %s" line))) lines "\n"))) headers) #+end_src #+RESULTS: #+LaTeX_Header: \usepackage{luacode} #+LaTeX_Header: \usepackage{fontspec} #+LaTeX_Header: \directlua #+LaTeX_Header: { #+LaTeX_Header: fonts.handlers.otf.addfeature #+LaTeX_Header: { #+LaTeX_Header: name = "ktest", #+LaTeX_Header: type = "kern", #+LaTeX_Header: data = #+LaTeX_Header: { #+LaTeX_Header: ["A"] = { ["V"] = -45 }, #+LaTeX_Header: }, #+LaTeX_Header: } #+LaTeX_Header: } #+LaTeX_Header: \setmainfont{Linux Libertine O} #+LaTeX_Header: [RawFeature={+ktest}]