all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Orgmode and Beamer
@ 2024-10-28 22:27 David Masterson
  2024-10-28 23:57 ` Naresh Gurbuxani
  2024-10-29  2:05 ` Leo Butler
  0 siblings, 2 replies; 5+ messages in thread
From: David Masterson @ 2024-10-28 22:27 UTC (permalink / raw)
  To: emacs-orgmode

Does anyone have a recommendation on how to structure an Org document 
such that it can be exported to either Latex or Beamer? Suppose you have 
a (small) thesis that you are writing and you want to generate Beamer 
slides of a high-level view of the document, but also generate a PDF for 
the whole document.   I suppose you could break it into two files, but 
then you'd have to copy (certain) changes from file to file.  I was 
wondering if it could be done with one file such that updates to the 
master document are simultaneously reflected in the Beamer slides.  Is 
this going to involve liberal use of #+BEGIN...#+END blocks?

David Masterson



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Orgmode and Beamer
  2024-10-28 22:27 Orgmode and Beamer David Masterson
@ 2024-10-28 23:57 ` Naresh Gurbuxani
  2024-10-29  0:47   ` David Masterson
  2024-10-29  2:05 ` Leo Butler
  1 sibling, 1 reply; 5+ messages in thread
From: Naresh Gurbuxani @ 2024-10-28 23:57 UTC (permalink / raw)
  To: David Masterson; +Cc: emacs-orgmode@gnu.org

 Comment out one of these:

#+latex_class: article
#+latex_class: beamer


Sent from my iPhone

> On Oct 28, 2024, at 6:32 PM, David Masterson <dsmasterson92630@outlook.com> wrote:
> 
> Does anyone have a recommendation on how to structure an Org document such that it can be exported to either Latex or Beamer? Suppose you have a (small) thesis that you are writing and you want to generate Beamer slides of a high-level view of the document, but also generate a PDF for the whole document.   I suppose you could break it into two files, but then you'd have to copy (certain) changes from file to file.  I was wondering if it could be done with one file such that updates to the master document are simultaneously reflected in the Beamer slides.  Is this going to involve liberal use of #+BEGIN...#+END blocks?
> 
> David Masterson
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Orgmode and Beamer
  2024-10-28 23:57 ` Naresh Gurbuxani
@ 2024-10-29  0:47   ` David Masterson
  0 siblings, 0 replies; 5+ messages in thread
From: David Masterson @ 2024-10-29  0:47 UTC (permalink / raw)
  To: Naresh Gurbuxani; +Cc: emacs-orgmode@gnu.org

Ok.  Can that be done based upon which export engine you choose -- 
ox-latex or ox-beamer?  Example?

On 10/28/24 16:57, Naresh Gurbuxani wrote:
>   Comment out one of these:
>
> #+latex_class: article
> #+latex_class: beamer
>
>
> Sent from my iPhone
>
>> On Oct 28, 2024, at 6:32 PM, David Masterson <dsmasterson92630@outlook.com> wrote:
>>
>> Does anyone have a recommendation on how to structure an Org document such that it can be exported to either Latex or Beamer? Suppose you have a (small) thesis that you are writing and you want to generate Beamer slides of a high-level view of the document, but also generate a PDF for the whole document.   I suppose you could break it into two files, but then you'd have to copy (certain) changes from file to file.  I was wondering if it could be done with one file such that updates to the master document are simultaneously reflected in the Beamer slides.  Is this going to involve liberal use of #+BEGIN...#+END blocks?
>>
>> David Masterson
>>
>>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Orgmode and Beamer
  2024-10-28 22:27 Orgmode and Beamer David Masterson
  2024-10-28 23:57 ` Naresh Gurbuxani
@ 2024-10-29  2:05 ` Leo Butler
  2024-10-29  3:38   ` David Masterson
  1 sibling, 1 reply; 5+ messages in thread
From: Leo Butler @ 2024-10-29  2:05 UTC (permalink / raw)
  To: David Masterson; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1255 bytes --]

