Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can latexmk do this?

1,626 views
Skip to first unread message

Leo

unread,
May 15, 2010, 3:38:02 PM5/15/10
to
Hello,

I am running latexmk -pvc -silent FILE. (I use -silent because I don't
want any user interaction here.)

When there's error, it only returns

pdflatex: Command for 'pdflatex' gave return code 256

which isn't helpful. Is it possible to make it print the error message
in detail so that I don't need to inspect .log file myself? Thank you.

Leo

Thorsten Bonow

unread,
May 16, 2010, 3:48:12 AM5/16/10
to
>>>>> "Leo" == Leo <sdl...@gmail.com> writes:

Leo> Hello, I am running latexmk -pvc -silent FILE. (I use -silent because
Leo> I don't want any user interaction here.)

Leo> When there's error, it only returns

Leo> pdflatex: Command for 'pdflatex' gave return code 256

Leo> which isn't helpful. Is it possible to make it print the error message
Leo> in detail so that I don't need to inspect .log file myself? Thank you.

Leo> Leo

Hi,

the -silent option is just a wrapper/shortcut for calling latex with an
interaction mode setting, e.g. on UNIX with "latex -interaction=batchmode".
(I'm quoting from the man page)

If you call LaTeX with a different setting, you will get more information.

Here comes my sample output for a LaTeX file which just has an \xemph{42}
instead of \emph{42} in it and LaTeX is called in "scrollmode". In my latexmk
rc-file this would by achieved by this line:

$latex = "latex -interaction scrollmode";

[...]

! Undefined control sequence.
l.13 \xemph
{42}
[1] (./test.aux) )
(see the transcript file for additional information)
Output written on test.dvi (1 page, 2124 bytes).
Transcript written on test.log.
Latexmk: Log file says output to 'test.dvi'
Latexmk: Errors, so I did not complete making targets
Latexmk: Failure to make the files correctly
==> You will need to change a source file before I do another run <==
Collected error summary (may duplicate other messages):
latex: Command for 'latex' gave return code 256

=== Watching for updated files. Use ctrl/C to stop ...


But I wouldn't recommend your or this setup. Why don't you just press "e" to
open up an editor and fix the error? I don't know your environment, but I'm
using emacs and by a call to emacsclient, you could jump right to the offending
line.

I used to use this setup for a long time. But in my experience, since my
mistakes are either typos easy to fix or problems I have to think about, the
question of the interaction mode or having to look at the logfile isn't an
important issue. So I have set my editor to vi when I press "e" for quick fixes
or I just press "x" to stop LaTeX from bugging me and take a step back to look
for a solution.

Hope this helps.

Toto

--
It was flyover country. Flyover country, of course, is what New
Yorkers call any place between New York and Los Angeles.
Kinky Friedman: Frequent Flyer

Leo

unread,
May 16, 2010, 6:12:18 AM5/16/10
to
On 2010-05-16 08:48 +0100, Thorsten Bonow wrote:
[...]

> the -silent option is just a wrapper/shortcut for calling latex with an
> interaction mode setting, e.g. on UNIX with "latex -interaction=batchmode".
> (I'm quoting from the man page)

I can see that from the rule it prints.

I am experimenting with a new setup where the build and editing are
separate. I have a machine that continuously build the document while I
am focusing on the writing.

I think I have gotten pretty close to what I want. But my hack is not
pretty. I basically insert code in line 2357 of latexmk to parse the log
file and send a more informative output. It seems this is not doable in
.latexmkrc.

Leo

Thorsten Bonow

unread,
May 16, 2010, 7:54:18 AM5/16/10
to
>>>>> "Leo" == Leo <sdl...@gmail.com> writes:

Leo> On 2010-05-16 08:48 +0100, Thorsten Bonow wrote: [...]


>> the -silent option is just a wrapper/shortcut for calling latex with an
>> interaction mode setting, e.g. on UNIX with "latex
>> -interaction=batchmode". (I'm quoting from the man page)

Leo> I can see that from the rule it prints.

Leo> I am experimenting with a new setup where the build and editing are
Leo> separate. I have a machine that continuously build the document while
Leo> I am focusing on the writing.

Leo> I think I have gotten pretty close to what I want. But my hack is not
Leo> pretty. I basically insert code in line 2357 of latexmk to parse the
Leo> log file and send a more informative output. It seems this is not
Leo> doable in .latexmkrc.

OK.

For this way of working I'm using whizzytex.

Leo> Leo

Toto

--
"General" does not mean a military grade but "for the whole
university". Jens Hektor in rwth-general

Leo

unread,
May 16, 2010, 10:43:22 AM5/16/10
to
On 2010-05-16 12:54 +0100, Thorsten Bonow wrote:
> For this way of working I'm using whizzytex.


I've looked at this package quite a while ago. I am using pdflatex not
sure if it supports pdf. The reason I am using the remote machine is
because it is much faster.


Leo

Thorsten Bonow

unread,
May 16, 2010, 11:36:03 AM5/16/10
to
>>>>> "Leo" == Leo <sdl...@gmail.com> writes:

Leo> On 2010-05-16 12:54 +0100, Thorsten Bonow wrote:
>> For this way of working I'm using whizzytex.


Leo> I've looked at this package quite a while ago. I am using pdflatex not
Leo> sure if it supports pdf. The reason I am using the remote machine is
Leo> because it is much faster.

Yes, it supports pdflatex---but it does use a lot of CPU. It's kind of sluggish
over here on my double core P4 2.8GHz when in PDF instead of DVI mode.

I see you've put a lot of thinking into this problem. Sorry I wasn't much use.

Leo> Leo

Toto

--
"I'm fairly sure that if they took all the porn off the Internet,
there'd only be 1 website left, and it would be called Bring Back
The Porn." - Dr Cox from Scrubs.

John Collins

unread,
May 17, 2010, 10:31:19 AM5/17/10
to

What to do depends on what fits your work flow. Two suggestions

1. Don't bother with the -silent option to latexmk. But configure latexmk
with

$pdflatex = "pdflatex -halt-on-error %O %S";

Then pdflatex will print its error message, and then halt instead of
waiting for user interaction. You can see the error message very
conveniently near the bottom of the window in which latexmk is running.
You correct the error in the tex file and once the file is saved, latexmk
reruns pdflatex, etc without any user intervention.

This is the solution I prefer at the moment.

It has the disadvantage that latexmk may do extra runs of pdflatex after an
error, when it ought to wait for the user to change files. (This is
innocuous except for the waste of cpu time.) You get the usual verbose
output from all commands even when there is no error.


2. If you want to keep the lack of output that the -silent option gives
when there is no error, then invoke pdflatex indirectly through a script
that you write. It first calls pdflatex, and then if there is an error it
parses the log file to show the error information.

John Collins

Lars Madsen

unread,
May 17, 2010, 10:47:43 AM5/17/10
to
John Collins wrote:
> Leo wrote:
>>
>> I am running latexmk -pvc -silent FILE. (I use -silent because I don't
>> want any user interaction here.)
>>
>> When there's error, it only returns
>>
>> pdflatex: Command for 'pdflatex' gave return code 256
>>
>> which isn't helpful. Is it possible to make it print the error message
>> in detail so that I don't need to inspect .log file myself? Thank you.
>
> What to do depends on what fits your work flow. Two suggestions
>
> 1. Don't bother with the -silent option to latexmk. But configure
> latexmk with
>
> $pdflatex = "pdflatex -halt-on-error %O %S";
>
> Then pdflatex will print its error message, and then halt instead of
> waiting for user interaction. You can see the error message very
> conveniently near the bottom of the window in which latexmk is running.
> You correct the error in the tex file and once the file is saved,
> latexmk reruns pdflatex, etc without any user intervention.
>
> This is the solution I prefer at the moment.

Nice, didn't think of that, this makes my -pvc work much easier


--

/daleif (remove RTFSIGNATURE from email address)

LaTeX FAQ: http://www.tex.ac.uk/faq
LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish)
Remember to post minimal examples, see URL below
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
http://www.minimalbeispiel.de/mini-en.html

Leo

unread,
May 18, 2010, 8:26:17 AM5/18/10
to
On 2010-05-17 15:31 +0100, John Collins wrote:
> What to do depends on what fits your work flow. Two suggestions
>
> 1. Don't bother with the -silent option to latexmk. But configure
> latexmk with
>
> $pdflatex = "pdflatex -halt-on-error %O %S";
>
> Then pdflatex will print its error message, and then halt instead of
> waiting for user interaction. You can see the error message very
> conveniently near the bottom of the window in which latexmk is
> running. You correct the error in the tex file and once the file is
> saved, latexmk reruns pdflatex, etc without any user intervention.

Thanks for this.

I eventually ended up modifying latexmk directly. Now I can edit the TeX
file directly from remote machine and it automatically compiles thanks
to latexmk -pvc. When there's error, my local machine get a notification
like this one: http://imagebin.org/97318 within seconds when the file is
saved.

Leo

0 new messages