Debian AUCTeX package

2023-11-16 Thread Arash Esbati
Hi Davide,

I hope you're doing fine.  It occurred to me that Debian is still
providing AUCTeX 12.2. which was released 4 years ago.  Do you have
plans to update the package?  Or is it dormant?

Best, Arash



Re: Wrong type argument: symbolp, when inserting equation reftex-label

2023-11-16 Thread Arash Esbati
JOSE MARIA MARTIN OLALLA  writes:

> Yes, you got it right. The current Debian 12 released 2023 is shipping
> AUCTeX 12.2.

Thanks for the confirmation.

> I removed the apt-installed AUCTeX and did the package-install stuff.
>
> It worked like charm.

Glad we have this resolved.

> I must add I have been an Emacs-AUCTeX user since the 2000s or so. I
> love acknowledging the terrific contribution that free software do in
> the studies I got published.  Sometimes these acknowledgements get
> published[1].  I take this opportunity to thank you all again.

Thank you for your kind words.

Best, Arash



master 38a883d3: Save regexp groups in style/minted.el

2023-11-16 Thread Arash Esbati
branch: master
commit 38a883d37c43f4841342ed3ef8d95040d7cfc010
Author: Arash Esbati 
Commit: Arash Esbati 

Save regexp groups in style/minted.el

* style/minted.el (LaTeX-minted-pygmentize-program): Add
docstring.
(LaTeX-minted-language-list, LaTeX-minted-style-list): Add
variables to `TeX-normal-mode-reset-list' so the variables aren't
reset upon regular re-parsing.
(LaTeX-minted-newmint-regexp): Extend regexp to cover all
\newmint* variations.  Delete other regexp additions to the
parser.
(LaTeX-minted-auto-prepare, LaTeX-minted-auto-cleanup): Adjust
functions to the above regexp change.
(LaTeX-minted-add-syntactic-keywords-extra): Improve docstring.
("minted"): Don't add deleted regexp's to the parser.
Accept also braces as delimiters for \mint macro.
---
 style/minted.el | 172 
 1 file changed, 86 insertions(+), 86 deletions(-)

diff --git a/style/minted.el b/style/minted.el
index 2f39b782..10bc0b35 100644
--- a/style/minted.el
+++ b/style/minted.el
@@ -176,10 +176,16 @@ prepends them to variable `LaTeX-minted-key-val-options'."
  (push (list key colors) result
LaTeX-minted-key-val-options))
 
-(defvar LaTeX-minted-pygmentize-program (executable-find "pygmentize"))
+(defvar LaTeX-minted-pygmentize-program (executable-find "pygmentize")
+  "Absolute file name to pygmentize program.")
 
 (defvar LaTeX-minted-language-list nil
-  "List containing languages provided by pymentize program.")
+  "List containing languages provided by pymentize program.
+Initialized once at the first prompt for a Pygments language.
+May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
+
+;; Add the variable to `TeX-normal-mode-reset-list':
+(add-to-list 'TeX-normal-mode-reset-list 'LaTeX-minted-language-list)
 
 (defun LaTeX-minted-language-list ( _ignored)
   "Return a list of languages provided by pymentize program.
@@ -198,7 +204,12 @@ Update the variable `LaTeX-minted-language-list' if still 
nil."
   LaTeX-minted-language-list
 
 (defvar LaTeX-minted-style-list nil
-  "List containing styles provided by pymentize program.")
+  "List containing styles provided by pymentize program.
+Initialized once at the first prompt for a Pygments style.
+May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
+
+;; Add the variable to `TeX-normal-mode-reset-list':
+(add-to-list 'TeX-normal-mode-reset-list 'LaTeX-minted-style-list)
 
 (defun LaTeX-minted-style-list ( _ignored)
   "Return a list of styles provided by pymentize program.
@@ -216,91 +227,83 @@ Update the variable `LaTeX-minted-style-list' if still 
nil."
 (setq LaTeX-minted-style-list styles))
   LaTeX-minted-style-list
 
-(defvar LaTeX-minted-auto-newminted nil)
-(defvar LaTeX-minted-newminted-regexp
-  '("newminted\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}{[^}]*}"
-(1 2) LaTeX-minted-auto-newminted))
+(TeX-auto-add-type "minted-newmint" "LaTeX")
 
