emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* select-tags in derived backend without effect?
@ 2014-10-08 11:33 Per Unneberg
  2014-10-08 19:35 ` Nicolas Goaziou
  2014-10-08 19:46 ` Per Unneberg
  0 siblings, 2 replies; 3+ messages in thread
From: Per Unneberg @ 2014-10-08 11:33 UTC (permalink / raw)
  To: Emacs-orgmode

Hi,

I'm currently experimenting exporting notes from my beamer presentations
as articles via use of the beamerarticle package. In some cases, I only
want to export the *notes* to the article. This can be achieved easily
enough by setting #+SELECT_TAGS: B_noteNH B_note, but it would be a
hassle to remove/insert this statement everytime I need/don't need
non-note material. Therefore, I tried defining a derived backend with
the following settings:

 (org-export-define-derived-backend 'beamerarticlenotes 'latex
    :export-block '("LATEX" "TEX")
    :menu-entry
    '(?n "Notes export"
         (
          (?M "As LaTeX buffer (LaTeX notes)" org-latex-export-as-latex)
          (?m "As LaTeX file (LaTeX notes)" org-latex-export-to-latex)
          (?N "As PDF file and open (LaTeX notes)" 
              (lambda (a s v b)
                (if a (org-latex-export-to-pdf t s v b)
                  (org-open-file (org-latex-export-to-pdf nil s v b)))))))
    
    :options-alist
    '(
      (:author "AUTHOR" nil "John Doe" t)
      (:select-tags "SELECT_TAGS" nil "B_noteNH" split)
      )
   )

However, I must be doing something wrong as adding this backend and
running C-c C-e n N on the MWE below does not work. Moreover, the author
name does not change to John Doe, which I included just for testing. I'm
running without startup file (emacs -Q), pointing to release tag
release_8.2.8. Adding #+SELECT_TAGS: B_noteNH and running C-c C-e l o
does give the desired result.

Any help would be appreciated.

Thanks,

Per


MWE:

#+STARTUP: indent beamer
#+OPTIONS: H:1 tags:nil
#+LATEX_HEADER: \usepackage{beamerarticle}
* Frame
** Block
Block 1

* Notes                                                            :B_noteNH:
:PROPERTIES:
:BEAMER_env: noteNH
:END:
Some notes

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

* Re: select-tags in derived backend without effect?
  2014-10-08 11:33 select-tags in derived backend without effect? Per Unneberg
@ 2014-10-08 19:35 ` Nicolas Goaziou
  2014-10-08 19:46 ` Per Unneberg
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Goaziou @ 2014-10-08 19:35 UTC (permalink / raw)
  To: Per Unneberg; +Cc: Emacs-orgmode

Hello,

Per Unneberg <punneberg@gmail.com> writes:

> I'm currently experimenting exporting notes from my beamer presentations
> as articles via use of the beamerarticle package. In some cases, I only
> want to export the *notes* to the article. This can be achieved easily
> enough by setting #+SELECT_TAGS: B_noteNH B_note, but it would be a
> hassle to remove/insert this statement everytime I need/don't need
> non-note material. Therefore, I tried defining a derived backend with
> the following settings:
>
>  (org-export-define-derived-backend 'beamerarticlenotes 'latex
>     :export-block '("LATEX" "TEX")
>     :menu-entry
>     '(?n "Notes export"
>          (
>           (?M "As LaTeX buffer (LaTeX notes)" org-latex-export-as-latex)
>           (?m "As LaTeX file (LaTeX notes)" org-latex-export-to-latex)
>           (?N "As PDF file and open (LaTeX notes)" 
>               (lambda (a s v b)
>                 (if a (org-latex-export-to-pdf t s v b)
>                   (org-open-file (org-latex-export-to-pdf nil s v b)))))))
>     
>     :options-alist
>     '(
>       (:author "AUTHOR" nil "John Doe" t)
>       (:select-tags "SELECT_TAGS" nil "B_noteNH" split)
>       )
>    )
>
> However, I must be doing something wrong as adding this backend and
> running C-c C-e n N on the MWE below does not work. Moreover, the author
> name does not change to John Doe, which I included just for testing. I'm
> running without startup file (emacs -Q), pointing to release tag
> release_8.2.8. Adding #+SELECT_TAGS: B_noteNH and running C-c C-e l o
> does give the desired result.
>
> Any help would be appreciated.

