emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG]: contradictory requirements between resolving links and noweb result block
@ 2024-02-02 17:43 gerard.vermeulen
  2024-02-02 20:12 ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: gerard.vermeulen @ 2024-02-02 17:43 UTC (permalink / raw)
  To: Emacs orgmode, Ihor Radchenko

Hi,

I want to have a kind of dynamic RESULTS: noweb block to select what
other block to put in the LaTeX  preamble on LaTeX export.
I can get it working, but in this case links to the RESULTS: noweb block
are not resolved.  I found no way to get the links resolved without
breaking Noweb.  See my MWE with instructions below:

--- begin Org file ---
# -*- org-latex-prefer-user-labels: t -*- for easier understanding
Listing [[noop]], [[make-noweb]], and [[make-noweb-result]].
#+caption: NOOP
#+name: noop
#+begin_src latex :exports code
% I want to be in the LaTeX preamble above \author{}.
#+end_src
BUG: contradictory requirements for listing [[make-noweb-result]]:
1. Noweb works only in case [[make-noweb]] wraps [[make-noweb-result]] 
with
    *:exports both*.
2. Resolving links works only in case [[make-noweb]] wraps
    [[make-noweb-result]] with *:exports code*.
#+caption: Change after 1st :exports "both" to "code" and vice versa.
#+caption: Execute this block after changing, but before LaTeX export.
#+header: :wrap "src latex -n :exports both :noweb yes :results raw"
#+name: make-noweb
#+begin_src emacs-lisp :exports both :eval no-export
"#+latex_header: <<noop>>"
#+end_src
#+caption: I try to put listing [[noop]] body in the LaTeX preamble.
#+name: make-noweb-result
#+RESULTS: make-noweb
#+begin_src latex -n :exports both :noweb yes :results raw
,#+latex_header: <<noop>>
#+end_src
--- end Org file ---

I realize that this way of doing is contrived.
What I like about it, is that the [[make-noweb-results]] is directly
visible.  I can probably also modify `org-latex-packages-alist' but
that is less visible.

Regards -- Gerard




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

end of thread, other threads:[~2024-02-05 12:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-02 17:43 [BUG]: contradictory requirements between resolving links and noweb result block gerard.vermeulen
2024-02-02 20:12 ` Ihor Radchenko
2024-02-04 11:02   ` gerard.vermeulen
2024-02-05 12:32     ` Ihor Radchenko

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