Re: AUCTeX does not ask for width for \includegraphics macro anymore

2023-03-03 Thread Thibaut Verron

On 03/03/2023 14:19, kaykal wrote:


Tassilo Horn t...@gnu.org writes:

It's not. For me using the current master version, it still
queries for
the keyval parameters (width, height, angle, scale, etc.).

It only happens for Beamer. It works fine when using article class for 
example.



Did you try forcing AUCTeX to refresh its scanned data with C-c C-n?

I occasionally need to do that to get AUCTeX to prompt me for the 
frametitle of beamer frames, it could be a similar problem here.


Best wishes,

Thibaut


Re: AUCTeX to compile each \include file to a separate file

2022-11-22 Thread Thibaut Verron
Le mar. 22 nov. 2022 à 19:07, kaykal  a écrit :

> Hi everyone,
>
> Is there anyway to generate different PDF files for each included file in
> master file with AUCTeX.
>
> More specifically, I have one master file called “master”, in which, I
> have included two chapters: “chapter01” and “chapter02”.  I want AUCTeX
> (after appropriate number of runs) to generate one PDF for the master file,
> one PDF for chapter01, one PDF for chapter02 and (the bonus) one PDF for
> bibliography.
>

Hi,

You can have the pdf for the different chapters by using the selective
compilation functions: open the file chapter01, and execute
TeX-command-buffer (C-c C-b) should compile the appropriate chapter.

The bibliography is more tricky, I don't know if there is a solution.

Also, numbers and references will be local to the chapter: you will get
files which are suitable for a quick preview, but concatenating them will
not be as good as compiling the whole document together.

Best wishes,
Thibaut


Re: \frametitle macro is not automatically indented in frame environment in beamer

2021-08-25 Thread Thibaut Verron

On 25/08/2021 16:52, Arash Esbati wrote:

Kourosh Kalayeh  writes:


On 25 Aug 2021, at 10:27, Thibaut Verron wrote:


Oh I'm very sorry, I read "insert" instead of "indent". What is the
value of the variable auto-fill-function in your buffer?

I ran `C-h v` with `auto-fill-function` as an argument (while in
AUXTeX mode), and I got its value as nil.

This behaviour is due to this change in beamer.el[1].  AUCTeX now checks
if users have auto-filling enabled before filling.  Hence, you have to
turn that mode on in order to get the old behaviour with something like
this in your init file:

 (add-hook 'LaTeX-mode-hook #'turn-on-auto-fill)


With the side effect of enabling auto-fill.

If you don't want auto-fill, a less intrusive but somewhat more 
hazardous alternative could be:


