emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Use nomencl package with latex exporter?
@ 2012-08-06  9:24 Johan Ekh
  2012-08-06 12:14 ` Myles English
  0 siblings, 1 reply; 7+ messages in thread
From: Johan Ekh @ 2012-08-06  9:24 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi all,
I use the default latex exporter in org-mode v7.8 to write documents using
a custom latex class which is built on "article".
I would like to use the "nomencl" latex package if possible.

I have a latex src block before the first exported headline that looks like

#+begin_latex
lots of stuff
.
.
.
\makenomenclature
\printnomenclature
#+end_latex


and then I have additional src blocks that looks like

#+begin_latex
\nomenclature[c]{$\bm{q}^e$}{loads in all nodes belonging to element
$e$\nomunit{[N]}}%
#+end_latex

throughout my document.

Is this a viable approach? And how can I execute the "makeindex" program to
actually generate the
nomenlature list? My route to pdf looks like

(setq org-latex-to-pdf-process
        '("pdflatex -interaction nonstopmode %b"
          "bibtex %b"
          "pdflatex -interaction nonstopmode %b"
          "pdflatex -interaction nonstopmode %b"))


From the shell I usually run something like

makeindex filename.nlo -s nomencl.ist -o filename.nls

followed by latex or pdflatex, but how can I get the exporter to do this?

/Johan

[-- Attachment #2: Type: text/html, Size: 1292 bytes --]

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

* Re: Use nomencl package with latex exporter?
  2012-08-06  9:24 Use nomencl package with latex exporter? Johan Ekh
@ 2012-08-06 12:14 ` Myles English
  2012-08-06 19:26   ` Johan Ekh
  0 siblings, 1 reply; 7+ messages in thread
From: Myles English @ 2012-08-06 12:14 UTC (permalink / raw)
  To: Johan Ekh; +Cc: emacs-orgmode


Johan Ekh writes:

> Hi all,
> I use the default latex exporter in org-mode v7.8 to write documents using
> a custom latex class which is built on "article".
> I would like to use the "nomencl" latex package if possible.

> From the shell I usually run something like
>
> makeindex filename.nlo -s nomencl.ist -o filename.nls
>
> followed by latex or pdflatex, but how can I get the exporter to do
> this?

I don't know the answer to your question, but when I came across the
same problem, I used a makefile-like solution because I felt that the
building process was becoming sufficiently complicated to warrant using
a specialised tool.  If you are comfortable with CMake already it may be
worth a look.  Have a look for "UseLatex.cmake".

Basically you get emacs to export the .tex file from the .org file:

add_custom_command(
  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mypaper.tex
  COMMAND emacs --batch
    --visit=${CMAKE_CURRENT_BINARY_DIR}/mypaper.org
    --load=/home/me/myfuncs.el
    --funcall org-export-as-latex-batch
  DEPENDS orgfile
  COMMENT "Exporting orgmode file to LaTeX using emacs"
  )

And then bibtex and nomenclature are asked to do their stuff, and a pdf
is produced, with something like this directive:

add_latex_document( mypaper.tex
  INPUTS tex/bibliography.tex
         texlib/mystyle.sty
  BIBFILES texlib/mylibrary.bib
  DEFAULT_PDF
  USE_NOMENCL
)

I also get it to generate all my R plots.  Other advantages are that you
get an out-of-source build that is isolated (to some extent) in its own
directory.  And I think it is easier to diagnose the problems when
things go wrong, better than staring at an elisp backtrace.  Now if org
would write my CMakeList.txt for me, that would be a fine thing.

Myles

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

* Re: Use nomencl package with latex exporter?
  2012-08-06 12:14 ` Myles English
@ 2012-08-06 19:26   ` Johan Ekh
  2012-08-06 19:35     ` Nick Dokos
  0 siblings, 1 reply; 7+ messages in thread
From: Johan Ekh @ 2012-08-06 19:26 UTC (permalink / raw)
  To: Myles English; +Cc: emacs-orgmode

Thank you Myles,
I'm not that comfortable with cmake but I will give your solution a try and report My milage.

/ Johan

Sent from my iPad

