From: Rens Oliemans <hallo@rensoliemans.nl>
To: Richard H Stanton <rhstanton@berkeley.edu>
Cc: emacs-orgmode@gnu.org
Subject: Re: How to specify column alignment in LaTeX table output?
Date: Fri, 10 Jan 2025 19:59:20 +0100 [thread overview]
Message-ID: <87r05acx6f.fsf@rensoliemans.nl> (raw)
In-Reply-To: <DAC01FCA-0A74-47A1-9C55-FBF44B4E06CA@berkeley.edu>
Richard H Stanton <rhstanton@berkeley.edu> writes:
> Here’s an example:
>
> #+begin_src python :results output replace raw
> print("a")
> #+end_src
>
> Every time I run this code block, I get another line containing “a”. If I don't use the raw option, e.g.,
>
> #+begin_src python :results output
> print("a")
> #+end_src
>
> the multiple-output problem goes away, but now it appears as
>
> #+RESULTS:
> : a
>
> ...
>
> But is there a “preferred” way to output arbitrary text (e.g., LaTeX equations) from Python code blocks so that they compile fine *and* don’t append?
Generally, I don't know. Perhaps someone else can enlighten us on this part.
Since you are using \begin{equation} which is definitively LaTeX-specific, you
can always use the "latex" header option, say
#+begin_src python :results output latex
print("a")
#+end_src
#+RESULTS:
#+begin_export latex
a
#+end_export
This is more or less what you had with your flushleft drawer, so I'm not sure
whether this fixes anything or not.
> Thanks for this discussion. This is about where I get to every time I think I want to use org mode to create LaTeX documents with embedded, live calculations, and then after wrestling with the headers for a while I tend to go back again to separate .py and .tex files controlled by GNU Make...
I know how you feel! I'm currently writing my master's thesis, and had written
the first part of it in Org. However, there were some stumbling blocks, and
whenever deadlines loom I tend to choose the quickest option, which was separate
.tex files in this case. This isn't too bad though, AUCTeX and RefTeX are
fantastic, and I'm not really combinining LaTeX with the results of code blocks.
next prev parent reply other threads:[~2025-01-10 19:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-09 9:38 How to specify column alignment in LaTeX table output? Richard H Stanton
2025-01-09 10:17 ` Rens Oliemans
2025-01-09 15:02 ` Richard H Stanton
2025-01-10 9:47 ` Rens Oliemans
2025-01-10 9:53 ` Rens Oliemans
2025-01-10 22:04 ` Panayotis Manganaris
2025-01-10 16:59 ` Richard H Stanton
2025-01-10 18:59 ` Rens Oliemans [this message]
2025-01-10 19:16 ` Richard H Stanton
2025-01-10 19:38 ` Richard H Stanton
2025-01-10 19:45 ` Ihor Radchenko
2025-01-10 19:04 ` Richard H Stanton
-- strict thread matches above, loose matches on Subject: below --
2025-01-10 6:13 Pedro Andres Aranda Gutierrez
2025-01-10 17:04 ` Richard H Stanton
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=87r05acx6f.fsf@rensoliemans.nl \
--to=hallo@rensoliemans.nl \
--cc=emacs-orgmode@gnu.org \
--cc=rhstanton@berkeley.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).