Jaap Eldering | 4 Aug 11:00 2010
Picon

Automatically run LaTeX/BibTeX as required

Hi,

I'm new to this list, so I don't know whether this has been asked
before.

Given that AucTeX already reports that you might want to run BibTeX or
LaTeX again to fix references/citations/etc, would it be possible to
create a separate command that tries to do all this automatically?

I'm currently working on a document where references to equations have
a tendency to switch pages, causing me to often have to rerun LaTeX.
Unfortunately my elisp knowledge is far too small to implement this
myself.

Best,
Jaap Eldering
Andreas Kiermeier | 4 Aug 12:29 2010
Picon

Re: Automatically run LaTeX/BibTeX as required

On 4 August 2010 18:30, Jaap Eldering <eldering <at> a-eskwadraat.nl> wrote:
Given that AucTeX already reports that you might want to run BibTeX or
LaTeX again to fix references/citations/etc, would it be possible to
create a separate command that tries to do all this automatically?

Hi Jaap,

I think you're looking for "texify" which will do the required runs of LaTeX and BibTeX to get references and cross-references right.

I've included the following in my .emacs file, which makes the texify command available. You can then press C-c C-c in your latex file and select either Texify (to get a dvi file) or TexifyPDF (to get a pdf file).

Hope this helps.

Cheers,

Andreas

(add-hook 'LaTeX-mode-hook
      (lambda ()
        (add-to-list 'TeX-command-list
             '("Texify" "texify -b %t" TeX-run-command t (latex-mode) :help "Texify document to dvi (resolves all cross-references, etc.)") t)
        (add-to-list 'TeX-command-list
             '("TexifyPDF" "texify -b -p %t" TeX-run-command t (latex-mode) :help "Texify document to pdf (resolves all cross-references, etc.)") t)
        ))



_______________________________________________
auctex mailing list
auctex <at> gnu.org
http://lists.gnu.org/mailman/listinfo/auctex
Jaap Eldering | 4 Aug 12:47 2010
Picon

Re: Automatically run LaTeX/BibTeX as required

On Wed, Aug 04, 2010 at 07:59:23PM +0930, Andreas Kiermeier wrote:
> On 4 August 2010 18:30, Jaap Eldering <eldering <at> a-eskwadraat.nl> wrote:
> 
> > Given that AucTeX already reports that you might want to run BibTeX or
> > LaTeX again to fix references/citations/etc, would it be possible to
> > create a separate command that tries to do all this automatically?
> 
> Hi Jaap,
> 
> I think you're looking for "texify" which will do the required runs of LaTeX
> and BibTeX to get references and cross-references right.
> 
> I've included the following in my .emacs file, which makes the texify
> command available. You can then press C-c C-c in your latex file and select
> either Texify (to get a dvi file) or TexifyPDF (to get a pdf file).
> 
> Hope this helps.
> 
> Cheers,
> Andreas

Hmm... I'm not quite sure I follow you: 'texify' should be a
commandline tool, right? I do not have that available (should it ship
with AucTeX?) nor can I find such a program by a quick search on the
internet. (Only a perl script 'texify' that transforms programming
code into formatted TeX, but that's not it, I guess.)

Adding the code below to my .emacs allows me to run these commands via
C-c C-c, but doesn't do anything (it also doesn't give an error that
'texify' is not available).

Best,
Jaap

> (add-hook 'LaTeX-mode-hook
>       (lambda ()
>         (add-to-list 'TeX-command-list
>              '("Texify" "texify -b %t" TeX-run-command t (latex-mode) :help
> "Texify document to dvi (resolves all cross-references, etc.)") t)
>         (add-to-list 'TeX-command-list
>              '("TexifyPDF" "texify -b -p %t" TeX-run-command t (latex-mode)
> :help "Texify document to pdf (resolves all cross-references, etc.)") t)
>         ))
Dirk Van Hertem | 4 Aug 12:59 2010
Picon

Re: Automatically run LaTeX/BibTeX as required