On 6 aug 2012, at 14:14, Myles English <mylesenglish@gmail.com> wrote:

> 
> Johan Ekh writes:
> 
>> Hi all,
>> I use the default latex exporter in org-mode v7.8 to write documents using
>> a custom latex class which is built on "article".
>> I would like to use the "nomencl" latex package if possible.
> 
>> From the shell I usually run something like
>> 
>> makeindex filename.nlo -s nomencl.ist -o filename.nls
>> 
>> followed by latex or pdflatex, but how can I get the exporter to do
>> this?
> 
> I don't know the answer to your question, but when I came across the
> same problem, I used a makefile-like solution because I felt that the
> building process was becoming sufficiently complicated to warrant using
> a specialised tool.  If you are comfortable with CMake already it may be
> worth a look.  Have a look for "UseLatex.cmake".
> 
> Basically you get emacs to export the .tex file from the .org file:
> 
> add_custom_command(
>  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mypaper.tex
>  COMMAND emacs --batch
>    --visit=${CMAKE_CURRENT_BINARY_DIR}/mypaper.org
>    --load=/home/me/myfuncs.el
>    --funcall org-export-as-latex-batch
>  DEPENDS orgfile
>  COMMENT "Exporting orgmode file to LaTeX using emacs"
>  )
> 
> And then bibtex and nomenclature are asked to do their stuff, and a pdf
> is produced, with something like this directive:
> 
> add_latex_document( mypaper.tex
>  INPUTS tex/bibliography.tex
>         texlib/mystyle.sty
>  BIBFILES texlib/mylibrary.bib
>  DEFAULT_PDF
>  USE_NOMENCL
> )
> 
> I also get it to generate all my R plots.  Other advantages are that you
> get an out-of-source build that is isolated (to some extent) in its own
> directory.  And I think it is easier to diagnose the problems when
> things go wrong, better than staring at an elisp backtrace.  Now if org
> would write my CMakeList.txt for me, that would be a fine thing.
> 
> Myles

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

* Re: Use nomencl package with latex exporter?
  2012-08-06 19:26   ` Johan Ekh
@ 2012-08-06 19:35     ` Nick Dokos
  2012-08-08  6:40       ` Johan Ekh
  0 siblings, 1 reply; 7+ messages in thread
From: Nick Dokos @ 2012-08-06 19:35 UTC (permalink / raw)
  To: Johan Ekh; +Cc: Myles English, emacs-orgmode

Johan Ekh <ekh.johan@gmail.com> wrote:

> Thank you Myles,
> I'm not that comfortable with cmake but I will give your solution a try and report My milage.
> 
> / Johan
> 
> Sent from my iPad
> 
> On 6 aug 2012, at 14:14, Myles English <mylesenglish@gmail.com> wrote:
> 
> > 
> > Johan Ekh writes:
> > 
> >> Hi all,
> >> I use the default latex exporter in org-mode v7.8 to write documents using
> >> a custom latex class which is built on "article".
> >> I would like to use the "nomencl" latex package if possible.
> > 
> >> From the shell I usually run something like
> >> 
> >> makeindex filename.nlo -s nomencl.ist -o filename.nls
> >> 
> >> followed by latex or pdflatex, but how can I get the exporter to do
> >> this?

Customize the variable org-latex-to-pdf-process appropriately.

Nick

> > I don't know the answer to your question, but when I came across the
> > same problem, I used a makefile-like solution because I felt that the
> > building process was becoming sufficiently complicated to warrant using
> > a specialised tool.  If you are comfortable with CMake already it may be
> > worth a look.  Have a look for "UseLatex.cmake".
> > 
> > Basically you get emacs to export the .tex file from the .org file:
> > 
> > add_custom_command(
> >  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mypaper.tex
> >  COMMAND emacs --batch
> >    --visit=${CMAKE_CURRENT_BINARY_DIR}/mypaper.org
> >    --load=/home/me/myfuncs.el
> >    --funcall org-export-as-latex-batch
> >  DEPENDS orgfile
> >  COMMENT "Exporting orgmode file to LaTeX using emacs"
> >  )
> > 
> > And then bibtex and nomenclature are asked to do their stuff, and a pdf
> > is produced, with something like this directive:
> > 
> > add_latex_document( mypaper.tex
> >  INPUTS tex/bibliography.tex
> >         texlib/mystyle.sty
> >  BIBFILES texlib/mylibrary.bib
> >  DEFAULT_PDF
> >  USE_NOMENCL
> > )
> > 
> > I also get it to generate all my R plots.  Other advantages are that you
> > get an out-of-source build that is isolated (to some extent) in its own
> > directory.  And I think it is easier to diagnose the problems when
> > things go wrong, better than staring at an elisp backtrace.  Now if org
> > would write my CMakeList.txt for me, that would be a fine thing.
> > 
> > Myles
> 

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

* Re: Use nomencl package with latex exporter?
  2012-08-06 19:35     ` Nick Dokos
