bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tex-region ignores value of tex-main-file


From: Joe Wells
Subject: tex-region ignores value of tex-main-file
Date: Sun, 09 Sep 2007 06:07:33 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

The code of tex-region ignores the value of tex-main-file.

To reproduce the problem, first create the following files with these
contents:

----begin: test-driver.tex----
\documentclass{article}
\begin{document}
\input{test-section1}
\input{test-section2}
\end{document}
----end: test-driver.tex----

----begin: test-section1.tex----
\section{First Topic}
This is the first section.
% Local variables:
% tex-main-file: "test-driver"
% end:
----end: test-section1.tex----

----begin: test-section2.tex----
\section{Second Topic}
This is the second section.
% Local variables:
% tex-main-file: "test-driver"
% end:
----end: test-section2.tex----

Then, kill all buffers.  Then, visit test-section1.tex.  Then, mark a
brace-balanced region in test-section1.tex; for example mark the
sentence in this file.  Then, type “C-c C-r” to invoke tex-region.

The correct behavior would be to run LaTeX on a temporary file that
takes the header from test-driver.tex and the body from the current
buffer.  The actual (undesired) behavior is that no header is supplied
(because none is found in the current buffer) and you see an error
message like this from LaTeX:

  ./_TZ_30945-localhost-localdomain.tex:1: LaTeX Error: Missing 
\begin{document}.

The fix is to wrap the portion of tex-region that inserts the header
in the temporary file in something like this:

  (with-current-buffer (find-file-noselect tex-main-file) ...)

I hope this report is helpful.

Joe

======================================================================
In GNU Emacs 22.1.1 (i686-pc-linux-gnu, GTK+ Version 2.8.20)
 of 2007-06-27 on artemis
Windowing system distributor `The X.Org Foundation', version 11.0.70000000
configured using `configure  '--prefix=/home/jbw/local2' '--enable-debug' 
'--disable-nls' '--with-x-toolkit=gtk' 'CFLAGS=-O0 -g3 -ggdb''




reply via email to

[Prev in Thread] Current Thread [Next in Thread]