From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id ENw2Lepv32D4RQAAgWs5BA (envelope-from ) for ; Fri, 02 Jul 2021 21:58:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id mIPjKOpv32D3fwAAbx9fmQ (envelope-from ) for ; Fri, 02 Jul 2021 19:58:34 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C403B8F1E for ; Fri, 2 Jul 2021 21:58:33 +0200 (CEST) Received: from localhost ([::1]:38036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzPJ1-0004wn-K7 for larch@yhetil.org; Fri, 02 Jul 2021 15:58:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzPHY-0004tx-CO for emacs-orgmode@gnu.org; Fri, 02 Jul 2021 15:57:00 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:43537) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lzPHV-0002zW-MU for emacs-orgmode@gnu.org; Fri, 02 Jul 2021 15:56:59 -0400 Received: by mail-pj1-x1029.google.com with SMTP id x21-20020a17090aa395b029016e25313bfcso6835894pjp.2 for ; Fri, 02 Jul 2021 12:56:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=berkeley-edu.20150623.gappssmtp.com; s=20150623; h=from:mime-version:subject:message-id:date:to; bh=MaXC1PBF2GL42g4N4+2XwUoL1DZ77LIrkwik0FtY/9Y=; b=KlHV5djoks2V0pkKv120v1LWBNnQC18J0gLXuKtpa5JPfTMJOZo75+dJxKD0wBnISY pRhP2Q1T1Br7pDaT+wF0DAknagqHplqgk5dFcBcWJ+jVgxom7IrIM8n6i7JgzWz0dRJN YzGOIe7+ywVuzXigcxZnYUYNqWtOP5xly33u0iDhY27PeZ0DWlqsR+ZCazOHiat/juAs K180bLT7584BOSVnNdmEcilNYs+970bikd2VCQjClH7oW4gRvgg7Ixum8Q+fVtM7viAe hBA6bKtVq8Lp2YeHYmjnbvM3NP2nMPosvx+Z6o/CBg8AxfyAYme3b/kdjJUaFHMwH8ui aAag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=MaXC1PBF2GL42g4N4+2XwUoL1DZ77LIrkwik0FtY/9Y=; b=NGQXs7OjuBdwL24Ir5WrqL8bgQQ8DhznRKW3mn3934obLJBSjT8Ez0TnUjHBGAjx7E 20HzRB+J5iJA1hJaJizQGtzoLSfX26kOKIVh/4GQqBWQc65fvfjFk5tvuAroHwSjacxQ TJgLCDib8m2NQ8DtwEzYF16op9nz98qviM0JxftxjizawD93lce5Qni3+qyCCNP3+Pat ZOqFjWNA98h855LGS+GEIP6nOA2d1WIc/um0Yoe6MDX0q/caJjeFXP7/X6BkCNxEp/Yn Nbd7dszxsiANXG3lU2pruv5aXg1upJVL9H6ApyW+JpAmfhtV0CjWLK6yAit/s8bAPOOR 6TFw== X-Gm-Message-State: AOAM530XrllPbcD/W3X9FH5lbcK+OflaG1LbuuMLHBLl1F7g30B4J9KS 1bJb9OB6IG2yOrl7X+t/CzZXACl4tplEGw== X-Google-Smtp-Source: ABdhPJzTDXmMwHhPkn3i8LtSaiULsfQplBkRUndRd1PlUPlRHvn8qwsz3o+LQs3xcVql3ZN/ae/hWQ== X-Received: by 2002:a17:902:da83:b029:122:d385:d280 with SMTP id j3-20020a170902da83b0290122d385d280mr1168105plx.43.1625255814119; Fri, 02 Jul 2021 12:56:54 -0700 (PDT) Received: from smtpclient.apple ([2607:f140:800:1::1297]) by smtp.gmail.com with ESMTPSA id b3sm4435503pfi.179.2021.07.02.12.56.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Jul 2021 12:56:53 -0700 (PDT) From: Richard Stanton Content-Type: multipart/alternative; boundary="Apple-Mail=_2A1CEA23-0E90-4660-876C-2D128B5DCE54" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) Subject: Exporting to LaTeX versus Beamer: how to take different actions depending on export format? Message-Id: <16BF3CE5-AD4F-4BAB-9C18-D51DA66C36B6@berkeley.edu> Date: Fri, 2 Jul 2021 12:56:52 -0700 To: orgmode X-Mailer: Apple Mail (2.3654.100.0.2.22) Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=rhstanton@berkeley.edu; helo=mail-pj1-x1029.google.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_05=-0.5, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1625255914; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=MaXC1PBF2GL42g4N4+2XwUoL1DZ77LIrkwik0FtY/9Y=; b=qUqP9MYAXsg79XQUV6xp0LcHLJ4ZX+OwWpE/jJJcetuRzX5Z65ta+WKVq+vYNLtOlwEDRF +Ta4kFGvp2HtTdF/CfmhQgLXPt/Dl1aj6N7NV0NSkQ25OcHonQgWyJy0YEHgpdnP+8jcs1 bt8G2H67bkMD1wnTjK99IsGoVz66A2+A9CNav8aEx9UgSTGq4ClVAVqnXc6iGIMhsgKOis FH5J9H7OngvCSEaOeqOYTD1PRQYt3iu//NpZzVRXCUUZJbwqiTNJAeryDkRVHG/OBTBEpE ctLHauAIU25ANFs4Lg7S5m4D+TdnLBctDTk4QD6c+VT96UTuGzDhKfo52gx75A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625255914; a=rsa-sha256; cv=none; b=a8uGStGN42byegR+sHRq8G9WtDts/F0Ha6zcaW7+vzCTC1y8+kWcYA6EaaTkOwpopfSYtO TqPUyILvtcKSj+0ZGxveZ0vFR65erllUN6M5jzRr8Eqti46ZuRJTJfYh6mPv+1MTmNcxFZ kuhDyuAV5kLN2lv1ez+820oxJXNzUaXXXFrqipxFyFnMytB/VIvjnd0glNrk/6lZHZpbB1 6QVG6NavK7X/Udoa+pkj3qxVHkVDtP8dgdsd4Lygm8GLtuEY7+FX5KvmAR1KLhLtVi12H1 ZtPMJN2A+AAcLnWb7JlXoSEuCkaec2uA4zb8FPkpahp2r4GbJYvOQO+6rJWmEw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=KlHV5djo; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=KlHV5djo; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: C403B8F1E X-Spam-Score: -1.11 X-Migadu-Scanner: scn0.migadu.com X-TUID: LGL5koNl1zgw --Apple-Mail=_2A1CEA23-0E90-4660-876C-2D128B5DCE54 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I=E2=80=99ve been experimenting with using a single org file to generate = an article when exported to LaTeX (or HTML) and a Beamer presentation = when exported to Beamer, without requiring any edits to the org file = itself.=20 For this to be really useful, the exporter has to be able to do = different things depending on which output format you=E2=80=99ve asked = for.=20 1) At a minimum, you need to be able to have text included in the = article that is not included in the Beamer presentation and vice versa, = so that you can have, say, a paragraph in the article vs. an itemized = list in the Beamer presentation. This can be taken care of relatively = easily using one of several conditional-compilation packages available = for LaTeX. If people are interested, I=E2=80=99ve uploaded a simple = example to https://faculty.haas.berkeley.edu/stanton/orgLatexBeamer/ = 2) However, some things are not so easy. For example, suppose I=E2=80=99m = using the listings package to include some code in my document, e.g., #+begin_src python print(=E2=80=9CHello, world=E2=80=9D) #+end_src This works fine as long as I=E2=80=99m OK with the default output = format. But suppose this listing is too long for my slide so I want to = make the text smaller than normal. I can do that quite easily for both = article and presentation output by putting a line like #+attr_latex: :options basicstyle=3D\tiny immediately before the source block. But suppose I only want to do this = in the Beamer output and not in the LaTeX article output? I=E2=80=99ve = tried=20 #+attr_beamer: :options basicstyle=3D\tiny but this doesn=E2=80=99t seem to work. And even if it did, what if I = wanted the change in font size to occur only when I=E2=80=99m exporting = to LaTeX but not Beamer? How can I do conditional things like this at = the org-file level based on whether I=E2=80=99m exporting to LaTeX or = Beamer? Thanks for any suggestions. Richard Stanton --Apple-Mail=_2A1CEA23-0E90-4660-876C-2D128B5DCE54 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 I=E2=80=99ve been experimenting with using a single org file = to generate an article when exported to LaTeX (or HTML) and a Beamer = presentation when exported to Beamer, without requiring any edits to the = org file itself. 

