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)))