On 08/04/2010 12:47 PM, Jaap Eldering wrote:
> On Wed, Aug 04, 2010 at 07:59:23PM +0930, Andreas Kiermeier wrote:
>    
>> On 4 August 2010 18:30, Jaap Eldering<eldering <at> a-eskwadraat.nl>  wrote:
>>
>>      
>>> Given that AucTeX already reports that you might want to run BibTeX or
>>> LaTeX again to fix references/citations/etc, would it be possible to
>>> create a separate command that tries to do all this automatically?
>>>        
>> Hi Jaap,
>>
>> I think you're looking for "texify" which will do the required runs of LaTeX
>> and BibTeX to get references and cross-references right.
>>
>> I've included the following in my .emacs file, which makes the texify
>> command available. You can then press C-c C-c in your latex file and select
>> either Texify (to get a dvi file) or TexifyPDF (to get a pdf file).
>>
>> Hope this helps.
>>
>> Cheers,
>> Andreas
>>      
> Hmm... I'm not quite sure I follow you: 'texify' should be a
> commandline tool, right? I do not have that available (should it ship
> with AucTeX?) nor can I find such a program by a quick search on the
> internet. (Only a perl script 'texify' that transforms programming
> code into formatted TeX, but that's not it, I guess.)
>
> Adding the code below to my .emacs allows me to run these commands via
> C-c C-c, but doesn't do anything (it also doesn't give an error that
> 'texify' is not available).
>
> Best,
> Jaap
>    
Hello,

The program that can be used is rubber (

$ apt-cache show rubber
Description: an automated system for building LaTeX documents
  This is a building system for LaTeX documents. It is based on a 
routine that
  runs just as many compilations as necessary. The module system provides a
  great flexibility that virtually allows support for any package with 
no user
  intervention, as well as pre- and post-processing of the document. The
  standard modules currently provide support for bibtex, dvips, dvipdfm,
  pdftex, makeindex. A good number of standard packages are supported,
  including graphics/graphicx with automatic conversion between various
  graphics formats and Metapost compilation.
Homepage: http://www.pps.jussieu.fr/~beffara/soft/rubber/

I have been able to add it to my emacs config a few years ago, but I 
don't have it anymore. Should not be too difficult though.

>> (add-hook 'LaTeX-mode-hook
>>        (lambda ()
>>          (add-to-list 'TeX-command-list
>>               '("Texify" "texify -b %t" TeX-run-command t (latex-mode) :help
>> "Texify document to dvi (resolves all cross-references, etc.)") t)
>>          (add-to-list 'TeX-command-list
>>               '("TexifyPDF" "texify -b -p %t" TeX-run-command t (latex-mode)
>> :help "Texify document to pdf (resolves all cross-references, etc.)") t)
>>          ))
>>      
>    
Replacing textify with rubber should do the trick?

Best regards,

Dirk
> _______________________________________________
> auctex mailing list
> auctex <at> gnu.org
> http://lists.gnu.org/mailman/listinfo/auctex
>    

--

-- 
Dirk Van Hertem
Royal Institute of Technology, Stockholm
(and K.U. Leuven, ESAT-ELECTA)
tel (GSM): +32-498-61.74.98
Jaap Eldering | 4 Aug 13:46 2010
Picon

Re: Automatically run LaTeX/BibTeX as required

On Wed, Aug 04, 2010 at 12:59:55PM +0200, Dirk Van Hertem wrote:
> On 08/04/2010 12:47 PM, Jaap Eldering wrote:
>> On Wed, Aug 04, 2010 at 07:59:23PM +0930, Andreas Kiermeier wrote:
>>> On 4 August 2010 18:30, Jaap Eldering<eldering <at> a-eskwadraat.nl>  wrote:
>>>      
>>>> Given that AucTeX already reports that you might want to run BibTeX or
>>>> LaTeX again to fix references/citations/etc, would it be possible to
>>>> create a separate command that tries to do all this automatically?
>>>
>>> I think you're looking for "texify" which will do the required runs of LaTeX
>>> and BibTeX to get references and cross-references right.
>>>
>>> I've included the following in my .emacs file, which makes the texify
>>> command available. You can then press C-c C-c in your latex file and select
>>> either Texify (to get a dvi file) or TexifyPDF (to get a pdf file).
>>>      
>> Hmm... I'm not quite sure I follow you: 'texify' should be a
>> commandline tool, right? I do not have that available (should it ship
>> with AucTeX?) nor can I find such a program by a quick search on the
>> internet. (Only a perl script 'texify' that transforms programming
>> code into formatted TeX, but that's not it, I guess.)
>>
>> Adding the code below to my .emacs allows me to run these commands via
>> C-c C-c, but doesn't do anything (it also doesn't give an error that
>> 'texify' is not available).
>
> The program that can be used is rubber (
>
> $ apt-cache show rubber
> Description: an automated system for building LaTeX documents
>  This is a building system for LaTeX documents. It is based on a routine 
> that
>  runs just as many compilations as necessary. The module system provides a
>  great flexibility that virtually allows support for any package with no 
> user
>  intervention, as well as pre- and post-processing of the document. The
>  standard modules currently provide support for bibtex, dvips, dvipdfm,
>  pdftex, makeindex. A good number of standard packages are supported,
>  including graphics/graphicx with automatic conversion between various
>  graphics formats and Metapost compilation.
> Homepage: http://www.pps.jussieu.fr/~beffara/soft/rubber/
>
> I have been able to add it to my emacs config a few years ago, but I  
> don't have it anymore. Should not be too difficult though.
>
>>> (add-hook 'LaTeX-mode-hook
>>>        (lambda ()
>>>          (add-to-list 'TeX-command-list
>>>               '("Texify" "texify -b %t" TeX-run-command t (latex-mode) :help
>>> "Texify document to dvi (resolves all cross-references, etc.)") t)
>>>          (add-to-list 'TeX-command-list
>>>               '("TexifyPDF" "texify -b -p %t" TeX-run-command t (latex-mode)
>>> :help "Texify document to pdf (resolves all cross-references, etc.)") t)
>>>          ))
>>>      
>>    
> Replacing textify with rubber should do the trick?