For this to be really useful, the exporter has to be able to = do different things depending on which output format you=E2=80=99ve = asked for. 

1) At a minimum, you need to be able to have text included in = the article that is not included in the Beamer presentation and vice = versa, so that you can have, say, a paragraph in the article vs. an = itemized list in the Beamer presentation. This can be taken care of = relatively easily using one of several conditional-compilation packages = available for LaTeX. If people are interested, I=E2=80=99ve uploaded a = simple example to https://faculty.haas.berkeley.edu/stanton/orgLatexBeamer/

2) However, = some things are not so easy. For example, suppose I=E2=80=99m using the = listings package to include some code in my document, e.g.,

#+begin_src = python
  print(=E2=80=9CHello, = world=E2=80=9D)
#+end_src

This works fine as long as I=E2=80=99m = OK with the default output format. But suppose this listing is too long = for my slide so I want to make the text smaller than normal. I can do = that quite easily for both article and presentation output by putting a = line like

#+attr_latex: :options basicstyle=3D\tiny

immediately before the = source block. But suppose I only want to do this in the Beamer output = and not in the LaTeX article output? I=E2=80=99ve tried 

#+attr_beamer: :options = basicstyle=3D\tiny

but this doesn=E2=80=99t seem to work. And even if it did, = what if I wanted the change in font size to occur only when I=E2=80=99m = exporting to LaTeX but not Beamer? How can I do conditional things like = this at the org-file level based on whether I=E2=80=99m exporting to = LaTeX or Beamer?

Thanks for any suggestions.

Richard Stanton











= --Apple-Mail=_2A1CEA23-0E90-4660-876C-2D128B5DCE54--