Re: [BUG]: contradictory requirements between resolving links and noweb result block

2024-02-05 Thread Ihor Radchenko
gerard.vermeu...@posteo.net writes:

> * mwe-noweb-ok
>
> ...
> Resolving the last link fails, because it has an org-id
> #+begin_src latex
> Listing \ref{noop}, \ref{make-noweb}, and \ref{orgd105392}.
> #+end_src
> while the caption of the linked listing has a user label.

Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f4414f5db

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG]: contradictory requirements between resolving links and noweb result block

2024-02-04 Thread gerard . vermeulen



On 02.02.2024 21:12, Ihor Radchenko wrote:

gerard.vermeu...@posteo.net writes:


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:


May you please provide more detailed information about your MWE?
What exactly are the steps? What did you expect to happen? What
happened instead?


I have turned my MWE into two almost identical MWE's (attached,
including a diff), so that LaTeX export output shows the problem.
I start with my expectations and then I explain what contains the
LaTeX output for mwe-noweb-ok.org and mwe-links-ok.org.

* LaTeX export objectives

Noweb should work, meaning that the LaTeX output preamble should
contain (above \author) the line:
#+begin_src latex
% Should go to the LaTeX preamble above \author{}.
#+end_src

Resolving links should work, meaning that the LaTeX output should
contain (below \tableofcontents) the line
#+begin_src latex
Listing \ref{noop}, \ref{make-noweb}, and \ref{make-noweb-result}.
#+end_src
where all links have user labels.

* mwe-noweb-ok

Export of mwe-noweb-ok.org to LaTeX shows that noweb works
Noweb works, because the preamble contains:
#+begin_src latex
% Should go to the LaTeX preamble above \author{}.
#+end_src

Resolving the last link fails, because it has an org-id
#+begin_src latex
Listing \ref{noop}, \ref{make-noweb}, and \ref{orgd105392}.
#+end_src
while the caption of the linked listing has a user label.

* mwe-links-ok

Noweb fails, because the LaTeX output preamble does contain
#+begin_src latex
\usepackage{hyperref}
\author{Gerard Vermeulen}
#+end_src
without the LaTeX comment.

Resolving links works, because the LaTeX output contains
#+begin_src latex
Listing \ref{noop}, \ref{make-noweb}, and \ref{make-noweb-result}.
#+end_src

* Problem

I can find no configuration where noweb and resolving the link
to the noweb block works.

Regards -- Gerard


mwe-noweb-ok.org
Description: Binary data


mwe-links-ok.org
Description: Binary data


mwe.diff
Description: Binary data


Re: [BUG]: contradictory requirements between resolving links and noweb result block

2024-02-02 Thread Ihor Radchenko
gerard.vermeu...@posteo.net writes:

> 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:

May you please provide more detailed information about your MWE?
What exactly are the steps? What did you expect to happen? What happened 
instead?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



[BUG]: contradictory requirements between resolving links and noweb result block

2024-02-02 Thread gerard . vermeulen

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: <>"
#+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: <>
#+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