Skip to content

texi2dvi problem when compiling incorrect Latex code

5 messages · syrvn, Ista Zahn

#
Hello,

I am working on a big R project using Eclipse/StatET/Texlipse. I'd like to
write a Latex document within that project but DO NOT want to Sweave it.
It's pure Latex. Via the external tools configurations I set up 2 different
versions to ensure that my latex document is processed correctly.

Version 1 (System Call):
library(tools)
setwd("${container_loc}")
file = "${resource_loc:${source_file_path}}"
try(system(paste("texi2pdf", shQuote(file)), intern=TRUE))


Version 2 (R Call):
library(tools)
setwd("${container_loc}")
texi2dvi(file = "${resource_loc:${source_file_path}}", pdf = TRUE, quiet =
FALSE)


Both versions work well as long as there is no error in my latex code. As
soon as there is an error
the process of texi2pdf / texi2dvi is not finished as the programme waits
for user input (mostly just press "enter" key). The problem is that R
outputs the output only after the whole programme finished so I always end
up having to kill my R console.

Is there any workaround for that?

Syrvn



--
View this message in context: http://r.789695.n4.nabble.com/texi2dvi-problem-when-compiling-incorrect-Latex-code-tp3870827p3870827.html
Sent from the R help mailing list archive at Nabble.com.
#
Hi Syrvn,
On Tue, Oct 4, 2011 at 8:43 AM, syrvn <mentor_ at gmx.net> wrote:
This "works" (i.e. the latex errors print to screen but eventually
return me to my R session) on my system (see sessionInfo below),
running R in the terminal.
This also works for me (see definition of "works" above) provided that
I omit the "quiet = FALSE" part.

R version 2.13.2 (2011-09-30)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] tools     stats     graphics  grDevices utils     datasets  methods
[8] base

Best,
Ista

  
    
#
Hi Ista,

thanks for you reply.

If I understod correctly you run your R within Eclipse but as the Lunch Type
you use Rterm rather than RJ.

I changed my configuration so that R is now lunched as Rterm and NOT as RJ
and I also removed the
quite=FALSE from my configuration. Unfortunately, I still have the same
problem.
To create an error in my latex code I just typed the following: \asdasd in
one of my .tex files.
When I compile my document by hand using the Mac OS X / UNIX terminal I get
the following latex compiling output:

Underfull \hbox (badness 10000) in paragraph at lines 4--7

) (../abstract.tex
Underfull \hbox (badness 10000) in paragraph at lines 1--12

../abstract.tex:15: Undefined control sequence.
l.15  \asdasdas
               
?         

It stops at the question mark and waits for user input. If I press enter it
continues and finally stops with an error which is fine.
The only problem is that if I do it in R the console does not print
everything until the question mark and therefore I cannot just
press enter to let latex finish compiling the code. 

I don't know how to get around this.


Best syrvn

--
View this message in context: http://r.789695.n4.nabble.com/texi2dvi-problem-when-compiling-incorrect-Latex-code-tp3870827p3873909.html
Sent from the R help mailing list archive at Nabble.com.
#
I think we need more details about your setup. It works as I described
(prints errors then returns to R prompt) in all configurations I've
tried, including th Linux terminal, Emacs ESS, Eclispse statET console
setup, I couldn't get RJ workign).

What operating system are you using? R version? Eclipse/statET
version? Does it work when you run R directly from a terminal (i.e.,
not through eclipse)?

Best,
Ista
On Wed, Oct 5, 2011 at 5:27 AM, syrvn <mentor_ at gmx.net> wrote:

  
    
#
Hi Ista,

it's weird I don't know why this happens. I tried so many different ways but
now finally
I found a solution. I wrote a little shell script:

pdflatex -halt-on-error body.tex
bibtex body.aux
pdflatex -halt-on-error body.tex
pdflatex -halt-on-error body.tex

which does the job. So my "External Tools Configuration" looks like the
following now:

library(tools)
setwd("${container_loc}")
system("./body.sh", intern=TRUE)

I get the output into R and as soon as there is an error in my latex code it
the compilation/processing stops and the output is still put into the R
console. 
This was possible by adding the -halt-on-error parameter.

Thanks for your support anyway.

Best,
Syrvn

--
View this message in context: http://r.789695.n4.nabble.com/texi2dvi-problem-when-compiling-incorrect-Latex-code-tp3870827p3874594.html
Sent from the R help mailing list archive at Nabble.com.