bug#25276: 11.89.8; xetex engine not work when master filename contains space
I test the example "foo bar.tex" on Debian with Emacs 24.4. When run "M-: (shell-quote-argument (TeX-master-file)) RET" on "foo bar.tex",it returns "foo\\ bar"; and run the same command on "foo.tex" it returns "foo". Cheers, Qiang On 2016/12/27 2:28, Qiang Yin wrote: Hi Mosè, Maybe it's better to use the default engine at this moment. Hope someone with a Windows box can reproduce the problem and locate the bug. Thank you for the help anyway :) Best, Qiang On 2016/12/27 2:16, Mosè Giordano wrote: 2016-12-26 18:59 GMT+01:00 Qiang Yin: Hi Mosè, 1. When run on "foo bar.tex" it returns "\"foo bar\"". 2. When run on "foo.tex" it returns "\"foo\"". Thank you. I cannot tell what's the difference and why it works in one case but not in the other. Sorry, I don't think I can personally do much on this, without a Windows box. Bye, Mosè ___ bug-auctex mailing list bug-auctex@gnu.org https://lists.gnu.org/mailman/listinfo/bug-auctex
Re: [AUCTeX] Subfiles package and reftex
2016-12-27 0:41 GMT+01:00: > Hello Mosè, > > This is great! Yes, this is what I needed. Thanks! Good. Then you only need to wait for the next AUCTeX release. Hold on ;-) Bye, Mosè ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
Re: [AUCTeX] Subfiles package and reftex
Hello Mosè, This is great! Yes, this is what I needed. Thanks! On 2016-12-26 16:54, Mosè Giordano wrote: Hi Edgar, 2016-12-26 5:14 GMT+01:00: Hi there, I would like to know if there is a way to (1) set a master file (Master.tex) which includes other files (\input, \subfiles, \include or any other) with relative paths (2) those other files (header.tex, File1.tex, File2.tex...) have labels (as in \label{fig:NicePicture}) (3) set a cross-reference between those labels (File1.tex has \label{fig:NicePicture} somewhere, and File2.tex has \cref{fig:NicePicture}) (4) set a bunch of styles (\usepackage, \newcommand, etc.) in one of the external files (header.tex, for instance) (5) use RefTeX to create those cross-references. Say, something like this: |-Master.tex |-preamble.tex |-File1.tex |-File2.tex But sometimes, I want to see how File2.tex looks like as a PDF before compiling the whole thing. So, I set \usepackage{subfiles} in preamble.tex and load it at the top of Master.tex with \input{preamble.tex}. This loads all my \newcommand, styles and package options when I run pdflatex. However, I am unable to use RefTeX between File1.tex and File2.tex. I have set the %%% TeX-master: "Methods" at the bottom of File1.tex and File2.tex. "Methods"? Did you "Master"? Anyway, a few hours ago was installed in AUCTeX a new patch that should improve your workflow with this package. For example, this is my master file: --8<---cut here---start->8--- \documentclass{article} \usepackage{subfiles,amsmath} \begin{document} hello world! \begin{equation} \label{eq:1} a + b = c \end{equation} \subfile{file1.tex} \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% End: --8<---cut here---end--->8--- and this is my file1.tex file: --8<---cut here---start->8--- \documentclass[master.tex]{subfiles} \begin{document} Equation~\eqref{eq:1} \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% End: --8<---cut here---end--->8--- Inside file1.tex, now I can insert with RefTeX a reference defined in another file (like what I did to insert the reference to "eq:1" label). Is this what you would like? Bye, Mosè - ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands! $24.95 ONETIME Lifetime accounts with Privacy Features! 15GB disk! No bandwidth quotas! Commercial and Bulk Mail Options! ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
bug#25276: 11.89.8; xetex engine not work when master filename contains space
2016-12-26 18:59 GMT+01:00 Qiang Yin: > Hi Mosè, > > 1. When run on "foo bar.tex" it returns "\"foo bar\"". > 2. When run on "foo.tex" it returns "\"foo\"". Thank you. I cannot tell what's the difference and why it works in one case but not in the other. Sorry, I don't think I can personally do much on this, without a Windows box. Bye, Mosè ___ bug-auctex mailing list bug-auctex@gnu.org https://lists.gnu.org/mailman/listinfo/bug-auctex
bug#25276: 11.89.8; xetex engine not work when master filename contains space
Hi Mosè, 1. When run on "foo bar.tex" it returns "\"foo bar\"". 2. When run on "foo.tex" it returns "\"foo\"". Best, Qiang On 2016/12/27 1:27, Mosè Giordano wrote: Qiang or anybody using Windows, can you please tell me what M-: (shell-quote-argument (TeX-master-file)) RET returns in a your "foo bar.tex" buffer? And what in a file's buffer without spaces in its name? This is, more or less, the command used in `TeX-command-expand' to build the compilation command. Thank you, Mosè 2016-12-26 17:25 GMT+01:00 Mosè Giordano: Hi Qiang, 2016-12-26 16:34 GMT+01:00 Qiang Yin : Hi, I prefer xetex as my default tex engine. But this will cause a AucTeX bug when the master filename contains a space. The following is a minimal example. It contains only one master file "foo bar.tex". Notice the filename contains a space. And the content of "foo bar.tex" is just the following: \documentclass{article} \begin{document} Hello world \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% TeX-engine: xetex %%% End: Now if press C-c C-c to compile this file. AucTeX will return the following error message: Running `LaTeX' on `foo bar' with ``xelatex -file-line-error --synctex=1 -interaction=nonstopmode "\input" ^"\^"foo bar.tex\^"^"'' This is XeTeX, Version 3.14159265-2.6-0.6 (TeX Live 2016/W32TeX) (preloaded format=xelatex) restricted \write18 enabled. entering extended mode LaTeX2e <2016/03/31> patch level 3 Babel <3.9r> and hyphenation patterns for 83 language(s) loaded. ! I can't find file `'"foo bar.tex"''. <*> \input '"foo bar.tex"' (Press Enter to retry, or Control-Z to exit) Please type another input file name ! Emergency stop. <*> \input '"foo bar.tex"' I cannot reproduce this on GNU/Linux: --8<---cut here---start->8--- Running `LaTeX' on `foo bar' with ``xelatex -file-line-error --synctex=1 -interaction=nonstopmode "\input" \"foo\ bar.tex\"'' This is XeTeX, Version 3.14159265-2.6-0.6 (TeX Live 2016) (preloaded format=xelatex) restricted \write18 enabled. entering extended mode LaTeX2e <2016/03/31> patch level 3 Babel <3.9r> and hyphenation patterns for 83 language(s) loaded. (./foo bar.tex (/opt/texlive/2016/texmf-dist/tex/latex/base/article.cls Document Class: article 2014/09/29 v1.4h Standard LaTeX document class (/opt/texlive/2016/texmf-dist/tex/latex/base/size10.clo)) No file "foo bar".aux. [1] (./foo bar.aux) ) Output written on foo bar.pdf (1 page). SyncTeX written on foo bar.synctex.gz. Transcript written on foo bar.log. TeX Output finished at Mon Dec 26 17:11:20 --8<---cut here---end--->8--- I see that you're running Emacs on Windows, maybe there is something special to be taken care of on that system. I find it strange that you experience this problem only with one engine: I didn't check it, but I thought that the expansion of file name doesn't depend on the selected engine. I'll try to have a look, but not using Windows, it's difficult for me. If someone else comes up with a solution, please chime in. Bye, Mosè ___ bug-auctex mailing list bug-auctex@gnu.org https://lists.gnu.org/mailman/listinfo/bug-auctex
bug#25276: 11.89.8; xetex engine not work when master filename contains space
Qiang or anybody using Windows, can you please tell me what M-: (shell-quote-argument (TeX-master-file)) RET returns in a your "foo bar.tex" buffer? And what in a file's buffer without spaces in its name? This is, more or less, the command used in `TeX-command-expand' to build the compilation command. Thank you, Mosè 2016-12-26 17:25 GMT+01:00 Mosè Giordano: > Hi Qiang, > > 2016-12-26 16:34 GMT+01:00 Qiang Yin : >> Hi, >> I prefer xetex as my default tex engine. But this will cause a AucTeX >> bug when the master filename contains a space. >> >> The following is a minimal example. It contains only one master file "foo >> bar.tex". Notice the filename contains a space. And the content of "foo >> bar.tex" is just the following: >> >> \documentclass{article} >> \begin{document} >> Hello world >> \end{document} >> %%% Local Variables: >> %%% mode: latex >> %%% TeX-master: t >> %%% TeX-engine: xetex >> %%% End: >> >> Now if press C-c C-c to compile this file. AucTeX will return the >> following error message: >> >> Running `LaTeX' on `foo bar' with ``xelatex -file-line-error --synctex=1 >> -interaction=nonstopmode "\input" ^"\^"foo bar.tex\^"^"'' >> This is XeTeX, Version 3.14159265-2.6-0.6 (TeX Live 2016/W32TeX) >> (preloaded format=xelatex) >> restricted \write18 enabled. >> entering extended mode >> LaTeX2e <2016/03/31> patch level 3 >> Babel <3.9r> and hyphenation patterns for 83 language(s) loaded. >> ! I can't find file `'"foo bar.tex"''. >> <*> \input '"foo bar.tex"' >> >> (Press Enter to retry, or Control-Z to exit) >> Please type another input file name >> ! Emergency stop. >> <*> \input '"foo bar.tex"' > > I cannot reproduce this on GNU/Linux: > > --8<---cut here---start->8--- > Running `LaTeX' on `foo bar' with ``xelatex -file-line-error > --synctex=1 -interaction=nonstopmode "\input" \"foo\ bar.tex\"'' > This is XeTeX, Version 3.14159265-2.6-0.6 (TeX Live 2016) > (preloaded format=xelatex) > restricted \write18 enabled. > entering extended mode > LaTeX2e <2016/03/31> patch level 3 > Babel <3.9r> and hyphenation patterns for 83 language(s) loaded. > (./foo bar.tex (/opt/texlive/2016/texmf-dist/tex/latex/base/article.cls > Document Class: article 2014/09/29 v1.4h Standard LaTeX document class > (/opt/texlive/2016/texmf-dist/tex/latex/base/size10.clo)) > No file "foo bar".aux. > [1] (./foo bar.aux) ) > Output written on foo bar.pdf (1 page). > SyncTeX written on foo bar.synctex.gz. > Transcript written on foo bar.log. > > TeX Output finished at Mon Dec 26 17:11:20 > --8<---cut here---end--->8--- > > I see that you're running Emacs on Windows, maybe there is something > special to be taken care of on that system. I find it strange that > you experience this problem only with one engine: I didn't check it, > but I thought that the expansion of file name doesn't depend on the > selected engine. > > I'll try to have a look, but not using Windows, it's difficult for me. > If someone else comes up with a solution, please chime in. > > Bye, > Mosè ___ bug-auctex mailing list bug-auctex@gnu.org https://lists.gnu.org/mailman/listinfo/bug-auctex
Re: [AUCTeX] Subfiles package and reftex
Hi Edgar, 2016-12-26 5:14 GMT+01:00: > Hi there, > > I would like to know if there is a way to > (1) set a master file (Master.tex) which includes other files (\input, > \subfiles, \include or any other) with relative paths > (2) those other files (header.tex, File1.tex, File2.tex...) have labels (as > in \label{fig:NicePicture}) > (3) set a cross-reference between those labels (File1.tex has > \label{fig:NicePicture} somewhere, and File2.tex has \cref{fig:NicePicture}) > (4) set a bunch of styles (\usepackage, \newcommand, etc.) in one of the > external files (header.tex, for instance) > (5) use RefTeX to create those cross-references. > > Say, something like this: > |-Master.tex > |-preamble.tex > |-File1.tex > |-File2.tex > > But sometimes, I want to see how File2.tex looks like as a PDF before > compiling the whole thing. So, I set \usepackage{subfiles} in preamble.tex > and load it at the top of Master.tex with \input{preamble.tex}. This loads > all my \newcommand, styles and package options when I run pdflatex. However, > I am unable to use RefTeX between File1.tex and File2.tex. I have set the > %%% TeX-master: "Methods" at the bottom of File1.tex and File2.tex. "Methods"? Did you "Master"? Anyway, a few hours ago was installed in AUCTeX a new patch that should improve your workflow with this package. For example, this is my master file: --8<---cut here---start->8--- \documentclass{article} \usepackage{subfiles,amsmath} \begin{document} hello world! \begin{equation} \label{eq:1} a + b = c \end{equation} \subfile{file1.tex} \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% End: --8<---cut here---end--->8--- and this is my file1.tex file: --8<---cut here---start->8--- \documentclass[master.tex]{subfiles} \begin{document} Equation~\eqref{eq:1} \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% End: --8<---cut here---end--->8--- Inside file1.tex, now I can insert with RefTeX a reference defined in another file (like what I did to insert the reference to "eq:1" label). Is this what you would like? Bye, Mosè ___ auctex mailing list auctex@gnu.org https://lists.gnu.org/mailman/listinfo/auctex
bug#25276: 11.89.8; xetex engine not work when master filename contains space
Hi, I prefer xetex as my default tex engine. But this will cause a AucTeX bug when the master filename contains a space. The following is a minimal example. It contains only one master file "foo bar.tex". Notice the filename contains a space. And the content of "foo bar.tex" is just the following: \documentclass{article} \begin{document} Hello world \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% TeX-engine: xetex %%% End: Now if press C-c C-c to compile this file. AucTeX will return the following error message: Running `LaTeX' on `foo bar' with ``xelatex -file-line-error --synctex=1 -interaction=nonstopmode "\input" ^"\^"foo bar.tex\^"^"'' This is XeTeX, Version 3.14159265-2.6-0.6 (TeX Live 2016/W32TeX) (preloaded format=xelatex) restricted \write18 enabled. entering extended mode LaTeX2e <2016/03/31> patch level 3 Babel <3.9r> and hyphenation patterns for 83 language(s) loaded. ! I can't find file `'"foo bar.tex"''. <*> \input '"foo bar.tex"' (Press Enter to retry, or Control-Z to exit) Please type another input file name ! Emergency stop. <*> \input '"foo bar.tex"' If I switch my tex engine to pdflatex, then this problem will gone. Moreover, if run the following command in a terminal xelatex --file-line-error --synctex=1 -interaction=nonstopmode "\input" "foo bar.tex" Then it also works well. So I assume this is a AucTeX bug. Best, Qiang Emacs : GNU Emacs 25.1.1 (x86_64-w64-mingw32) of 2016-09-18 Package: 11.89.8 current state: == (setq AUCTeX-date "2016-12-22" window-system 'w32 LaTeX-version "2e" TeX-style-path '("~/.emacs.d/auctex" "d:/Home/.emacs.d/elpa/auctex-11.89.8/style" "d:/Home/.emacs.d/auctex/auto" "d:/Home/.emacs.d/auctex/style" "auto" "style") TeX-auto-save t TeX-parse-self t TeX-master t TeX-command-list '(("TeX" "%(PDF)%(tex) %(file-line-error) %(extraopts) %`%S%(PDFout)%(mode)%' %t" TeX-run-TeX nil (plain-tex-mode ams-tex-mode texinfo-mode) :help "Run plain TeX") ("LaTeX" "%`%l%(mode)%' %t" TeX-run-TeX nil (latex-mode doctex-mode) :help "Run LaTeX") ("Makeinfo" "makeinfo %(extraopts) %t" TeX-run-compile nil (texinfo-mode) :help "Run Makeinfo with Info output") ("Makeinfo HTML" "makeinfo %(extraopts) --html %t" TeX-run-compile nil (texinfo-mode) :help "Run Makeinfo with HTML output") ("AmSTeX" "amstex %(PDFout) %(extraopts) %`%S%(mode)%' %t" TeX-run-TeX nil (ams-tex-mode) :help "Run AMSTeX") ("ConTeXt" "%(cntxcom) --once --texutil %(extraopts) %(execopts)%t" TeX-run-TeX nil (context-mode) :help "Run ConTeXt once") ("ConTeXt Full" "%(cntxcom) %(extraopts) %(execopts)%t" TeX-run-TeX nil (context-mode) :help "Run ConTeXt until completion") ("BibTeX" "bibtex %s" TeX-run-BibTeX nil t :help "Run BibTeX") ("Biber" "biber %s" TeX-run-Biber nil t :help "Run Biber") ("View" "%V" TeX-run-discard-or-function t t :help "Run Viewer") ("Print" "%p" TeX-run-command t t :help "Print the file") ("Queue" "%q" TeX-run-background nil t :help "View the printer queue" :visible TeX-queue-command) ("File" "%(o?)dvips %d -o %f " TeX-run-dvips t t :help "Generate PostScript file") ("Dvips" "%(o?)dvips %d -o %f " TeX-run-dvips nil t :help "Convert DVI file to PostScript") ("Dvipdfmx" "dvipdfmx %d" TeX-run-dvipdfmx nil t :help "Convert DVI file to PDF with dvipdfmx") ("Ps2pdf" "ps2pdf %f" TeX-run-ps2pdf nil t :help "Convert PostScript file to PDF") ("Index" "makeindex %s" TeX-run-index nil t :help "Run makeindex to create index file") ("Xindy" "texindy %s" TeX-run-command nil t :help "Run xindy to create index file") ("Check" "lacheck %s" TeX-run-compile nil (latex-mode) :help "Check LaTeX file for correctness") ("ChkTeX" "chktex -v6 %s" TeX-run-compile nil (latex-mode) :help "Check LaTeX file for common mistakes") ("Spell" "(TeX-ispell-document \"\")" TeX-run-function nil t :help "Spell-check the document") ("Clean" "TeX-clean" TeX-run-function
[AUCTeX-devel] [corrected patch] (was: patch for the exam class.)
Again I am not sure which patch format is better suited. diff --git a/Makefile.in b/Makefile.in --- a/Makefile.in +++ b/Makefile.in @@ -159,7 +159,7 @@ style/framed.elstyle/paracol.el style/menukeys.el \ style/bidi.el style/FiraMono.el style/FiraSans.el \ style/bicaption.el style/amsfonts.el style/subfiles.el \ - style/dcolumn.el + style/dcolumn.el style/exam.el STYLEELC = $(STYLESRC:.el=.elc) diff --git a/style/exam.el b/style/exam.el new file mode 100644 --- /dev/null +++ b/style/exam.el @@ -0,0 +1,374 @@ +;;; exam.el --- AUCTeX style for the (LaTeX) exam class + + +;; Copyright (C) 2016 Free Software Foundation, Inc. + +;; Author: Uwe Brauer+;; Created: 2016-03-06 +;; Keywords: tex + +;; This file is part of AUCTeX. + +;; AUCTeX is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; AUCTeX is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with AUCTeX; see the file COPYING. If not, write to the Free +;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +;; 02110-1301, USA. + +;;; Commentary: + +;; This file adds support for the exam class. + +;; Acknowledgements +;; Arash Esbati for a almost complete rewrite. + +;;; Code: + +(defvar LaTeX-exam-class-options '("answers" "addpoints") + "Class options for the exam class.") + +(defun LaTeX-exam-insert-item () + "Insert a new item in an environment from exam class. +Item inserted depends on the environment." + (TeX-insert-macro + (cond ((string= environment "questions") + "question") + ((string= environment "parts") + "part") + ((string= environment "subparts") + "subpart") + ((string= environment "subsubparts") + "subsubpart") + ;; Fallback + (t "item" + +(defun LaTeX-exam-insert-label (_optional name type) + "Indent the line and query/insert a label incl. the \"\\label\" macro. +Arguments NAME and TYPE are the same as for the function +`LaTeX-label'. OPTIONAL is ignored." + (indent-according-to-mode) + (let ((currenv (LaTeX-current-environment))) +(LaTeX-label (or name currenv) (or type 'environment + +(TeX-add-style-hook + "exam" + (lambda () + + ;; Make our label prefix available ... + (let ((envs '("questions"))) + (dolist (env envs) + ;; to AUCTeX + (add-to-list 'LaTeX-label-alist +(cons env 'LaTeX-exam-label)) + ;; to RefTeX with `reftex-add-label-environments' + (when (fboundp 'reftex-add-label-environments) + (reftex-add-label-environments + `((,env ,LaTeX-exam-reftex-quick-id-key ,LaTeX-exam-label + "~\\ref{%s}" nil + (regexp "[Qq]uestions?" "[Nn]umbers?"))) + (when (or (member "xcolor" (TeX-style-list)) + (member "color" (TeX-style-list))) + (TeX-add-symbols '("shadedsolutions" 0))) + + (LaTeX-add-environments "solution" + "solutionorbox" + "solutionorlines" + "solutionordottedlines" + '("questions" LaTeX-env-item) + '("parts" LaTeX-env-item) + '("subparts" LaTeX-env-item) + '("subsubparts" LaTeX-env-item)) + + ;; Tell AUCTeX about special environments: + (let ((envs '("questions" "parts" "subparts" "subsubparts"))) + (dolist (env envs) + (add-to-list 'LaTeX-item-list +(cons env 'LaTeX-exam-insert-item + + ;; Append us only once: + (unless (and (string-match "question" LaTeX-item-regexp) +(string-match "subsub" LaTeX-item-regexp)) + (set (make-local-variable 'LaTeX-item-regexp) + (concat + LaTeX-item-regexp + "\\|" + "\\(titled\\)?question\\b" + "\\|" + "\\(sub\\|subsub\\)?part\\b")) + (LaTeX-set-paragraph-start)) + + (TeX-add-symbols +'("part" [ "Points" ] (TeX-arg-literal " ")) +'("subpart" [ "Points" ] (TeX-arg-literal " ")) +'("gradetable" + [ TeX-arg-eval completing-read + (TeX-argument-prompt optional nil "Orientation") + '("v" "h") ] + [ TeX-arg-eval completing-read + (TeX-argument-prompt optional nil "Table index") + '("questions" "pages") ] ) +'("bonusgradetable" + [ TeX-arg-eval completing-read + (TeX-argument-prompt optional nil "Orientation") +
Re: [AUCTeX-devel] patch for the exam class.
> Uwe Brauerwrites: > I mean in (partial)gradtable. In part, you have (TeX-arg-literal " ") > which adds a space, i.e. `\part[100] ' to mimic an \item. > In (partial)gradtable, you have (TeX-arg-literal "") which actually does > nothing. I was wondering why it is necessary. You are absolutely right, that was from some other old code to add space which was not necessary here. Uwe ___ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel
Re: [AUCTeX-devel] patch for the exam class.
Uwe Brauerwrites: "Arash" == Arash Esbati writes: > >>> + (TeX-add-symbols >>> +'("part" [ "Points" ] (TeX-arg-literal " ")) >>> +'("subpart" [ "Points" ] (TeX-arg-literal " ")) > >>> +'("gradetable" [ "1. Option" ](TeX-arg-literal "")[ "2. Option" > ](TeX-arg-literal "")) >>> +'("partialgradetable" 1 [ "1. Option" ](TeX-arg-literal "")[ "2. > Option" ](TeX-arg-literal "")) > >> What's the rationale behind the (TeX-arg-literal "") here? You could >> write something like: > > You mean in (partial)gradtable or also in part? I mean in (partial)gradtable. In part, you have (TeX-arg-literal " ") which adds a space, i.e. `\part[100] ' to mimic an \item. > As for (partial)gradtable > > When I use Tex-insert-macro > RET > gradtable > Optional 1. Option: h > RET > Optional 2. Option: question > RET > > I obtain what I want, namely > > \gradetable[h][question] > > Are you saying this is a ugly hack. Fine I take your code, but my > «solution» works In (partial)gradtable, you have (TeX-arg-literal "") which actually does nothing. I was wondering why it is necessary. > Thanks again, I will take your suggestions, but I am bit curious about > my ugly hack solutions > '("extrafootheight" ["Measure"](TeX-arg-literal "")1) > '("gradetable" [ "1. Option" ](TeX-arg-literal "")[ "2. Option" > ](TeX-arg-literal "")) Same here, I'm asking why (TeX-arg-literal "") is necessary at all? I don't see the added value. Best, Arash ___ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel
Re: [AUCTeX-devel] subfiles.el: implement patch provided by Arash Esbati
Uwe Brauerwrites: Hi Uwe, I've just pushed your patch to git under your name. I took the liberty and touch the file a little. Thanks for providing the style. Best, Arash ___ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel
[AUCTeX-diffs] GNU AUCTeX branch, master, updated. def20e774e6d3f9f9d3ca24e2e17a8c126d8137c
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU AUCTeX". The branch, master has been updated via def20e774e6d3f9f9d3ca24e2e17a8c126d8137c (commit) from c3a21f2c6a23f229c8080dc55599d3df755e501f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - commit def20e774e6d3f9f9d3ca24e2e17a8c126d8137c Author: Uwe BrauerDate: Mon Dec 26 12:57:35 2016 +0100 Make AUCTeX and RefTeX aware of file loading macro \subfile * style/subfiles.el ("subfiles"): Make subfile macro be recognized as a paragraph command. For AUCTeX, add argument of subfile to `TeX-auto-file'. For RefTeX, append subfile to `reftex-include-file-commands' and run `reftex-compile-variables' only once. Code rearrangement. diff --git a/style/subfiles.el b/style/subfiles.el index 604e4f9..44f897a 100644 --- a/style/subfiles.el +++ b/style/subfiles.el @@ -24,7 +24,7 @@ ;; 02110-1301, USA. ;; Acknowledgements -;; Mosè Giordano +;; Mosè Giordano ;; Arash Esbati ;;; Commentary: @@ -39,18 +39,39 @@ (TeX-add-style-hook "subfiles" (lambda () - ;; The following code will fontify `\subfile{}' like include. - (when (and (featurep 'font-latex) - (eq TeX-install-font-lock 'font-latex-setup)) - (font-latex-add-keywords '(("subfile" "{")) - 'reference)) - ;; The following code will run `TeX-run-style-hooks' on the subfile master file. - ;; Thanks to Mosè Giordano for presenting a better solution using `assoc'. + + ;; The following code will run `TeX-run-style-hooks' on the subfile + ;; master file. Thanks to Mosè Giordano for + ;; presenting a better solution using `assoc'. (TeX-run-style-hooks (file-name-base (cadr (assoc "subfiles" LaTeX-provided-class-options + (TeX-add-symbols -'("subfile" TeX-arg-file))) - LaTeX-dialect) +'("subfile" TeX-arg-file)) + + ;; Ensure that \subfile stays in one line + (LaTeX-paragraph-commands-add-locally "subfile") + ;; Tell AUCTeX that \subfile loads a file. regexp is the same as + ;; for \input or \include. This will run `TeX-run-style-hooks' on + ;; subfile(s) when master file is loaded. + (TeX-auto-add-regexp +`(,(concat + "subfile" + "{\\(\\.*[^#}%\\.\n\r]+\\)\\(\\.[^#}%\\.\n\r]+\\)?}") + 1 TeX-auto-file)) + + ;; Tell RefTeX the same thing. + (when (and (boundp 'reftex-include-file-commands) + (not (member "subfile" reftex-include-file-commands))) + (add-to-list 'reftex-include-file-commands "subfile" t) + (reftex-compile-variables)) + + ;; The following code will fontify `\subfile{}' like \input. + (when (and (featurep 'font-latex) + (eq TeX-install-font-lock 'font-latex-setup)) + (font-latex-add-keywords '(("subfile" "{")) + 'reference))) + LaTeX-dialect) ;;; subfiles.el ends here --- Summary of changes: style/subfiles.el | 41 +++-- 1 file changed, 31 insertions(+), 10 deletions(-) hooks/post-receive -- GNU AUCTeX ___ auctex-diffs mailing list auctex-di...@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-diffs
[AUCTeX-commit] GNU AUCTeX branch, master, updated. def20e774e6d3f9f9d3ca24e2e17a8c126d8137c
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU AUCTeX". The branch, master has been updated via def20e774e6d3f9f9d3ca24e2e17a8c126d8137c (commit) from c3a21f2c6a23f229c8080dc55599d3df755e501f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - commit def20e774e6d3f9f9d3ca24e2e17a8c126d8137c Author: Uwe BrauerDate: Mon Dec 26 12:57:35 2016 +0100 Make AUCTeX and RefTeX aware of file loading macro \subfile * style/subfiles.el ("subfiles"): Make subfile macro be recognized as a paragraph command. For AUCTeX, add argument of subfile to `TeX-auto-file'. For RefTeX, append subfile to `reftex-include-file-commands' and run `reftex-compile-variables' only once. Code rearrangement. --- Summary of changes: style/subfiles.el | 41 +++-- 1 file changed, 31 insertions(+), 10 deletions(-) hooks/post-receive -- GNU AUCTeX ___ auctex-commit mailing list auctex-com...@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-commit
Re: [AUCTeX-devel] patch for the exam class.
>>> "Arash" == Arash Esbatiwrites: > Hi Uwe, > Uwe Brauer writes: > You're welcome. I keep on giving some comments, I hope it's ok :-) Definitely ;-) >> +;;; Code: >> + >> +;;; Code: > You have a dupe here. ok >> +(defcustom LaTeX-exam-reftex-quick-id-key ?x >> + "Unique letter identifying exam class macros in RefTeX. >> + >> +A character argument for quick identification when RefTeX inserts >> +new labels with `reftex-label'. It must be unique. It is >> +initialized to ?x." >> + :group 'LaTeX-style >> + :type 'character) >> + >> +(defcustom LaTeX-exam-label "exm:" >> + "Default prefix to labels in environments of exam class." >> + :group 'LaTeX-style >> + :type 'string) > You should move these 2 variables into `tex-style.el' -- it contains > customizable variables for AUCTeX style files. ok >> + (TeX-add-symbols >> +'("part" [ "Points" ] (TeX-arg-literal " ")) >> +'("subpart" [ "Points" ] (TeX-arg-literal " ")) >> +'("gradetable" [ "1. Option" ](TeX-arg-literal "")[ "2. Option" ](TeX-arg-literal "")) >> +'("partialgradetable" 1 [ "1. Option" ](TeX-arg-literal "")[ "2. Option" ](TeX-arg-literal "")) > What's the rationale behind the (TeX-arg-literal "") here? You could > write something like: You mean in (partial)gradtable or also in part? As for (partial)gradtable When I use Tex-insert-macro RET gradtable Optional 1. Option: h RET Optional 2. Option: question RET I obtain what I want, namely \gradetable[h][question] Are you saying this is a ugly hack. Fine I take your code, but my «solution» works > '("gradetable" > [ TeX-arg-eval completing-read > (TeX-argument-prompt optional nil "Orientation") > '("v" "h") ] > [ TeX-arg-eval completing-read > (TeX-argument-prompt optional nil "Table index") > '("questions" "pages") ] ) >> +'("subsubpart" [ "Points" ] (TeX-arg-literal " ")) >> +'("question" ["Points"] (TeX-arg-literal " ")) >> +'("subpart" ["Points"] (TeX-arg-literal " ")) >> +'("subsubpart" ["Points"] (TeX-arg-literal " ")) > These 2 are also dupes. thanks >> +'("extrafootheight" ["Measure"] (TeX-arg-literal " ")) > I'm not an exam user, but I think this defintion is wrong. examdoc.pdf > page 99 says a usage like \extrafootheight[.5in]{.25in}. I would then > suggest something like You are right But the ugly hack '("extrafootheight" ["Measure"](TeX-arg-literal "")1) Would also work, however I will take your solution :-D >'("extrafootheight" [ TeX-arg-length "Extra height 1. page footer" ] > (TeX-arg-length "Extra height footers")) >> +'("Alph" 0) ;ok >> +'("Roman" 0);ok >> +'("alph" 0) ;ok >> +'("arabic" 0) ;ok > These are already in latex.el. You don't need them. Oops >> +'("answerlinelength" 1) ;ok >> +'("answerskip" 1) ;ok > These are set with \setlength in document? If so, you should move them > out of (TeX-add-symbols ...) and set them with (LaTeX-add-lengths): > (LaTeX-add-lengths "answerlinelength" "answerskip") >> +'("colorbox" 0) ;ok ok > You should drop this. \colorbox is defined in color.el and xcolor.el. > Depending on which package used by the user, this command will become > available. And while we're at it: page 70 says that the command > \shadedsolutions can be used if \usepackage{color} is in the preamble. > Then I suggest you move this line: >> +'("shadedsolutions" 0) ;ok ok > out of TeX-add-symbols and do something like this in the style hook: > (when (or (member "xcolor" (TeX-style-list)) > (member "color" (TeX-style-list))) > (TeX-add-symbols '("shadedsolutions" 0))) ok > Best, Arash Thanks again, I will take your suggestions, but I am bit curious about my ugly hack solutions '("extrafootheight" ["Measure"](TeX-arg-literal "")1) '("gradetable" [ "1. Option" ](TeX-arg-literal "")[ "2. Option" ](TeX-arg-literal "")) Uwe ___ auctex-devel mailing list auctex-devel@gnu.org https://lists.gnu.org/mailman/listinfo/auctex-devel