[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Rake task for building latex?

Stefano Crocco

11/3/2008 9:41:00 AM

Does anyone know whether there's a rake task to build latex files, including
taking care of whether latex should be run one or more times? I searched
google, this mailing list, rubyforge and RAA, but found nothing. If nobody has
already written one, I can do it myself, but I wanted to be sure before
attempting it.

Thanks in andvance

Stefano

7 Answers

Josef 'Jupp' Schugt

11/3/2008 10:48:00 AM

0

On Mon, 03 Nov 2008 10:41:25 +0100, Stefano Crocco
<stefano.crocco@alice.it> wrote:

> Does anyone know whether there's a rake task to build latex files,
> including taking care of whether latex should be run one or more times?
> I searched google, this mailing list, rubyforge and RAA, but found
> nothing.

As far as I know there is no such rake task. Almost all people using LaTeX
use an environment that takes care of this (AucTeX for example), launch
the programs manually or use Makefiles for it

> If nobody has already written one, I can do it myself, but I wanted to
> be sure before attempting it.

Let me suggest that you do not write such a task from scratch but starting
with a proven Makefile. While the implementation of the tasks is simple,
the dependencies that need to be taken into account are not. Two Makefiles
you may wish to look at:

http://www.acoustics.hut.fi/u/mairas/UltimateLate...
http://code.google.com/p/latex...

And please consider taking a look at AucTeX. In my humble opinion it is
the best available environment to write LaTeX and it is available for
every operating system that has GNU Emacs or XEmacs and a LaTeX
implementation (i.e. on virtually every operating system currently in use).

http://www.gnu.org/softwa...

Even though I use vim most of the time I prefer writing LaTeX with Emacs
and AucTeX.

Josef 'Jupp' Schugt
--
Blog: http://penpen.gooda...
PGP key (id 6CC6574F): http://wwwkeys.d...
Jabber - http://www.j... - contact information on request

Stefano Crocco

11/3/2008 1:04:00 PM

0

Alle Monday 03 November 2008, Josef 'Jupp' Schugt ha scritto:
> On Mon, 03 Nov 2008 10:41:25 +0100, Stefano Crocco
>
> <stefano.crocco@alice.it> wrote:
> > Does anyone know whether there's a rake task to build latex files,
> > including taking care of whether latex should be run one or more times?
> > I searched google, this mailing list, rubyforge and RAA, but found
> > nothing.
>
> As far as I know there is no such rake task. Almost all people using LaTeX
> use an environment that takes care of this (AucTeX for example), launch
> the programs manually or use Makefiles for it
>
> > If nobody has already written one, I can do it myself, but I wanted to
> > be sure before attempting it.
>
> Let me suggest that you do not write such a task from scratch but starting
> with a proven Makefile. While the implementation of the tasks is simple,
> the dependencies that need to be taken into account are not. Two Makefiles
> you may wish to look at:
>
> http://www.acoustics.hut.fi/u/mairas/UltimateLate...
> http://code.google.com/p/latex...
>
> And please consider taking a look at AucTeX. In my humble opinion it is
> the best available environment to write LaTeX and it is available for
> every operating system that has GNU Emacs or XEmacs and a LaTeX
> implementation (i.e. on virtually every operating system currently in use).
>
> http://www.gnu.org/softwa...
>
> Even though I use vim most of the time I prefer writing LaTeX with Emacs
> and AucTeX.
>
> Josef 'Jupp' Schugt

Thanks for the answer and for the pointers to the two makefiles. I looked at
them and I must admit that they look much more complex than I'd have expected.

I know about AucTeX and other tools like it (I've used them in the past), but
for what I'm doing now, they're useless. I got the idea of writing the
documentation for the ruby program I'm developing using literate programming
and rubyweb (http://www.eng.dmu.ac.uk/~hgs/ru...) and to use latex to
format the output of rubyweb. This has two consequences:
1) AucTeX and similar tools expect to have to deal with latex-only files and
would be utterly confused by a mix of ruby and latex. I could indeed use them
on the files produced by rubyweb, which are pure latex, but that couldn't be
easily automated
2) Not only I, but also the users of my program should be able to build the
documentation, without the need of installing extra tools.

Thanks again

Stefano

Ron Fox

11/3/2008 1:18:00 PM

0

Stefano Crocco wrote:
> Does anyone know whether there's a rake task to build latex files, including
> taking care of whether latex should be run one or more times? I searched
> google, this mailing list, rubyforge and RAA, but found nothing. If nobody has
> already written one, I can do it myself, but I wanted to be sure before
> attempting it.
>
> Thanks in andvance
>
> Stefano
>
Can't be that hard run latex about 3 times, once for the intial run.
Once for references to get done right, once for any index to be
created. Then run the dvi converter you want for the output format
you want.

RF.

--
Ron Fox
NSCL
Michigan State University
East Lansing, MI 48824-1321

Josef 'Jupp' Schugt

11/3/2008 5:22:00 PM

0

On Mon, 03 Nov 2008 14:18:39 +0100, Ron Fox <fox@nscl.msu.edu> wrote:

> Can't be that hard run latex about 3 times, once for the intial run.
> Once for references to get done right, once for any index to be created.
> Then run the dvi converter you want for the output format you want.

Even though it is possible, as far as the portable document format is
concerned you do not want to first create DVIs and convert them to PDFs.
That results in documents inferior to direct PDF generation. And depending
on the document LaTeX runs take quite some time so it perhaps is no great
idea to run LaTeX three times just to be safe. Only doing what is actually
is necessary is the central concept of Makefiles and Co.

Josef 'Jupp' Schugt
--
Blog: http://penpen.gooda...
PGP key (id 6CC6574F): http://wwwkeys.d...
Jabber - http://www.j... - contact information on request

Chris Lowis

11/3/2008 10:16:00 PM

0

> Can't be that hard run latex about 3 times, once for the intial run.
> Once for references to get done right, once for any index to be
> created. Then run the dvi converter you want for the output format
> you want.


I remember looking at the source for Auctex when I decided to write a
rake file to automate LaTeX compilation for my thesis. I seem to
remember it parses the log output of LaTeX looking for "undefined
reference" type warnings and uses that as the trigger to either run
Bibtex or Latex again to resolve cross-references.

I never bothered writing this step in my rake tasks as the compilation
step was always quick enough, but it shouldn't be too hard to use that
approach.


Chris
--
Posted via http://www.ruby-....

Ron Fox

11/4/2008 12:51:00 PM

0

Then you'd better get into parsing latex log files... as there's no
way to know a-priori how many times you're going to need to run latex
based on file modification dates. Sorry.. that's LaTeX. The only hint
you have is messages about undefined references.

The initial poster did not specify pdf output. Naturally if that's
what he wants pdflatex is the beast to run.

RF.

Josef 'Jupp' Schugt wrote:
> On Mon, 03 Nov 2008 14:18:39 +0100, Ron Fox <fox@nscl.msu.edu> wrote:
>
>> Can't be that hard run latex about 3 times, once for the intial run.
>> Once for references to get done right, once for any index to be created.
>> Then run the dvi converter you want for the output format you want.
>
> Even though it is possible, as far as the portable document format is
> concerned you do not want to first create DVIs and convert them to PDFs.
> That results in documents inferior to direct PDF generation. And depending
> on the document LaTeX runs take quite some time so it perhaps is no great
> idea to run LaTeX three times just to be safe. Only doing what is actually
> is necessary is the central concept of Makefiles and Co.
>
> Josef 'Jupp' Schugt


--
Ron Fox
NSCL
Michigan State University
East Lansing, MI 48824-1321

Saji N. Hameed

11/4/2008 1:03:00 PM

0

FYI, it may be relevant to check out ConText (wiki.contextgarden.net),
another TeX macro package, where ruby is heavily used
(and of late lua) to assist better interaction with user.

* Ron Fox <fox@nscl.msu.edu> [2008-11-04 21:53:34 +0900]:

> Then you'd better get into parsing latex log files... as there's no way
> to know a-priori how many times you're going to need to run latex based
> on file modification dates. Sorry.. that's LaTeX. The only hint you have
> is messages about undefined references.
>
> The initial poster did not specify pdf output. Naturally if that's what
> he wants pdflatex is the beast to run.
>
> RF.
>
> Josef 'Jupp' Schugt wrote:
>> On Mon, 03 Nov 2008 14:18:39 +0100, Ron Fox <fox@nscl.msu.edu> wrote:
>>
>>> Can't be that hard run latex about 3 times, once for the intial run.
>>> Once for references to get done right, once for any index to be
>>> created. Then run the dvi converter you want for the output format
>>> you want.
>>
>> Even though it is possible, as far as the portable document format is
>> concerned you do not want to first create DVIs and convert them to
>> PDFs. That results in documents inferior to direct PDF generation. And
>> depending on the document LaTeX runs take quite some time so it
>> perhaps is no great idea to run LaTeX three times just to be safe.
>> Only doing what is actually is necessary is the central concept of
>> Makefiles and Co.
>>
>> Josef 'Jupp' Schugt
>
>
> --
> Ron Fox
> NSCL
> Michigan State University
> East Lansing, MI 48824-1321
>
>

--
Saji N. Hameed

APEC Climate Center +82 51 668 7470
National Pension Corporation Busan Building 12F
Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 saji@apcc21.net
KOREA