@ 2012-08-08  6:40       ` Johan Ekh
  2012-08-08  8:05         ` Andrew Young
  2012-08-08 16:24         ` Nick Dokos
  0 siblings, 2 replies; 7+ messages in thread
From: Johan Ekh @ 2012-08-08  6:40 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Myles English, emacs-orgmode

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

Thanks,
can you give some hints on how to customize it, or point me to some
information?

/Johan

On Mon, Aug 6, 2012 at 9:35 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:

> Johan Ekh <ekh.johan@gmail.com> wrote:
>
> > Thank you Myles,
> > I'm not that comfortable with cmake but I will give your solution a try
> and report My milage.
> >
> > / Johan
> >
> > Sent from my iPad
> >
> > On 6 aug 2012, at 14:14, Myles English <mylesenglish@gmail.com> wrote:
> >
> > >
> > > Johan Ekh writes:
> > >
> > >> Hi all,
> > >> I use the default latex exporter in org-mode v7.8 to write documents
> using
> > >> a custom latex class which is built on "article".
> > >> I would like to use the "nomencl" latex package if possible.
> > >
> > >> From the shell I usually run something like
> > >>
> > >> makeindex filename.nlo -s nomencl.ist -o filename.nls
> > >>
> > >> followed by latex or pdflatex, but how can I get the exporter to do
> > >> this?
>
> Customize the variable org-latex-to-pdf-process appropriately.
>
> Nick
>
> > > I don't know the answer to your question, but when I came across the
> > > same problem, I used a makefile-like solution because I felt that the
> > > building process was becoming sufficiently complicated to warrant using
> > > a specialised tool.  If you are comfortable with CMake already it may
> be
> > > worth a look.  Have a look for "UseLatex.cmake".
> > >
> > > Basically you get emacs to export the .tex file from the .org file:
> > >
> > > add_custom_command(
> > >  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mypaper.tex
> > >  COMMAND emacs --batch
> > >    --visit=${CMAKE_CURRENT_BINARY_DIR}/mypaper.org
> > >    --load=/home/me/myfuncs.el
> > >    --funcall org-export-as-latex-batch
> > >  DEPENDS orgfile
> > >  COMMENT "Exporting orgmode file to LaTeX using emacs"
> > >  )
> > >
> > > And then bibtex and nomenclature are asked to do their stuff, and a pdf
> > > is produced, with something like this directive:
> > >
> > > add_latex_document( mypaper.tex
> > >  INPUTS tex/bibliography.tex
> > >         texlib/mystyle.sty
> > >  BIBFILES texlib/mylibrary.bib
> > >  DEFAULT_PDF
> > >  USE_NOMENCL
> > > )
> > >
> > > I also get it to generate all my R plots.  Other advantages are that
> you
> > > get an out-of-source build that is isolated (to some extent) in its own
> > > directory.  And I think it is easier to diagnose the problems when
> > > things go wrong, better than staring at an elisp backtrace.  Now if org
> > > would write my CMakeList.txt for me, that would be a fine thing.
> > >
> > > Myles
> >
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 3709 bytes --]

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

* Re: Use nomencl package with latex exporter?
  2012-08-08  6:40       ` Johan Ekh
@ 2012-08-08  8:05         ` Andrew Young
  2012-08-08 16:24         ` Nick Dokos
  1 sibling, 0 replies; 7+ messages in thread