Your derived back-end calls `org-latex-export-as-latex', which in turn,
calls `latex' back-end. IOW, you are using functions that ignore your
back-end.

You need to write an export function that will use your back-end.
Another option is to use EXT-PLIST argument from existing functions.

BTW, `split' behaviour implies that value is a list. So select-tags
should be ("B_noteNH").


Regards,

-- 
Nicolas Goaziou

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

* Re: select-tags in derived backend without effect?
  2014-10-08 11:33 select-tags in derived backend without effect? Per Unneberg
  2014-10-08 19:35 ` Nicolas Goaziou
@ 2014-10-08 19:46 ` Per Unneberg
  1 sibling, 0 replies; 3+ messages in thread
From: Per Unneberg @ 2014-10-08 19:46 UTC (permalink / raw)
  To: Emacs-orgmode

Following up on my own message as I found the error (my bad!); the
export functions I use in the derived backend, e.g.
org-latex-export-to-pdf, still use the original backend:

(defun org-latex-export-to-pdf
  (&optional async subtreep visible-only body-only ext-plist)
  ...
  (interactive)
  (let ((outfile (org-export-output-file-name ".tex" subtreep)))
    (org-export-to-file 'latex outfile
                        ^^^^^^
      async subtreep visible-only body-only ext-plist
      (lambda (file) (org-latex-compile file)))))

I have obviously missed this point as it is also pointed out at the end
of section 12.15, as I see now on closer inspection.

/P

Per Unneberg <punneberg@gmail.com> writes:

> Hi,
>
> I'm currently experimenting exporting notes from my beamer
> presentations as articles via use of the beamerarticle package. In
> some cases, I only want to export the *notes* to the article. This can
> be achieved easily enough by setting #+SELECT_TAGS: B_noteNH B_note,
> but it would be a hassle to remove/insert this statement everytime I
> need/don't need non-note material. Therefore, I tried defining a
> derived backend with the following settings:
>
>  (org-export-define-derived-backend 'beamerarticlenotes 'latex
> :export-block '("LATEX" "TEX") :menu-entry '(?n "Notes export" ( (?M
> "As LaTeX buffer (LaTeX notes)" org-latex-export-as-latex) (?m "As
> LaTeX file (LaTeX notes)" org-latex-export-to-latex) (?N "As PDF file
> and open (LaTeX notes)" (lambda (a s v b) (if a
> (org-latex-export-to-pdf t s v b) (org-open-file
> (org-latex-export-to-pdf nil s v b)))))))
>     
>     :options-alist '( (:author "AUTHOR" nil "John Doe" t)
> (:select-tags "SELECT_TAGS" nil "B_noteNH" split) ) )
>
> However, I must be doing something wrong as adding this backend and
> running C-c C-e n N on the MWE below does not work. Moreover, the
> author name does not change to John Doe, which I included just for
> testing. I'm running without startup file (emacs -Q), pointing to
> release tag release_8.2.8. Adding #+SELECT_TAGS: B_noteNH and running
> C-c C-e l o does give the desired result.
>
> Any help would be appreciated.
>
> Thanks,
>
> Per
>
>
> MWE:
>
> #+STARTUP: indent beamer
> #+OPTIONS: H:1 tags:nil
> #+LATEX_HEADER: \usepackage{beamerarticle} * Frame ** Block Block 1
>
> * Notes :B_noteNH: :PROPERTIES: :BEAMER_env: noteNH :END: Some notes

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

end of thread, other threads:[~2014-10-08 19:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-08 11:33 select-tags in derived backend without effect? Per Unneberg
2014-10-08 19:35 ` Nicolas Goaziou
2014-10-08 19:46 ` Per Unneberg

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).