emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* can inline tasks export to latex via batch?
@ 2012-02-21 17:06 Myles English
  2012-02-21 18:18 ` Jambunathan K
  0 siblings, 1 reply; 4+ messages in thread
From: Myles English @ 2012-02-21 17:06 UTC (permalink / raw)
  To: emacs-orgmode Mode

Hello,

Does anyone know if I can export inline tasks to latex using --batch
from bash?  When passed as the --funcall option, org-export-as-ascii
will export inline tasks but org-export-as-latex-batch won't.  Setting
file level options don't appear to help.

A minimal example follows.

Emacs 23.4.1
org release_7.8.03.420.gaf2a4

Thanks,

Myles

#------------------------------------- b.org ---

#+EXPORT_EXCLUDE_TAGS: noexport

* A Heading
** A Sub heading
   And now here is an inline task

*************** TODO Here I am, I'm inline
		Notes notes notes
*************** END

** TODO I'm not inline
   Can you see me?

* Tests 							   :noexport:
** Test LaTeX export
    #+BEGIN_SRC sh :results verbatim
      emacs --batch \
          --load=$HOME/.emacs.d/plugins/org-mode/lisp/org.el \
          --visit=~/tmp/tstexp/b.org \
          --funcall org-export-as-latex-batch
      cat ~/tmp/tstexp/b.tex
    #+END_SRC

    #+RESULTS:
    #+begin_example
    % Created 2012-02-21 Tue 16:41
    \documentclass[11pt]{article}
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage{fixltx2e}
    \usepackage{graphicx}
    \usepackage{longtable}
    \usepackage{float}
    \usepackage{wrapfig}
    \usepackage{soul}
    \usepackage{textcomp}
    \usepackage{marvosym}
    \usepackage{wasysym}
    \usepackage{latexsym}
    \usepackage{amssymb}
    \usepackage{hyperref}
    \tolerance=1000
    \providecommand{\alert}[1]{\textbf{#1}}

    \title{b}
    \author{}
    \date{\today}

    \begin{document}

    \maketitle

    \setcounter{tocdepth}{3}
    \tableofcontents
    \vspace*{1cm}

    \section{A Heading}
    \label{sec-1}
    \subsection{A Sub heading}
    \label{sec-1-1}

       And now here is an inline task
    \subsection{\textbf{TODO} I'm not inline}
    \label{sec-1-2}

       Can you see me?

    \end{document}
#+end_example


** Test text export
   #+BEGIN_SRC sh :results verbatim
     emacs --batch \
         --load=$HOME/.emacs.d/plugins/org-mode/lisp/org.el \
         --visit=~/tmp/tstexp/b.org \
         --funcall org-export-as-ascii
     cat ~/tmp/tstexp/b.txt
   #+END_SRC

   #+RESULTS:
   #+begin_example
				     b
				     =

   Author: 
   Date: 2012-02-21 16:42:07 GMT


   Table of Contents
   =================
   1 A Heading
       1.1 A Sub heading
       1.2 I'm not inline


   1 A Heading 
   ------------

   1.1 A Sub heading 
   ==================
      And now here is an inline task

			 - TODO Here I am, I'm inline 
			   Notes notes notes
			 - END 


   1.2 TODO I'm not inline 
   ========================
      Can you see me?

#+end_example

(emacs-version)"GNU Emacs 23.4.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.9)
 of 2012-02-01 on shirley.hoetzel.info"

(org-version) "Org-mode version 7.8.03 (release_7.8.03.420.gaf2a4)"

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

* Re: can inline tasks export to latex via batch?
  2012-02-21 17:06 can inline tasks export to latex via batch? Myles English
@ 2012-02-21 18:18 ` Jambunathan K
  2012-02-22  0:52   ` Myles English
  0 siblings, 1 reply; 4+ messages in thread
From: Jambunathan K @ 2012-02-21 18:18 UTC (permalink / raw)
  To: Myles English; +Cc: emacs-orgmode Mode


> Hello,
>
> Does anyone know if I can export inline tasks to latex using --batch
> from bash?  When passed as the --funcall option, org-export-as-ascii
> will export inline tasks but org-export-as-latex-batch won't.  Setting
> file level options don't appear to help.

Does your command line contain (require 'org-inlinetask)?

> A minimal example follows.
>
> Emacs 23.4.1
> org release_7.8.03.420.gaf2a4
>
> Thanks,
>
> Myles
>
> #------------------------------------- b.org ---
>
> #+EXPORT_EXCLUDE_TAGS: noexport
>
> * A Heading
> ** A Sub heading
>    And now here is an inline task
>
> *************** TODO Here I am, I'm inline
> 		Notes notes notes
> *************** END
>
> ** TODO I'm not inline
>    Can you see me?
>
> * Tests 							   :noexport:
> ** Test LaTeX export
>     #+BEGIN_SRC sh :results verbatim
>       emacs --batch \
>           --load=$HOME/.emacs.d/plugins/org-mode/lisp/org.el \
>           --visit=~/tmp/tstexp/b.org \
>           --funcall org-export-as-latex-batch
>       cat ~/tmp/tstexp/b.tex
>     #+END_SRC
>
>     #+RESULTS:
>     #+begin_example
>     % Created 2012-02-21 Tue 16:41
>     \documentclass[11pt]{article}
>     \usepackage[utf8]{inputenc}
>     \usepackage[T1]{fontenc}
>     \usepackage{fixltx2e}
>     \usepackage{graphicx}
>     \usepackage{longtable}
>     \usepackage{float}
>     \usepackage{wrapfig}
>     \usepackage{soul}
>     \usepackage{textcomp}
>     \usepackage{marvosym}
>     \usepackage{wasysym}
>     \usepackage{latexsym}
>     \usepackage{amssymb}
>     \usepackage{hyperref}
>     \tolerance=1000
>     \providecommand{\alert}[1]{\textbf{#1}}
>
>     \title{b}
>     \author{}
>     \date{\today}
>
>     \begin{document}
>
>     \maketitle
>
>     \setcounter{tocdepth}{3}
>     \tableofcontents
>     \vspace*{1cm}
>
>     \section{A Heading}
>     \label{sec-1}
>     \subsection{A Sub heading}
>     \label{sec-1-1}
>
>        And now here is an inline task
>     \subsection{\textbf{TODO} I'm not inline}
>     \label{sec-1-2}
>
>        Can you see me?
>
>     \end{document}
> #+end_example
>
>
> ** Test text export
>    #+BEGIN_SRC sh :results verbatim
>      emacs --batch \
>          --load=$HOME/.emacs.d/plugins/org-mode/lisp/org.el \
>          --visit=~/tmp/tstexp/b.org \
>          --funcall org-export-as-ascii
>      cat ~/tmp/tstexp/b.txt
>    #+END_SRC
>
>    #+RESULTS:
>    #+begin_example
> 				     b
> 				     =
>
>    Author: 
>    Date: 2012-02-21 16:42:07 GMT
>
>
>    Table of Contents
>    =================
>    1 A Heading
>        1.1 A Sub heading
>        1.2 I'm not inline
>
>
>    1 A Heading 
>    ------------
>
>    1.1 A Sub heading 
>    ==================
>       And now here is an inline task
>
> 			 - TODO Here I am, I'm inline 
> 			   Notes notes notes
> 			 - END 
>
>
>    1.2 TODO I'm not inline 
>    ========================
>       Can you see me?
>
> #+end_example
>
> (emacs-version)"GNU Emacs 23.4.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.9)
>  of 2012-02-01 on shirley.hoetzel.info"
>
> (org-version) "Org-mode version 7.8.03 (release_7.8.03.420.gaf2a4)"
>
>

-- 

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

* Re: can inline tasks export to latex via batch?
  2012-02-21 18:18 ` Jambunathan K