From: Andrew Young @ 2012-08-08  8:05 UTC (permalink / raw)
  To: Johan Ekh; +Cc: emacs-orgmode

Hello Johan,

On Wed, Aug 8, 2012 at 2:40 AM, Johan Ekh <ekh.johan@gmail.com> wrote:
> Thanks,
> can you give some hints on how to customize it, or point me to some
> information?

To have makeindex run, try evaluating the following elisp:

(setq org-latex-to-pdf-process
        '("pdflatex -interaction nonstopmode %b"
          "bibtex %b"
          "makeindex %b.nlo -s nomencl.ist -o %b.nls"
          "pdflatex -interaction nonstopmode %b"
          "pdflatex -interaction nonstopmode %b"))

Alternatively, you can customize the variable org-latex-to-pdf-process
as Nick suggests, to accomplish the same thing. Use the following
command:

M-x customize-variable org-latex-to-pdf-process

More documentation is available through customize, and there is lots
of great information available here:
http://orgmode.org/worg/org-tutorials/org-latex-export.html

Hope this helps,

Andrew


>
> /Johan
>
>
> On Mon, Aug 6, 2012 at 9:35 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
>>
>> Johan Ekh <ekh.johan@gmail.com> wrote:
>>
>> > Thank you Myles,
>> > I'm not that comfortable with cmake but I will give your solution a try
>> > and report My milage.
>> >
>> > / Johan
>> >
>> > Sent from my iPad
>> >
>> > On 6 aug 2012, at 14:14, Myles English <mylesenglish@gmail.com> wrote:
>> >
>> > >
>> > > Johan Ekh writes:
>> > >
>> > >> Hi all,
>> > >> I use the default latex exporter in org-mode v7.8 to write documents
>> > >> using
>> > >> a custom latex class which is built on "article".
>> > >> I would like to use the "nomencl" latex package if possible.
>> > >
>> > >> From the shell I usually run something like
>> > >>
>> > >> makeindex filename.nlo -s nomencl.ist -o filename.nls
>> > >>
>> > >> followed by latex or pdflatex, but how can I get the exporter to do
>> > >> this?
>>
>> Customize the variable org-latex-to-pdf-process appropriately.
>>
>> Nick
>>
>> > > I don't know the answer to your question, but when I came across the
>> > > same problem, I used a makefile-like solution because I felt that the
>> > > building process was becoming sufficiently complicated to warrant
>> > > using
>> > > a specialised tool.  If you are comfortable with CMake already it may
>> > > be
>> > > worth a look.  Have a look for "UseLatex.cmake".
>> > >
>> > > Basically you get emacs to export the .tex file from the .org file:
>> > >
>> > > add_custom_command(
>> > >  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mypaper.tex
>> > >  COMMAND emacs --batch
>> > >    --visit=${CMAKE_CURRENT_BINARY_DIR}/mypaper.org
>> > >    --load=/home/me/myfuncs.el
>> > >    --funcall org-export-as-latex-batch
>> > >  DEPENDS orgfile
>> > >  COMMENT "Exporting orgmode file to LaTeX using emacs"
>> > >  )
>> > >
>> > > And then bibtex and nomenclature are asked to do their stuff, and a
>> > > pdf
>> > > is produced, with something like this directive:
>> > >
>> > > add_latex_document( mypaper.tex
>> > >  INPUTS tex/bibliography.tex
>> > >         texlib/mystyle.sty
>> > >  BIBFILES texlib/mylibrary.bib
>> > >  DEFAULT_PDF
>> > >  USE_NOMENCL
>> > > )
>> > >
>> > > I also get it to generate all my R plots.  Other advantages are that
>> > > you
>> > > get an out-of-source build that is isolated (to some extent) in its
>> > > own
>> > > directory.  And I think it is easier to diagnose the problems when
>> > > things go wrong, better than staring at an elisp backtrace.  Now if
>> > > org
>> > > would write my CMakeList.txt for me, that would be a fine thing.
>> > >
>> > > Myles
>> >
>>
>>
>>
>

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

* Re: Use nomencl package with latex exporter?
  2012-08-08  6:40       ` Johan Ekh
  2012-08-08  8:05         ` Andrew Young