-(defvar LaTeX-minted-auto-newmint nil)
 (defvar LaTeX-minted-newmint-regexp
-  '("newmint\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}{[^}]*}"
-(1 2) LaTeX-minted-auto-newmint))
-
-(defvar LaTeX-minted-auto-newmintinline nil)
-(defvar LaTeX-minted-newmintinline-regexp
-  '("newmintinline\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}{[^}]*}"
-(1 2) LaTeX-minted-auto-newmintinline))
-
-(defvar LaTeX-minted-auto-newmintedfile nil)
-(defvar LaTeX-minted-newmintedfile-regexp
-  '("newmintedfile\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}{[^}]*}"
-(1 2) LaTeX-minted-auto-newmintedfile))
+  
'("newmint\\(edfile\\|inline\\|ed\\)?\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}"
+(2 3 1) LaTeX-auto-minted-newmint)
+  "Match the arguments of \\newmint* macros from minted package.")
 
 (defun LaTeX-minted-auto-prepare ()
-  (setq LaTeX-minted-auto-newminted nil
-LaTeX-minted-auto-newmint   nil
-LaTeX-minted-auto-newmintinline nil
-LaTeX-minted-auto-newmintedfile nil
-LaTeX-minted-language-list  nil
-LaTeX-minted-style-list nil))
+  "Reset `LaTeX-auto-minted-newmint' before parsing."
+  (setq LaTeX-auto-minted-newmint nil))
 
 (defun LaTeX-minted-auto-cleanup ()
-  ;; \newminted{lang}{opts} => new langcode and langcode* envs.
-  ;; \newminted[envname]{lang}{opts} => new envname/envname* envs.
-  (dolist (name-lang LaTeX-minted-auto-newminted)
-(let* ((env (if (> (length (car name-lang)) 0)
-(car name-lang)
-  (concat (cadr name-lang) "code")))
-   (env* (concat env "*")))
-  (add-to-list 'LaTeX-auto-environment (list env))
-  (add-to-list 'LaTeX-auto-environment
-   (list env* #'LaTeX-env-args
- '(TeX-arg-key-val (LaTeX-minted-key-val-options
-  (add-to-list 'LaTeX-indent-environment-list `(,env current-indentation) 
t)
-  (add-to-list 'LaTeX-indent-environment-list `(,env* 

Re: preview: How to use Preview-PDF2DSC as default?

2023-11-16 Thread Ikumi Keita
Hi Yǔchēn,

> Yǔchēn Guō 郭宇琛  writes:
> Full log can be found at

> https://codeberg.org/m0p/ublock-origin-mirror/src/branch/main/preview-latex-luatex

The log shows that you are trying to use preable cache and that attempt
failed with the following error:
! I can't find file `mylatex.ltx'.
l.5 \let\dump\PREVIEWdump\dump}\input mylatex.ltx 
\relax%
So your TeX distribution (TeX Live 2022/nixos.org) lacks "mylatex.ltx"
for some reason. That is vital for preamble cache.

Try not using preamble cache and see what happens.

Regards,
Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopMassiveKilling #CeasefireNOW



preview: How to use Preview-PDF2DSC as default?

2023-11-16 Thread Yǔchēn Guō 郭宇琛
Hello.  I'm using LuaLaTeX with preview-latex.  The following occurs
when I attempt to preview the document:

`preview-document' first run, attempts to use dvips, which LuaLaTeX does
not support, since it does not generate any DVI files.

begin ==
Output written on testmath.pdf (560 pages, 391604 bytes).
SyncTeX written on testmath.synctex.gz.
Transcript written on testmath.log.

TeX Output exited as expected with code 1 at Thu Nov 16 11:40:06
Running `Preview-DviPS' with ``dvips -Pwww testmath.dvi -o 
testmath.prv/tmpvwWqxn/preview.ps''
Parser: End of Preview snippet 1 unexpected
This is dvips(k) 2022.1 (TeX Live 2022)  Copyright 2022 Radical Eye Software 
(www.radicaleye.com)
/run/current-system/sw/bin/dvips: DVI file can't be opened: testmath.dvi: No 
such file or directory

Preview-DviPS exited abnormally with code 1 at Thu Nov 16 11:40:06
DviPS sentinel: Opening input file: No such file or directory, 
/home/yc/Downloads/tub/testmath.prv/tmpvwWqxn/preview.ps
end   ==

`preview-document' second run and all subsequent runs: preview-latex
switches to Preview-PDF2DSC and successfully generates all preview images.

begin ==
Output written on testmath.pdf (560 pages, 391604 bytes).
SyncTeX written on testmath.synctex.gz.
Transcript written on testmath.log.

TeX Output exited as expected with code 1 at Thu Nov 16 11:42:30
Running `Preview-PDF2DSC' with ``pdf2dsc testmath.pdf 
testmath.prv/tmp89R8tO/preview.dsc''

Preview-PDF2DSC finished at Thu Nov 16 11:42:31
Running `Preview-Ghostscript' with ``/run/current-system/sw/bin/rungs 
-sOutputFile\=testmath.prv/tmp89R8tO/pr1-\%d.png -q -dDELAYSAFER -dNOPAUSE 
-DNOPLATFONTS -dPrinted -dTextAlphaBits\=4 -dGraphicsAlphaBits\=4 
-sDEVICE\=png16m -r368.06x378.372''

Preview-Ghostscript finished at Thu Nov 16 11:42:39
end   ==

How can I tell preview-latex to use PDF2DSC by default?

Minimum Example

begin ==

\documentclass{article}
\usepackage{unicode-math}
\begin{document}
\[a + b = c\]
\end{document}

end  ===

Full log can be found at

https://codeberg.org/m0p/ublock-origin-mirror/src/branch/main/preview-latex-luatex

Regards,
Yuchen