On Mon, Oct 28 2024, David Masterson <dsmasterson92630@outlook.com> wrote:

> Does anyone have a recommendation on how to structure an Org document
> such that it can be exported to either Latex or Beamer? Suppose you
> have a (small) thesis that you are writing and you want to generate
> Beamer slides of a high-level view of the document, but also generate
> a PDF for the whole document.   I suppose you could break it into two
> files, but then you'd have to copy (certain) changes from file to
> file.  I was wondering if it could be done with one file such that
> updates to the master document are simultaneously reflected in the
> Beamer slides.  Is this going to involve liberal use of
> #+BEGIN...#+END blocks?
>
> David Masterson
>
>

I think I would add the tags

#+TAGS: beameronly latexonly noexport

and then define an elisp function that changes beameronly tags to
noexport when the export backend is latex and similar for latexonly.
Add that function to the `org-export-before-processing-functions' so it
gets executed before export begins.

Attached is an example.

Note that you likely would need to fiddle with conditionally loading
packages, depending on the export backend.

Best regards,
Leo


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: beamer-latex.org --]
[-- Type: text/x-org; name="beamer-latex.org", Size: 938 bytes --]

#+TITLE: LaTeX and Beamer
#+TAGS: beameronly(b) latexonly(l) noexport(n)
#+OPTIONS: tags:nil

* Code                                                             :noexport:
#+begin_src elisp
  (defun ltb-org-export-filter (backend)
    (let ((regex (cl-case backend
  		 (latex ":beameronly:")
  		 (beamer ":latexonly:")
  		 (t nil))))
      (when regex
        (save-excursion
  	(goto-char (point-min))
  	(while (search-forward-regexp regex nil t)
  	  (replace-match ":noexport:"))))))
  (add-hook 'org-export-before-processing-functions 'ltb-org-export-filter)
#+end_src

* Some Beamer stuff                                              :beameronly:
** Frame 1                                                          :B_frame:
:PROPERTIES:
:BEAMER_env: frame
:END:
* Some LaTeX stuff                                                :latexonly:
In the beginning, there was \TeX{}.
* Other stuff
The end


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Orgmode and Beamer
  2024-10-29  2:05 ` Leo Butler
@ 2024-10-29  3:38   ` David Masterson
  0 siblings, 0 replies; 5+ messages in thread
From: David Masterson @ 2024-10-29  3:38 UTC (permalink / raw)
  To: Leo Butler; +Cc: emacs-orgmode@gnu.org

Thanks.  That's what I was looking for.  Didn't previously understand 
the use of the :*only: tags.

On 10/28/24 19:05, Leo Butler wrote:
> On Mon, Oct 28 2024, David Masterson <dsmasterson92630@outlook.com> wrote:
>
>> Does anyone have a recommendation on how to structure an Org document
>> such that it can be exported to either Latex or Beamer? Suppose you
>> have a (small) thesis that you are writing and you want to generate
>> Beamer slides of a high-level view of the document, but also generate
>> a PDF for the whole document.   I suppose you could break it into two
>> files, but then you'd have to copy (certain) changes from file to
>> file.  I was wondering if it could be done with one file such that
>> updates to the master document are simultaneously reflected in the
>> Beamer slides.  Is this going to involve liberal use of
>> #+BEGIN...#+END blocks?
>>
>> David Masterson
>>
>>
> I think I would add the tags
>
> #+TAGS: beameronly latexonly noexport
>
> and then define an elisp function that changes beameronly tags to
> noexport when the export backend is latex and similar for latexonly.
> Add that function to the `org-export-before-processing-functions' so it
> gets executed before export begins.
>
> Attached is an example.
>
> Note that you likely would need to fiddle with conditionally loading
> packages, depending on the export backend.
>
> Best regards,
> Leo
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-29  3:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-28 22:27 Orgmode and Beamer David Masterson
2024-10-28 23:57 ` Naresh Gurbuxani
2024-10-29  0:47   ` David Masterson
2024-10-29  2:05 ` Leo Butler
2024-10-29  3:38   ` David Masterson

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.