emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Denis Maier <denismaier@mailbox.org>
To: Org Mode List <emacs-orgmode@gnu.org>
Subject: Include LaTeX source and compiled result
Date: Wed, 8 Jun 2022 09:43:46 +0200	[thread overview]
Message-ID: <5bbc01ae-360e-2de6-5858-0b816d743b99@mailbox.org> (raw)

Hi everyone,

for the documentation of my LaTeX courses I use examples that show the 
output next to the source code. I'm contemplating whether I should 
convert the documentation and examples to org, and use org-babel to 
include the examples. I think this should be possible with org-babel.

However, I cannot manage to get this to work:

#+begin_example

Blabla

#+begin_src latex :file test.pdf
\documentclass{article}
\begin{document}
This is a test
\end{document}
#+end_src

Blabla

#+end_example

Looking at the temporary latex file (see below) the reason is clear: Org 
babel exports this as a complete latex file although the example itself 
is already complete. Can I tell org somehow that this is not a fragment 
and should be compiled as is?

Best,
Denis

\documentclass{article}
\usepackage[usenames]{color}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{capt-of}
\pagestyle{empty}             % do not remove
% The settings below are copied from fullpage.sty
\setlength{\textwidth}{\paperwidth}
\addtolength{\textwidth}{-3cm}
\setlength{\oddsidemargin}{1.5cm}
\addtolength{\oddsidemargin}{-2.54cm}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\textheight}{\paperheight}
\addtolength{\textheight}{-\headheight}
\addtolength{\textheight}{-\headsep}
\addtolength{\textheight}{-\footskip}
\addtolength{\textheight}{-3cm}
\setlength{\topmargin}{1.5cm}
\addtolength{\topmargin}{-2.54cm}
\begin{document}
\documentclass{article}
\begin{document}
This is a test
\end{document}
\end{document}



             reply	other threads:[~2022-06-08  7:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08  7:43 Denis Maier [this message]
2022-06-08  7:48 ` Include LaTeX source and compiled result Denis Maier
2022-06-08  8:28 ` Fraga, Eric
2022-06-08 19:01   ` Denis Maier
2022-06-09  7:47     ` Fraga, Eric
2022-06-09  7:58       ` Denis Maier
2022-06-09 11:49         ` Fraga, Eric
2022-06-11  8:38     ` Ihor Radchenko

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=5bbc01ae-360e-2de6-5858-0b816d743b99@mailbox.org \
    --to=denismaier@mailbox.org \
    --cc=emacs-orgmode@gnu.org \
    /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).