[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] Is it possible to use the buffer-file-name in a local varia
From: |
Mosè Giordano |
Subject: |
Re: [AUCTeX] Is it possible to use the buffer-file-name in a local variable ? |
Date: |
Tue, 3 Feb 2015 13:43:24 +0100 |
Hi Tassilo,
2015-02-03 8:54 GMT+01:00 Tassilo Horn <address@hidden>:
> Denis Bitouzé <address@hidden> writes:
>
>> 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?
>
> Yes, I think so. You would use a local variable section with something
> like
>
> %%% eval: (setq-local LaTeX-command
> %%% (concat "pdflatex '\includeonly{"
> %%% (buffer-file-name)
> %%% "}\input{main}'")
>
> But I don't think `LaTeX-command' is the right variable. Wouldn't it
> suffice to add the \includeonly to `TeX-command-extra-options'?
I'm not sure this would work, but your suggestion to compile just the
selected section/region can be indeed useful.
Bye,
Mosè
> And as yet another alternative: As I understand, your goal is to speed
> up compilation by only compiling the chapter you're currently writing
> on. In that case, there are already predefined commands to do exactly
> that. See especially
>
> ,----[ (info "(auctex)Starting a Command") ]
> | -- Command: LaTeX-command-section
> | ('C-c C-z') Query the user for a command, and apply it to the
> | current section (or part, chapter, subsection, paragraph, or
> | subparagraph). What makes the current section is determined by
> | 'LaTeX-command-section-level' which can be enlarged/shrunken using
> | 'LaTeX-command-section-change-level' ('C-c M-z'). The given
> | numeric prefix arg is added to the current value of
> | 'LaTeX-command-section-level'. By default,
> | 'LaTeX-command-section-level' is initialized with the current
> | document's 'LaTeX-largest-level'. The buffer contents are written
> | into the region file, after extracting the header and trailer from
> | the master file. The command is then actually run on the region
> | file. See 'TeX-command-region' for details.
> `----
>
> And that doesn't even require that you split your document into one file
> per chapter.
>
> Bye,
> Tassilo
>
>
> _______________________________________________
> auctex mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/auctex