@ 2012-08-08 16:24         ` Nick Dokos
  1 sibling, 0 replies; 7+ messages in thread
From: Nick Dokos @ 2012-08-08 16:24 UTC (permalink / raw)
  To: Johan Ekh; +Cc: Myles English, emacs-orgmode

Johan Ekh <ekh.johan@gmail.com> wrote:

> Thanks,
> can you give some hints on how to customize it, or point me to some information?
> 

C-h v org-latex-to-pdf-process should tell you everything you need: it's just a list
of shell commands and they are executed in sequence. All you have to do is interpolate
the makeindex command in there with the appropriate escapes.

Nick

> /Johan
> 
> On Mon, Aug 6, 2012 at 9:35 PM, Nick Dokos <nicholas.dokos@hp.com> wrote:
> 
>     Johan Ekh <ekh.johan@gmail.com> wrote:
>    
>     > Thank you Myles,
>     > I'm not that comfortable with cmake but I will give your solution a try and report My milage.
>     >
>     > / Johan
>     >
>     > Sent from my iPad
>     >
>     > On 6 aug 2012, at 14:14, Myles English <mylesenglish@gmail.com> wrote:
>     >
>     > >
>     > > Johan Ekh writes:
>     > >
>     > >> Hi all,
>     > >> I use the default latex exporter in org-mode v7.8 to write documents using
>     > >> a custom latex class which is built on "article".
>     > >> I would like to use the "nomencl" latex package if possible.
>     > >
>     > >> From the shell I usually run something like
>     > >>
>     > >> makeindex filename.nlo -s nomencl.ist -o filename.nls
>     > >>
>     > >> followed by latex or pdflatex, but how can I get the exporter to do
>     > >> this?
>    
>     Customize the variable org-latex-to-pdf-process appropriately.
>    
>     Nick
>    
>     > > I don't know the answer to your question, but when I came across the
>     > > same problem, I used a makefile-like solution because I felt that the
>     > > building process was becoming sufficiently complicated to warrant using
>     > > a specialised tool.  If you are comfortable with CMake already it may be
>     > > worth a look.  Have a look for "UseLatex.cmake".
>     > >
>     > > Basically you get emacs to export the .tex file from the .org file:
>     > >
>     > > add_custom_command(
>     > >  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mypaper.tex
>     > >  COMMAND emacs --batch
>     > >    --visit=${CMAKE_CURRENT_BINARY_DIR}/mypaper.org
>     > >    --load=/home/me/myfuncs.el
>     > >    --funcall org-export-as-latex-batch
>     > >  DEPENDS orgfile
>     > >  COMMENT "Exporting orgmode file to LaTeX using emacs"
>     > >  )
>     > >
>     > > And then bibtex and nomenclature are asked to do their stuff, and a pdf
>     > > is produced, with something like this directive:
>     > >
>     > > add_latex_document( mypaper.tex
>     > >  INPUTS tex/bibliography.tex
>     > >         texlib/mystyle.sty
>     > >  BIBFILES texlib/mylibrary.bib
>     > >  DEFAULT_PDF
>     > >  USE_NOMENCL
>     > > )
>     > >
>     > > I also get it to generate all my R plots.  Other advantages are that you
>     > > get an out-of-source build that is isolated (to some extent) in its own
>     > > directory.  And I think it is easier to diagnose the problems when
>     > > things go wrong, better than staring at an elisp backtrace.  Now if org
>     > > would write my CMakeList.txt for me, that would be a fine thing.
>     > >
>     > > Myles
>     >
> 
> 
> ----------------------------------------------------
> Alternatives:
> 
> ----------------------------------------------------

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

end of thread, other threads:[~2012-08-08 16:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-06  9:24 Use nomencl package with latex exporter? Johan Ekh
2012-08-06 12:14 ` Myles English
2012-08-06 19:26   ` Johan Ekh
2012-08-06 19:35     ` Nick Dokos
2012-08-08  6:40       ` Johan Ekh
2012-08-08  8:05         ` Andrew Young
2012-08-08 16:24         ` Nick Dokos

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