Thanks, installed rubber and it works.

I'll still have a look at the TeX-command-list and related options: it
would be nice if this command could be set to replace the default
LaTeX option, automatically select dvi/pdf output depending on AUCTeX
setting and that AUCTeX correctly parses TeX errors if found.

I've looked for automatic latex commands in the past, but do not
recall finding rubber at that time, only a few scripts/Makefile
snippets.

Jaap
Andreas Kiermeier | 4 Aug 13:01 2010
Picon

Re: Automatically run LaTeX/BibTeX as required

On 4 August 2010 20:17, Jaap Eldering <eldering <at> a-eskwadraat.nl> wrote:
On Wed, Aug 04, 2010 at 07:59:23PM +0930, Andreas Kiermeier wrote:
> On 4 August 2010 18:30, Jaap Eldering <eldering <at> a-eskwadraat.nl> wrote:
>
> > Given that AucTeX already reports that you might want to run BibTeX or
> > LaTeX again to fix references/citations/etc, would it be possible to
> > create a separate command that tries to do all this automatically?
>
> Hi Jaap,
>
> I think you're looking for "texify" which will do the required runs of LaTeX
> and BibTeX to get references and cross-references right.
>
> I've included the following in my .emacs file, which makes the texify
> command available. You can then press C-c C-c in your latex file and select
> either Texify (to get a dvi file) or TexifyPDF (to get a pdf file).
>
> Hope this helps.
>
> Cheers,
> Andreas

Hmm... I'm not quite sure I follow you: 'texify' should be a
commandline tool, right? I do not have that available (should it ship
with AucTeX?) nor can I find such a program by a quick search on the
internet. (Only a perl script 'texify' that transforms programming
code into formatted TeX, but that's not it, I guess.)

Adding the code below to my .emacs allows me to run these commands via
C-c C-c, but doesn't do anything (it also doesn't give an error that
'texify' is not available).

Best,
Jaap


> (add-hook 'LaTeX-mode-hook
>       (lambda ()
>         (add-to-list 'TeX-command-list
>              '("Texify" "texify -b %t" TeX-run-command t (latex-mode) :help
> "Texify document to dvi (resolves all cross-references, etc.)") t)
>         (add-to-list 'TeX-command-list
>              '("TexifyPDF" "texify -b -p %t" TeX-run-command t (latex-mode)
> :help "Texify document to pdf (resolves all cross-references, etc.)") t)
>         ))

No, texify doesn't ship with Auctex, but it does with MikTex (which is what I'm running). I actually thought that it might be more generic, but could be wrong. Apologies for making the assumption that you're running MikTeX on a windows machine.

I'd be surprised if other distributions didn't have something similar though (and I just saw that Dirk suggested "rubber").

Cheers,

Andreas
_______________________________________________
auctex mailing list
auctex <at> gnu.org
http://lists.gnu.org/mailman/listinfo/auctex
Ralf Angeli | 4 Aug 18:44 2010
Picon

Re: Automatically run LaTeX/BibTeX as required

* Andreas Kiermeier (2010-08-04) writes:

