0

I can combine my source files in the manner below, where the 2nd code block will run the echo command from the first code block.

#+name: echo
#+begin_src bash :noweb yes
echo test
#+end_src

#+begin_src bash :noweb yes
<<echo>>
#+end_src

I want to do something similar for my equations. Here, the left-half of the 2nd equation should come from the first “code block”.

\begin{equation}
a
\end{equation}

\begin{equation}
<<a>>=b
\end{equation}

I know my second set of examples don’t use org-babel code-blocks, nor do my first set of examples use latex fragments. I had hoped there might be some way to marry the two like the third set of examples below, but that does not work.

#+name: a
#+begin_equation :noweb yes
a
#+end_equation

#+begin_equation :noweb yes
<<a>>=b
#+end_equation

I got something that can work in the perfect solution, described in a related question's answer: the 2nd code block does render in it's output block, but that isn't technically what I was hoping for. Maybe someone will present something else in the future.

#+name: emc
#+BEGIN_SRC latex :noweb yes :results file raw :file test.png
\begin{equation}
e=mc2
\end{equation}
#+END_SRC

#+BEGIN_SRC latex :noweb yes :results file raw :file test2.png
<<emc>>
#+END_SRC

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.