Discussion:
[AUCTeX] feature request: autogenerate a Makefile?
Sivaram Neelakantan
2016-08-17 04:57:35 UTC
Permalink
Hi,

Would it be possible for an option to generate a Makefile based on the
local variables that are set for included Tex files? Since Auctex
smartly figures out the compilation sequence, would it be make sense
to create a Makefile?

when I share my Latex files, I'd like to share a Makefile instead of
Texing instructions

sivaram
--
Mosè Giordano
2016-08-21 14:11:24 UTC
Permalink
Hi Sivaram,
Post by Sivaram Neelakantan
Hi,
Would it be possible for an option to generate a Makefile based on the
local variables that are set for included Tex files?
TeX files don't work well with Makefiles, because of unavoidable
circular dependencies: after the first compilation, auxiliary files
are generated and then used for subsequent compilations, after which
they're always updated. So the output file depends on the auxiliary
files, which in a sense depend on the output file (they're generated
together).
Post by Sivaram Neelakantan
Since Auctex
smartly figures out the compilation sequence, would it be make sense
to create a Makefile?
AUCTeX doesn't know in advance which commands you need to compile a
document (apart the name of *TeX and bibliography engines), nor how
many times you need to run them: it exploits its ability to parse the
compilation log. I don't know how we could generate a Makefile out of
a source file, without compiling it first. In addition, the actual
commands you need to run really depend on the commands you previously
ran. This is something dynamic, that can't be easily encoded in a
static Makefile.
Post by Sivaram Neelakantan
when I share my Latex files, I'd like to share a Makefile instead of
Texing instructions
Unless I want to specify a static chain of commands, I use tools like
"latexmk" in my Makefiles, that dynamically determine the commands to
run by parsing the compilation log, just like AUCTeX.

Bye,
Mosè
Sivaram Neelakantan
2016-08-23 10:05:46 UTC
Permalink
Post by Mosè Giordano
Hi Sivaram,
Post by Sivaram Neelakantan
Hi,
Would it be possible for an option to generate a Makefile based on the
local variables that are set for included Tex files?
TeX files don't work well with Makefiles, because of unavoidable
circular dependencies: after the first compilation, auxiliary files
are generated and then used for subsequent compilations, after which
they're always updated. So the output file depends on the auxiliary
files, which in a sense depend on the output file (they're generated
together).
Thanks for the clarifications.

[snipped 29 lines]


sivaram
--
Sivaram Neelakantan
2016-09-02 16:47:52 UTC
Permalink
Post by Mosè Giordano
Hi Sivaram,
[snipped 26 lines]
Post by Mosè Giordano
Post by Sivaram Neelakantan
when I share my Latex files, I'd like to share a Makefile instead of
Texing instructions
Unless I want to specify a static chain of commands, I use tools like
"latexmk" in my Makefiles, that dynamically determine the commands to
run by parsing the compilation log, just like AUCTeX.
[snipped 7 lines]

I just saw a package auctex-latexmk on melpa. Anyone know how to use
that?


sivaram
--
Piet van Oostrum
2016-09-06 12:33:05 UTC
Permalink
[snip]
Post by Sivaram Neelakantan
I just saw a package auctex-latexmk on melpa. Anyone know how to use
that?
See the doc
https://github.com/tom-tan/auctex-latexmk/

Basically, put in your .emacs or equivalent:

(require 'auctex-latexmk)
(auctex-latexmk-setup)

And it gives you a LatexMk entry in the Commands menu, and for C-c C-c.
--
Piet van Oostrum <piet-***@pietvanoostrum.com>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
Sivaram Neelakantan
2016-09-07 14:29:24 UTC
Permalink
Post by Mosè Giordano
Hi Sivaram,
as an alternative, don't use "auctex-latexmk" package at all, but just
issue C-c C-a (M-x TeX-command-run-all RET) in place of C-c C-c when
you want to compile. You'll get pretty much the same result, with the
difference that you don't need external packages, the viewer is
automatically opened if the output file is ready, and error parsing by
AUCTeX is correct.
Thanks, that's a new one. Need to try this out and retrain my hands at
invoking this


[snipped 42 lines]


sivaram
--

Loading...