@ 2012-02-22  0:52   ` Myles English
  2012-02-22 13:40     ` Myles English
  0 siblings, 1 reply; 4+ messages in thread
From: Myles English @ 2012-02-22  0:52 UTC (permalink / raw)
  To: Jambunathan K; +Cc: emacs-orgmode Mode

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

On 21 February 2012 18:18, Jambunathan K wrote:
>
A few hours ago, Myles wrote:
>> Hello,
>>
>> Does anyone know if I can export inline tasks to latex using --batch
>> from bash?  When passed as the --funcall option, org-export-as-ascii
>> will export inline tasks but org-export-as-latex-batch won't.  Setting
>> file level options don't appear to help.
>
> Does your command line contain (require 'org-inlinetask)?

Thanks for the suggestion.  In the minimal test file b.org (reattached
here with one more headline), neither the block using
org-export-as-latex-batch nor the one using org-export-as-ascii
contained "(require 'org-inlinetask)" however the ascii export *did*
export the inline task.

My .emacs used to have (require 'org-inlinetask) but doesn't anymore,
I think it merged with something, and I can export latex with inline
todos from my normal emacs.

Nonetheless, I tried adding the 'require' (see headline 'WITH require
org-inline') and still no banana.

Any other ideas?

Myles

[-- Attachment #2: b.org --]
[-- Type: application/octet-stream, Size: 3972 bytes --]

#+EXPORT_EXCLUDE_TAGS: noexport

* A Heading
** A Sub heading
   And now here is an inline task

*************** TODO Here I am, I'm inline
		Notes notes notes
*************** END

** TODO I'm not inline
   Can you see me?

* Tests 							   :noexport:
** Test LaTeX export
*** WITHOUT require org-inline
    #+BEGIN_SRC sh :results verbatim
      emacs --batch \
          --load=$HOME/.emacs.d/plugins/org-mode/lisp/org.el \
          --visit=~/tmp/tstexp/b.org \
          --funcall org-export-as-latex-batch
      cat ~/tmp/tstexp/b.tex
    #+END_SRC

    #+RESULTS:
    #+begin_example
    % Created 2012-02-21 Tue 16:41
    \documentclass[11pt]{article}
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage{fixltx2e}
    \usepackage{graphicx}
    \usepackage{longtable}
    \usepackage{float}
    \usepackage{wrapfig}
    \usepackage{soul}
    \usepackage{textcomp}
    \usepackage{marvosym}
    \usepackage{wasysym}
    \usepackage{latexsym}
    \usepackage{amssymb}
    \usepackage{hyperref}
    \tolerance=1000
    \providecommand{\alert}[1]{\textbf{#1}}

    \title{b}
    \author{}
    \date{\today}

    \begin{document}

    \maketitle

    \setcounter{tocdepth}{3}
    \tableofcontents
    \vspace*{1cm}

    \section{A Heading}
    \label{sec-1}
    \subsection{A Sub heading}
    \label{sec-1-1}

       And now here is an inline task
    \subsection{\textbf{TODO} I'm not inline}
    \label{sec-1-2}

       Can you see me?

    \end{document}
#+end_example

*** WITH require org-inline
    #+begin_src sh :var TANGLED=(org-babel-tangle) :tangle no
    wc $TANGLED
    #+end_src

    #+RESULTS:
    : 2  2 27 /home/myles/tmp/tstexp/afunc.el

    #+BEGIN_SRC elisp :tangle /home/myles/tmp/tstexp/afunc.el
    (require 'org-inlinetask)
    #+END_SRC

    #+BEGIN_SRC sh :results verbatim
      emacs --batch \
          -eval "(add-to-list 'load-path \"${HOME}/.emacs.d/plugins/org-mode/lisp/\")" \
          --load=$HOME/.emacs.d/plugins/org-mode/lisp/org.el \
          --visit=~/tmp/tstexp/b.org \
          --funcall org-export-as-latex-batch \
          -l $HOME/tmp/tstexp/afunc.el
      cat ~/tmp/tstexp/b.tex
    #+END_SRC

    #+RESULTS:
    #+begin_example
    % Created 2012-02-22 Wed 00:48
    \documentclass[11pt]{article}
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage{fixltx2e}
    \usepackage{graphicx}
    \usepackage{longtable}
    \usepackage{float}
    \usepackage{wrapfig}
    \usepackage{soul}
    \usepackage{textcomp}
    \usepackage{marvosym}
    \usepackage{wasysym}
    \usepackage{latexsym}
    \usepackage{amssymb}
    \usepackage{hyperref}
    \tolerance=1000
    \providecommand{\alert}[1]{\textbf{#1}}

    \title{b}
    \author{}
    \date{\today}
    \hypersetup{
      pdfkeywords={},
      pdfsubject={},
      pdfcreator={Emacs Org-mode version 7.8.03}}

    \begin{document}

    \maketitle

    \setcounter{tocdepth}{3}
    \tableofcontents
    \vspace*{1cm}

    \section{A Heading}
    \label{sec-1}
    \subsection{A Sub heading}
    \label{sec-1-1}

       And now here is an inline task
    \subsection{\textbf{TODO} I'm not inline}
    \label{sec-1-2}

       Can you see me?

    \end{document}
#+end_example

** Test text export
   #+BEGIN_SRC sh :results verbatim
     emacs --batch \
         --load=$HOME/.emacs.d/plugins/org-mode/lisp/org.el \
         --visit=~/tmp/tstexp/b.org \
         --funcall org-export-as-ascii
     cat ~/tmp/tstexp/b.txt
   #+END_SRC

   #+RESULTS:
   #+begin_example
				     b
				     =

   Author: 
   Date: 2012-02-21 16:42:07 GMT

   Table of Contents
   =================
   1 A Heading
       1.1 A Sub heading
       1.2 I'm not inline

   1 A Heading 
   ------------

   1.1 A Sub heading 
   ==================
      And now here is an inline task

			 - TODO Here I am, I'm inline 
			   Notes notes notes
			 - END 

   1.2 TODO I'm not inline 
   ========================
      Can you see me?

#+end_example

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

* Re: can inline tasks export to latex via batch?
  2012-02-22  0:52   ` Myles English
@ 2012-02-22 13:40     ` Myles English
  0 siblings, 0 replies; 4+ messages in thread
From: Myles English @ 2012-02-22 13:40 UTC (permalink / raw)
  To: emacs-orgmode Mode; +Cc: Jambunathan K


>> On Wed, 22 Feb 2012 00:52:06 +0000, Myles English said:

  > On 21 February 2012 18:18, Jambunathan K wrote:
  >>> Does anyone know if I can export inline tasks to latex using --batch
  >>> from bash? When passed as the --funcall option, org-export-as-ascii
  >>> will export inline tasks but org-export-as-latex-batch
  >>> won't. Setting file level options don't appear to help.
  
  >> Does your command line contain (require 'org-inlinetask)?

  > Thanks for the suggestion.

That was indeed to problem, and typo of mine.  For the record, this
worked, and the "&&" seems to speed things up considerably:

#+BEGIN_SRC sh :results verbatim
    echo "(require 'org-inlinetask)" > /home/myles/tmp/tstexp/afunc.el
    emacs --batch \
          --load=$HOME/.emacs.d/plugins/org-mode/lisp/org.el \
          --visit=~/tmp/tstexp/b.org \
          --load=afunc.el \
          --funcall org-export-as-latex-batch &&
    cat ~/tmp/tstexp/b.tex
#+END_SRC

May be it is inconsistent that exporting inline tasks worked using
org-export-as-ascii without the 'require' but org-export-as-latex-batch
didn't.  Consistency seems to crop up here every so often.  But it
works.

Myles

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

end of thread, other threads:[~2012-02-22 13:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-21 17:06 can inline tasks export to latex via batch? Myles English
2012-02-21 18:18 ` Jambunathan K
2012-02-22  0:52   ` Myles English
2012-02-22 13:40     ` Myles English

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