emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alain.Cochard@unistra.fr
To: "Fraga, Eric" <e.fraga@ucl.ac.uk>
Cc: "Alain.Cochard@unistra.fr" <Alain.Cochard@unistra.fr>,
	Org Mode List <emacs-orgmode@gnu.org>,
	Greg Minshall <minshall@umich.edu>
Subject: Re: Confused about source code blocks evaluation when exporting
Date: Wed, 20 Jul 2022 14:12:50 +0200	[thread overview]
Message-ID: <25303.61762.797550.528829@gargle.gargle.HOWL> (raw)
In-Reply-To: <87edyoxfam.fsf@ucl.ac.uk>

Fraga, Eric writes on Thu 14 Jul 2022 08:35:
 > On Thursday, 14 Jul 2022 at 10:09, Alain.Cochard@unistra.fr wrote:
 > > #+begin_src emacs-lisp
 > > (setq org-latex-pdf-process <for natib or for biblatex>)
 > > #+end_src
 > >
 > > which I want to be evaluated during export but I want neither the code
 > > not its results to appear on the exported pdf file.
 > >
 > > Maybe there are smarter ways to achieve this goal, but it was an
 > > opportunity for me anyway to start understanding this evaluation
 > > business.
 > 
 > For this kind of setting, I use file local variables and #+bind:.
 > Evaluating this code snippet during the export process is probably not
 > what you want.  You want it set prior to exporting?

Thanks a lot.

I don't know if I want to set org-latex-pdf-process _during_ or
_prior_ exporting.  All I wanted to do is to _not_ set it in the emacs
init file, so as to be able to set a specific value depending on
whether I was going to use natbib or biblatex, without having to
restart emacs.

I tried doing something with what you suggest (using #+bind:), but
failed:

I put the following at the end of my org file (then visited the file
again):

# Local Variables:
# org-export-allow-bind-keywords: t
# End:

As I was not sure about the bind syntax for the complicated
org-latex-pdf-process variable, I tried this first test:

#+bind: org-latex-pdf-process "dummy"
# (I also tried without the quotes)
#+cite_export: natbib plainnat
#+bibliography: cite.bib
[cite:@chouet88] 

And then 'C-c C-e l o'.  There is no error but the generated pdf is
not correct, because (as mentioned some days ago)
org-latex-pdf-process does not have the proper value.

In other words, '#+bind:' does not work as expected.

(By contrast, if I use "my" method, using

#+begin_src emacs-lisp :exports results
(setq org-latex-pdf-process 'dummy)
#+end_src

then, after 'C-c C-e l o' I get "org-latex-compile: Wrong type
argument: sequencep, dummy".
)

This post

https://emacs.stackexchange.com/questions/47474/setting-variable-for-org-mode-html-export

looked promising, but it also points to this one

https://stackoverflow.com/questions/41964712/how-does-bind-really-works/42012392#42012392

which looks less so...


At any rate, and as I already said, all this business became
irrelevant for me once latexmk was installed: no need then to set
org-latex-pdf-process.  This became only a matter of better
understanding some of the org intricacies.

Thank you again for your time.



















-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.cochard@unistra.fr
5 rue René Descartes   [bureau 106]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France     | [ slot available for rent ]



  reply	other threads:[~2022-07-20 12:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-12 12:53 Confused about source code blocks evaluation when exporting Alain.Cochard
2022-07-12 14:08 ` Fraga, Eric
2022-07-14  5:47   ` Rudolf Adamkovič
2022-07-12 14:22 ` Greg Minshall
2022-07-12 21:13 ` Alain.Cochard
2022-07-13 10:57   ` Fraga, Eric
2022-07-13 21:06     ` Alain.Cochard
2022-07-14  7:06       ` Fraga, Eric
2022-07-14  8:09         ` Alain.Cochard
2022-07-14  8:35           ` Fraga, Eric
2022-07-20 12:12             ` Alain.Cochard [this message]
2022-07-20 12:43               ` Fraga, Eric
2022-07-22  4:27                 ` Alain.Cochard
2022-07-22 17:09                   ` Fraga, Eric
2022-07-22 22:21                     ` Alain.Cochard
2022-07-14  6:06 ` Rudolf Adamkovič
2022-07-14  6:48   ` Alain.Cochard

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=25303.61762.797550.528829@gargle.gargle.HOWL \
    --to=alain.cochard@unistra.fr \
    --cc=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=minshall@umich.edu \
    /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).