auctex
[Top][All Lists]
Advanced

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

[AUCTeX] Is it possible to use the buffer-file-name in a local variable


From: Denis Bitouzé
Subject: [AUCTeX] Is it possible to use the buffer-file-name in a local variable ?
Date: Mon, 02 Feb 2015 17:03:39 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Hi,

I'd like to use the buffer-file-name in a local variable, like this:

  ┌────
  │ %%% Local Variables:
  │ %%% mode: latex
  │ %%% TeX-master: "main"
  │ %%% LaTeX-command: "pdflatex '\includeonly{<buffer-file-name>}\input{main}'"
  │ %%% End:                                   ^^^^^^^^^^^^^^^^^^
  └────

Is it possible?

Here is the background, if it could be helpful: I have a `main.tex` main
file that `\include`s some subfiles, say `ChapOne.tex` and
`ChapTwo.tex`:

--8<---------------cut here---------------start------------->8---
\begin{filecontents*}{ChapOne.tex}
\chapter{One}
\lipsum[1]
\end{filecontents*}
%
\begin{filecontents*}{ChapTwo.tex}
\chapter{Two}
\lipsum[8-21]
\end{filecontents*}
%
% main.tex file
\documentclass{report}
\usepackage{lipsum}
\begin{document}
\include{ChapOne}
\include{ChapTwo}
\end{document}
--8<---------------cut here---------------end--------------->8---

I'm able to include only `ChapTwo.tex` subfile when compiling the
`main.tex` main file but by running:

  ┌────
  │ pdflatex '\includeonly{ChapTwo}\input{main}'
  └────

And I'm able to perform this from `ChapTwo.tex` buffer with the
following local variables:

  ┌────
  │ %%% Local Variables:
  │ %%% mode: latex
  │ %%% TeX-master: "main"
  │ %%% LaTeX-command: "pdflatex '\includeonly{ChapTwo}\input{main}'"
  │ %%% End:
  └────

But, instead of an hard coded `ChapTwo`, I'd like to use
a buffer-file-name that lets me use the same string in each subfile for
the `LaTeX-command` local variable.

Any clue?

Thanks in anticipation.
-- 
Denis



reply via email to

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