emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Macros in included file not expanded in batch export
@ 2014-07-14 22:24 Suvayu Ali
  2014-07-15  2:50 ` Nick Dokos
  2014-07-28 17:59 ` Fabrice Niessen
  0 siblings, 2 replies; 5+ messages in thread
From: Suvayu Ali @ 2014-07-14 22:24 UTC (permalink / raw)
  To: Emacs Org mode

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

Hi,

I am trying to export to LaTeX in batch mode, but it seems the exporter
ignores macros defined in included files when exporting in batch mode.

I tried to export like this:

  $ emacs --eval "(require 'ox-latex)" include-test.org \
        --eval '(org-LaTeX-export-to-latex nil nil nil t)' -f kill-emacs

  $ emacs --batch --eval "(require 'ox-latex)" include-test.org \
        --eval '(org-LaTeX-export-to-latex nil nil nil t)'

The first one exports correctly, the second doesn't.  The org files, and
the good and bad exported TeX files are attached.

Can someone else reproduce this?

Thanks,

-- 
Suvayu

Open source is the future. It sets us free.

[-- Attachment #2: include-test.org --]
[-- Type: text/plain, Size: 75 bytes --]

#+INCLUDE: include.org

* Some heading 1
{{{todo(foo)}}}

* Some heading 2

[-- Attachment #3: include.org --]
[-- Type: text/plain, Size: 57 bytes --]

#+MACRO: todo @@l:\todo[size=\scriptsize,$2]{@@$1@@l:}@@

[-- Attachment #4: include-test-good.tex --]
[-- Type: text/plain, Size: 110 bytes --]


\section{Some heading 1}
\label{sec-1}
\todo[size=\scriptsize,]{foo}

\section{Some heading 2}
\label{sec-2}

[-- Attachment #5: include-test-bad.tex --]
[-- Type: text/plain, Size: 84 bytes --]


\section{Some heading 1}
\label{sec-1}
foo

\section{Some heading 2}
\label{sec-2}

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

* Re: Macros in included file not expanded in batch export
  2014-07-14 22:24 Macros in included file not expanded in batch export Suvayu Ali
@ 2014-07-15  2:50 ` Nick Dokos
  2014-07-15  6:54   ` Suvayu Ali
  2014-07-28 17:59 ` Fabrice Niessen
  1 sibling, 1 reply; 5+ messages in thread
From: Nick Dokos @ 2014-07-15  2:50 UTC (permalink / raw)
  To: emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> Hi,
>
> I am trying to export to LaTeX in batch mode, but it seems the exporter
> ignores macros defined in included files when exporting in batch mode.
>
> I tried to export like this:
>
>   $ emacs --eval "(require 'ox-latex)" include-test.org \
>         --eval '(org-LaTeX-export-to-latex nil nil nil t)' -f kill-emacs
>
>   $ emacs --batch --eval "(require 'ox-latex)" include-test.org \
>         --eval '(org-LaTeX-export-to-latex nil nil nil t)'
>
> The first one exports correctly, the second doesn't.  The org files, and
> the good and bad exported TeX files are attached.
>

I haven't tried it but --batch implies -q, so it may be that the second
form is missing something essential from your init file - maybe?
-- 
Nick

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

* Re: Macros in included file not expanded in batch export
  2014-07-15  2:50 ` Nick Dokos
@ 2014-07-15  6:54   ` Suvayu Ali
  2014-07-15 10:49     ` Nick Dokos
  0 siblings, 1 reply; 5+ messages in thread
From: Suvayu Ali @ 2014-07-15  6:54 UTC (permalink / raw)
  To: emacs-orgmode

Hi Nick,

On Mon, Jul 14, 2014 at 10:50:53PM -0400, Nick Dokos wrote:
> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
> 
> > Hi,
> >
> > I am trying to export to LaTeX in batch mode, but it seems the exporter
> > ignores macros defined in included files when exporting in batch mode.
> >
> > I tried to export like this:
> >
> >   $ emacs --eval "(require 'ox-latex)" include-test.org \
> >         --eval '(org-LaTeX-export-to-latex nil nil nil t)' -f kill-emacs
> >
> >   $ emacs --batch --eval "(require 'ox-latex)" include-test.org \
> >         --eval '(org-LaTeX-export-to-latex nil nil nil t)'
> >
> > The first one exports correctly, the second doesn't.  The org files, and
> > the good and bad exported TeX files are attached.
> >
> 
> I haven't tried it but --batch implies -q, so it may be that the second
> form is missing something essential from your init file - maybe?

Indeed!  I wasn't aware --batch implies -q, I had checked the man page
before using it, but it isn't there.  Probably it is hidden somewhere in
the manual.

Although, I can't think of what config it must be.  As far as I recall I
do not have anything related to include files or macro expansion.

Anyway, thank you :).

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: Macros in included file not expanded in batch export
  2014-07-15  6:54   ` Suvayu Ali
@ 2014-07-15 10:49     ` Nick Dokos
  0 siblings, 0 replies; 5+ messages in thread
From: Nick Dokos @ 2014-07-15 10:49 UTC (permalink / raw)
  To: emacs-orgmode

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> Hi Nick,
>
> On Mon, Jul 14, 2014 at 10:50:53PM -0400, Nick Dokos wrote:
>> Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:
>> 
>> > Hi,
>> >
>> > I am trying to export to LaTeX in batch mode, but it seems the exporter
>> > ignores macros defined in included files when exporting in batch mode.
>> >
>> > I tried to export like this:
>> >
>> >   $ emacs --eval "(require 'ox-latex)" include-test.org \
>> >         --eval '(org-LaTeX-export-to-latex nil nil nil t)' -f kill-emacs
>> >
>> >   $ emacs --batch --eval "(require 'ox-latex)" include-test.org \
>> >         --eval '(org-LaTeX-export-to-latex nil nil nil t)'
>> >
>> > The first one exports correctly, the second doesn't.  The org files, and
>> > the good and bad exported TeX files are attached.
>> >
>> 
>> I haven't tried it but --batch implies -q, so it may be that the second
>> form is missing something essential from your init file - maybe?
>
> Indeed!  I wasn't aware --batch implies -q, I had checked the man page
> before using it, but it isn't there.  Probably it is hidden somewhere in
> the manual.
>

See

        (info "(emacs) Initial options")

-- 
Nick

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

* Re: Macros in included file not expanded in batch export
  2014-07-14 22:24 Macros in included file not expanded in batch export Suvayu Ali
  2014-07-15  2:50 ` Nick Dokos
@ 2014-07-28 17:59 ` Fabrice Niessen
  1 sibling, 0 replies; 5+ messages in thread
From: Fabrice Niessen @ 2014-07-28 17:59 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello Suvayu,

Suvayu Ali wrote:
> I am trying to export to LaTeX in batch mode, but it seems the exporter
> ignores macros defined in included files when exporting in batch mode.
>
> I tried to export like this:
>
>   $ emacs --eval "(require 'ox-latex)" include-test.org \
>         --eval '(org-LaTeX-export-to-latex nil nil nil t)' -f kill-emacs
>
>   $ emacs --batch --eval "(require 'ox-latex)" include-test.org \
>         --eval '(org-LaTeX-export-to-latex nil nil nil t)'
>
> The first one exports correctly, the second doesn't.  The org files, and
> the good and bad exported TeX files are attached.

In case you or others want a simplified command-line version of such
conversion tools, you can have a look at my Orgmk project on GitHub [1].

It provides you with:

- org2html [OPTION] FILE
- org2latex [OPTION] FILE
- org2pdf [OPTION] FILE
- org2beamerpdf [OPTION] FILE
- org2odt [OPTION] FILE
- org2txt [OPTION] FILE
- org-tangle FILE

stand-alone scripts, and the `orgmk' wrapper (to convert all files
which need to in a directory, and possibly recursively).

Best regards,
Fabrice

[1] https://github.com/fniessen/orgmk

-- 
Fabrice Niessen
Leuven, Belgium
http://www.pirilampo.org/

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

end of thread, other threads:[~2014-07-28 17:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-14 22:24 Macros in included file not expanded in batch export Suvayu Ali
2014-07-15  2:50 ` Nick Dokos
2014-07-15  6:54   ` Suvayu Ali
2014-07-15 10:49     ` Nick Dokos
2014-07-28 17:59 ` Fabrice Niessen

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