> I think you're looking for "texify" which will do the required runs of LaTeX
> and BibTeX to get references and cross-references right.
>
> I've included the following in my .emacs file, which makes the texify
> command available. You can then press C-c C-c in your latex file and select
> either Texify (to get a dvi file) or TexifyPDF (to get a pdf file).

> (add-hook 'LaTeX-mode-hook
>       (lambda ()
>         (add-to-list 'TeX-command-list
>              '("Texify" "texify -b %t" TeX-run-command t (latex-mode) :help
                                         ^^^^^^^^^^^^^^^

This means AUCTeX will not look for and report any LaTeX errors.  I
haven't checked if `TeX-run-TeX' would work.  Probably not.

--

-- 
Ralf
Jaap Eldering | 5 Aug 16:32 2010
Picon

Re: Automatically run LaTeX/BibTeX as required

On Wed, Aug 04, 2010 at 06:44:46PM +0200, Ralf Angeli wrote:
> * Andreas Kiermeier (2010-08-04) writes:
> 
> > I think you're looking for "texify" which will do the required runs of LaTeX
> > and BibTeX to get references and cross-references right.
> >
> > I've included the following in my .emacs file, which makes the texify
> > command available. You can then press C-c C-c in your latex file and select
> > either Texify (to get a dvi file) or TexifyPDF (to get a pdf file).
> 
> > (add-hook 'LaTeX-mode-hook
> >       (lambda ()
> >         (add-to-list 'TeX-command-list
> >              '("Texify" "texify -b %t" TeX-run-command t (latex-mode) :help
>                                          ^^^^^^^^^^^^^^^
> 
> This means AUCTeX will not look for and report any LaTeX errors.  I
> haven't checked if `TeX-run-TeX' would work.  Probably not.

I had already replaced it with TeX-run-TeX. It does work in the sense
that the command is run and an output file produced, but rubber
produces very terse error lines that AUCTeX (understandably) doesn't
seem to parse correctly. Running rubber as emacs compile command seems
to work better.

Also, rubber doesn't (easily?) allow including source specials,
breaking forward and reverse search...

So I'm still wondering whether it's possible to have this automatic
run-everything command available in AUCTeX: it would be really
convenient to have all the features of AUCTeX, but remove the need to
sometimes repeatedly press "C-c C-c [enter]".

Best,
Jaap
Ralf Angeli | 5 Aug 18:58 2010
Picon

Re: Automatically run LaTeX/BibTeX as required

* Jaap Eldering (2010-08-05) writes:

> So I'm still wondering whether it's possible to have this automatic
> run-everything command available in AUCTeX: it would be really
> convenient to have all the features of AUCTeX, but remove the need to
> sometimes repeatedly press "C-c C-c [enter]".

Yup.  This has been on my todo list for too long already. )c:

--

-- 
Ralf
Ista Zahn | 6 Aug 19:13 2010
Picon

Re: Automatically run LaTeX/BibTeX as required

Over the years I have tried to accomplish this using rubber, latexmk
and texi2dvi. texi2dvi is the winner in my book. It is (subjectively)
both reliable and fast. I believe it ships with TeXlive, not sure
about MikTeX or other distributions.

-Ista

On Thu, Aug 5, 2010 at 4:58 PM, Ralf Angeli <angeli <at> caeruleus.net> wrote:
> * Jaap Eldering (2010-08-05) writes:
>
>> So I'm still wondering whether it's possible to have this automatic
>> run-everything command available in AUCTeX: it would be really
>> convenient to have all the features of AUCTeX, but remove the need to
>> sometimes repeatedly press "C-c C-c [enter]".
>
> Yup.  This has been on my todo list for too long already. )c:
>
> --
> Ralf
>
> _______________________________________________
> auctex mailing list
> auctex <at> gnu.org
> http://lists.gnu.org/mailman/listinfo/auctex
>

--

-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org
TN | 14 Feb 12:15 2011
Picon

Re: Automatically run LaTeX/BibTeX as required

You could try:

http://www.emacswiki.org/emacs/TN#toc8

Best regards,
TN
Jaap Eldering | 14 Feb 14:56 2011
Picon

Re: Re: Automatically run LaTeX/BibTeX as required

On Mon, Feb 14, 2011 at 11:15:56AM +0000, TN wrote:
> You could try:
> 
> http://www.emacswiki.org/emacs/TN#toc8
> 
> Best regards,
> TN

Thanks, that indeed looks like the thing I'd want. I'm going to give
it a try! Is there a way to inhibit the final view command?

Best,
Jaap
TN | 14 Feb 18:13 2011
Picon

Re: Automatically run LaTeX/BibTeX as required

Jaap Eldering <eldering <at> a-eskwadraat.nl> writes:

> Thanks, that indeed looks like the thing I'd want. I'm going to give
> it a try! Is there a way to inhibit the final view command?

Done.
Re-install and set the customization option TeX-texify-Show to `nil'.

Best regards,
TN
PS.: Thanks for testing.
TN | 17 Feb 13:30 2011
Picon

Re: Automatically run LaTeX/BibTeX as required

Hello Jaap,
You wrote:
> Thanks, that indeed looks like the thing I'd want. I'm going to give
> it a try! Is there a way to inhibit the final view command?

I fixed this. Does tex-texify now fully meet your requirements or did you have
something else in your mind with "inhibit the final view command"?

Best regards,
TN
Jaap Eldering | 17 Feb 13:58 2011
Picon

Re: Re: Automatically run LaTeX/BibTeX as required

On Thu, Feb 17, 2011 at 12:30:10PM +0000, TN wrote:
> Hello Jaap,
> You wrote:
> > Thanks, that indeed looks like the thing I'd want. I'm going to give
> > it a try! Is there a way to inhibit the final view command?
> 
> I fixed this. Does tex-texify now fully meet your requirements or did you have
> something else in your mind with "inhibit the final view command"?

Yes, thanks, this was exactly what I had in mind. I'm using your fixed
version now (with TeX-texify-Show = nil) and it's working fine.

Just one minor remark: if the output file is uptodate, C-c C-a does
nothing (as expected), but that may be confused for that it is not
working, so maybe a message a la "TeX-texfiy: nothing to be done."
would be informative.

I think it would also be nice if this could be integrated into AUCTeX.

Thanks for your work!

Jaap
TN | 17 Feb 16:08 2011
Picon

Re: Automatically run LaTeX/BibTeX as required

Jaap Eldering <eldering <at> a-eskwadraat.nl> writes:

> Just one minor remark: if the output file is uptodate, C-c C-a does
> nothing (as expected), but that may be confused for that it is not
> working, so maybe a message a la "TeX-texfiy: nothing to be done."
> would be informative.

I've included the message.

> I think it would also be nice if this could be integrated into AUCTeX.

I don't know wether I can do something about that. First let's see if there are
more demands for that.

Thanks for your comments.

Best regards,
TN
Andreas Kiermeier | 17 Feb 23:36 2011
Picon

Re: Re: Automatically run LaTeX/BibTeX as required

Hi Jaap & TN,

I do this slightly differently using the texify command that comes with my LaTeX installation (MikTeX 2.8), though I think it achieves the same result.

All I've done is define the following in my .emacs file (they can be called with C-c C-c).

(add-hook 'LaTeX-mode-hook
      (lambda ()
        (add-to-list 'TeX-command-list
             '("Texify" "texify -b %t" TeX-run-command t (latex-mode) :help "Texify document to dvi (resolves all cross-references, etc.)") t)
        (add-to-list 'TeX-command-list
             '("TexifyPDF" "texify -b -p %t" TeX-run-command t (latex-mode) :help "Texify document to pdf (resolves all cross-references, etc.)") t)
        ))

These only process the files (without viewing them).

Cheers,

Andreas



On 18 February 2011 01:38, TN <i <at> tn-home.de> wrote:
Jaap Eldering <eldering <at> a-eskwadraat.nl> writes:

> Just one minor remark: if the output file is uptodate, C-c C-a does
> nothing (as expected), but that may be confused for that it is not
> working, so maybe a message a la "TeX-texfiy: nothing to be done."
> would be informative.

I've included the message.

> I think it would also be nice if this could be integrated into AUCTeX.

I don't know wether I can do something about that. First let's see if there are
more demands for that.

Thanks for your comments.

Best regards,
TN



_______________________________________________
auctex mailing list
auctex <at> gnu.org
http://lists.gnu.org/mailman/listinfo/auctex

_______________________________________________
auctex mailing list
auctex <at> gnu.org
http://lists.gnu.org/mailman/listinfo/auctex
TN | 23 Feb 22:56 2011
Picon

Re: Automatically run LaTeX/BibTeX as required

Hi Jaap,
I've discovered two minor bugs in TeX-texify.
(1st) infinite iteration for empty documents
(2nd) Unknown variable TeX-region-command (aproximate match) in certain
circumstances.

Should these bugs cause you trouble you can update.

Best TeXing,
TN

Gmane