(add-hook 'LaTeX-mode-hook (lambda () (setq auto-fill-function 
'indent-according-to-mode)))

Best wishes,

Thibaut




Re: \frametitle macro is not automatically indented in frame environment in beamer

2021-08-25 Thread Thibaut Verron



No worries, thank you for clarification.

I ran |C-h v| with |auto-fill-function| as an argument (while in 
AUXTeX mode), and I got its value as nil.


Thanks,
Kourosh

Okay, then it looks like a new behavior indeed. It appears that the 
\frametitle command was never actually indented, but rather auto-filled, 
which had the side effect of indenting it. Now auctex checks whether the 
user actually wants to auto-fill before doing so.


I would say that it is a bug and that indentation should be considered 
(or done) regardless of auto-filling.


Modifying the behavior in your configuration is a bit awkward, because 
(afaik) you have to copy the whole (TeX-add-style-hook "beamer" ...) 
form from /style/beamer.el, and make the 
change. If you want to go that route, adding (indent-according-to-mode) 
before the lines saying ";; This works because \frametitle is a 
paragraph command." should work (untested).


Best wishes,

Thibaut



Re: \frametitle macro is not automatically indented in frame environment in beamer

2021-08-25 Thread Thibaut Verron

On 25/08/2021 16:11, Kourosh Kalayeh wrote:


On 25 Aug 2021, at 10:06, Thibaut Verron wrote:

On 25/08/2021 16:00, Kourosh Kalayeh wrote:


Hi all,

After most recent update of AUCTeX, I have noticed something has
changed in entering “frame” environment in beamer using |C-c C-e|
key; it does not automatically indent |\frametitle| macro
anymore. Can anyone help me figuring out how I can achieve this.

I am running AUCTeX 13.0.13 in Emacs 27.2 on MacOS.

Thanks,
Kourosh


Hi,

Can you try to reload auctex with C-c C-n (or, after saving, M-x
revert-buffer, or close and reopen the file) to make sure that the
beamer style file is loaded?

Best wishes,

Thibaut


Thank you for your message. Yes, I have tried them all, no luck.

Oh I'm very sorry, I read "insert" instead of "indent". What is the 
value of the variable auto-fill-function in your buffer?


Best wishes,

Thibaut



Re: \frametitle macro is not automatically indented in frame environment in beamer

2021-08-25 Thread Thibaut Verron

On 25/08/2021 16:00, Kourosh Kalayeh wrote:


Hi all,

After most recent update of AUCTeX, I have noticed something has 
changed in entering “frame” environment in beamer using |C-c C-e| key; 
it does not automatically indent |\frametitle| macro anymore. Can 
anyone help me figuring out how I can achieve this.


I am running AUCTeX 13.0.13 in Emacs 27.2 on MacOS.

Thanks,
Kourosh


Hi,

Can you try to reload auctex with C-c C-n (or, after saving, M-x 
revert-buffer, or close and reopen the file) to make sure that the 
beamer style file is loaded?


Best wishes,

Thibaut



Re: disable automatic indentation in table like environments

2020-08-10 Thread Thibaut Verron
Dear all,

For what it's worth, I have put up together a while ago an alternative
function for `LaTeX-indent-tabular`. My biggest problem with the old
function was its insistence on indenting hanging ampersands as if they were
not hanging. It makes it impossible to break long lines, since AUCTeX then
wants to indent the new line to the last column of the previous one.

The function is attached, it does not call
`LaTeX-hanging-ampersand-position`.
I cannot guarantee that it always does the right thing, but so far it
matched all my expectations.

Best,
Thibaut

Le dim. 2 août 2020 à 09:28, Jean-Jacques Rétorré  a
écrit :

> sam. 01 août 2020,  François Patte 
> disait :
>
> > Le 01/08/2020 à 19:24, Jean-Jacques Rétorré a écrit :
> >> sam. 01 août 2020,  François Patte 
> disait :
> >>
> >>> Bonjour,
> >>>
> >>> I am wondering if it is possible to disable automatic indentation in
> >>> table like environments (tabular, longtable, etc.).
> >>>
> >>> In a complex table, the result of automatic indentation is awfull and
> >>> makes the able unreadable in emacs, so it is difficult to find
> errors...
> >>>
> >>> Thank you.
> >>>
> >>> PS. If possible give me some details on how to proceed, I don't know
> >>> anything of lisp language (shame on me!)
> >>
> >> You can customize the variable 'LaTeX-indent-environment-list
> >> and disable the functions you don't want to be active for the
> >> ennvironments you want to customize
> >>
> >> M-x customize-variable ...
> >
> > Thank you for answering. I edited the LaTeX-indent-environment-list and
> > found that only verbatim and verbatim* environments were set to :
> > "current indentation".
> >
> > The others (equation, equation*, picture, tabbing, table, table*) are
> > set to : "ignore".
> >
> > Do I have to add longtable for instance and how to do this?
> >
>
> I don't have this configuration, yet I haven't changed the default
> configuration.
> Value:
> (("verbatim" current-indentation)
>   ("verbatim *" current-indentation)
>   ("filecontents" current-indentation)
>   ("filecontents *" current-indentation)
>   ("tabular" LaTeX-indent-tabular)
>   ("tabular *" LaTeX-indent-tabular)
>   ("align" LaTeX-indent-tabular)
>   ("align *" LaTeX-indent-tabular)
>   ("array" LaTeX-indent-tabular)
>   ("eqnarray" LaTeX-indent-tabular)
>   ("eqnarray *" LaTeX-indent-tabular)
>   ("displaymath")
>   ("equation")
>   ("equation*")
>   ("picture")
>   ("tabbing"))
>
> Indentation in an environment is controlled by a function. I find that
> the LaTeX-indent-tabular function is not very satisfactory in some
> cases. The solution would be to write a function that does what you
> want, but that's Emacs-lisp code.  It is one of the easiest computer
> languages to learn and use that I know ...
>
> --
> JJR.
>
>
>
(defun LaTeX-indent-tabular ()
  "Return indent column for the current tabular-like line."
  (let* ((beg-pos (car (LaTeX-env-beginning-pos-col)))
	 (beg-col
	  (save-excursion
	(goto-char beg-pos)
	(beginning-of-line)
	(+ (current-indentation)
	   (LaTeX-indent-level-count)
	   (- 2) ; Was hard coded elsewhere before me...
(let ((tabular-like-end-regex
	   (format "end{%s}"
		   (regexp-opt
		(let (out)
		  (mapc (lambda (x)
  (when (eq (cadr x) 'LaTeX-indent-tabular)
(push (car x) out)))
LaTeX-indent-environment-list)
		  out)
  (cond ((looking-at tabular-like-end-regex)
	 beg-col)
	((looking-at "")
	 (+ 4 beg-col))
	((looking-at "&")
	 (+ 4 beg-col)) ;; If I put a newline it's that the line was too long
	(t
	 (+ 2
		(if (and (save-excursion
			   (re-search-backward "\\|[^\\]&" beg-pos t))
			 (= ?& (char-before (match-end 0
		;; If a new line is inserted it probably means
		;; that the line was too long
		(+ 2 beg-col) 
		  beg-col)))


bug#40222: Update

2020-03-25 Thread Thibaut Verron
I used the wrong command for reporting the bug, here is the information
reported by the reftex reporter.

Package: 26.3

current state:
==
(setq
 window-system 'x
 reftex-plug-into-AUCTeX t
 )
___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex


bug#40222: 12.2.0; Reftex occasionally mixes up the levels of sectioning in the toc

2020-03-25 Thread Thibaut Verron
Hello,

Sometimes (rarely), reftex-toc cannot place some sections at their
correct level.

The following document is more or less minimal:

"""
\documentclass{report}
\begin{document}

\chapter{Chapter 1}
\subsection{Subsection 1}
\section*{Section}
\section{Section 2}

\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
"""

The table of contents presented by reftex-toc is the following:

"""
   1 Chapter 1
   1.0.1 Subsection 1
 * Section
 1.1 Section 2
"""

Notice how the unnumbered section is ranked deeper than the subsection.

Removing the subsection, the chapter, or changing the unnumbered section
for a numbered
one all make the abnormal behavior disappear.

Promoting and demoting works as expected, but anything down from chapter
(so, anything but
part) is shifted a few indents to the right. A chapter* would be aligned
with the
subsection, and subdivisions are indented further.

The bug also happens with `emacs -Q`.

---

Emacs  : GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.11)
 of 2019-09-23, modified by Debian
Package: 12.2.0

current state:
==
(setq
 AUCTeX-date "2019-10-31"
 window-system 'x
 LaTeX-version "2e"
 TeX-style-path '("~/.emacs.d/auctex"
"/home/verron/.emacs.d/straight/build/auctex/style"
 "/home/verron/.emacs.d/auctex/auto" "/home/verron/.emacs.d/auctex/style"
"auto" "style")
 TeX-auto-save t
 TeX-parse-self t
 TeX-master t
 TeX-command-list '(("LatexMk" "latexmk %(-PDF)%S%(mode) %(file-line-error)
%(extraopts) %t" TeX-run-latexmk nil
(plain-tex-mode latex-mode doctex-mode) :help "Run LatexMk")
   ("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
(plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode
context-mode) :help
"Run BibTeX")
   ("Biber" "biber %s" TeX-run-Biber nil
(plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :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
(plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help
"Generate PostScript file")
   ("Dvips" "%(o?)dvips %d -o %f " TeX-run-dvips nil
(plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help
"Convert DVI file to PostScript")
   ("Dvipdfmx" "dvipdfmx %d" TeX-run-dvipdfmx nil
(plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help
"Convert DVI file to PDF with dvipdfmx")
   ("Ps2pdf" "ps2pdf %f" TeX-run-ps2pdf nil
(plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help
"Convert PostScript file to PDF")
   ("Glossaries" "makeglossaries %s" TeX-run-command nil
(plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help
"Run makeglossaries to create glossary\n file")
   ("Index" "makeindex %s" TeX-run-index nil
(plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help
"Run makeindex to create index file")
   ("upMendex" "upmendex %s" TeX-run-index t
(plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :help
"Run upmendex to create index file")
   ("Xindy" "texindy %s" TeX-run-command nil
(plain-tex-mode latex-mode doctex-mode ams-tex-mode texinfo-mode) :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 nil t :help "Delete generated
intermediate files")
   ("Clean All" "(TeX-clean t)" TeX-run-function nil t :help
"Delete generated intermediate and output files")
   ("Other" "" 

bug#28382: 11.90.2.2017-07-25; Wrapping content in an equation with LaTeX-environment results in invalid LaTeX

2017-09-07 Thread Thibaut Verron

Hello,

If you use `C-c C-e` (`LaTeX-environment`) to insert an "equation"
environment, the result is

\begin{equation}
\label{eq:1}
[point here]
\end{equation}

This is valid LaTeX assuming that the user actually types a formula in.

If now you insert the equation first, select it, and use `C-c C-e` to
wrap it in an "equation" environment, the result is

\begin{equation}
2+2=4\label{eq:2}
[point here]
\end{equation}

This raises a compilation error: an equation cannot contain an empty line.
And with the label at the end of the formula, it isn't convenient in
case the formula wasn't complete either.

In my opinion, the expected output would be either

\begin{equation}
\label{eq:2}
2+2=4
\end{equation}
[point here]

or

\begin{equation}
\label{eq:2}
2+2=4[point here]
\end{equation}

depending on whether you expect the user to wrap complete formulae or
not. I personally almost always wrap complete formulae, so I'd choose
option 1.

In the expected output, I also moved the `\label{...}` to the beginning
of the environment instead of the end. It is the recommended way of
proceeding, but I don't know if it makes any real difference for the
compiler. If anything, it would make equation labelling consistent with 
what

is produced with `C-c C-e` with the mark inactive.

The same thing happens with similar environments. For unlabeled
environments, the output is similar to option 2 above, which seems to
hint that the newline appears when inserting the `\label`.

Is there a good reason that I missed for the current behavior?

Thanks,

Thibaut


Emacs : GNU Emacs 25.1.4 (x86_64-pc-linux-gnu, GTK+ Version 2.24.30)
of 2016-11-08
Package: 11.90.2.2017-07-25

current state:
==
(setq
AUCTeX-date "2017-07-25"
window-system 'x
LaTeX-version "2e"
TeX-style-path '("~/.emacs.d/auctex" 
"/home/controleapo/.emacs.d/elpa/auctex-11.91.0/style"
"/home/controleapo/.emacs.d/auctex/auto" 
"/home/controleapo/.emacs.d/auctex/style"

"auto" "style")
TeX-auto-save t
TeX-parse-self t
TeX-master nil
TeX-command-list '(("LatexMk" "latexmk %(-PDF)%S%(mode) 
%(file-line-error) %(extraopts) %t"
TeX-run-latexmk nil (plain-tex-mode latex-mode doctex-mode) :help "Run 
LatexMk")
("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")
("Glossaries" "makeglossaries %s" TeX-run-command nil t :help
"Run makeglossaries to create glossary file")
("Index" "makeindex %s" TeX-run-index nil t :help
"Run makeindex to create index file")
("upMendex" "upmendex %s" TeX-run-index t t :help
"Run upmendex 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 nil t :help
"Delete generated intermediate files")
("Clean All" "(TeX-clean t)" TeX-run-function nil t :help
"Delete generated intermediate and output files")
("Other" "" TeX-run-command t t :help "Run an arbitrary command"))
)




___
bug-auctex mailing list
bug-auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-auctex