auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some LaTeX commands, such as \boldsymbol and \hspace, can't be compl


From: Arash Esbati
Subject: Re: Some LaTeX commands, such as \boldsymbol and \hspace, can't be completed in AUCTeX.
Date: Thu, 09 Dec 2021 12:44:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50

Denis Bitouzé <denis.bitouze@univ-littoral.fr> writes:

> Le 08/12/21 à 12h39, Arash Esbati a écrit :
>
>> AUCTeX has support for \hspace, just try `C-c C-m hs<TAB> RET' and
>> when asked for 'Length: ", press TAB and check the completion.
>
> OK for `\hspace`.
>
>> \linewidth is also available.
>
> Not for `\linewidth`:

Maybe I wasn't clear, I meant \linewidth is available for completion of
\hspace.

> with `C-c C-m line<TAB>', I only get:
>
>   ┌────
>   │ Click on a completion to select it.
>   │ In this buffer, type RET to select the completion near point.
>
>   │ Possible completions are:
>   │ line
>   │ linebreak
>   │ linethickness
>   └────

Agreed, and I also said why in my previous message.

>> Can you please elaborate what exactly you mean?  I'm not sure if I get
>> the point.
>
> I don't remember all the cases where I missed completion but, when I use
> TeXstudio (TXS), I often say to myself: completion for this command is
> available with TXS and not with AUCTeX, too bad!

You can always drop a line to auctex-devel asking for an addition.  Or
even better provide code for the missing package/command.  I think for
most of packages out there providing only user macros it's not hard to
write AUCTeX styles.

> I would say AUCTeX tries to be too clever here.

That's a general Emacs-thing, not only related to AUCTeX 😉

> once `graphicx` is taken into account:
>
> 1. \includegraphics is available with completion,
> 2. we are asked for the options (BTW, maybe it would be helpful to
>    immediately see the possible options, without having to TAB),

There are cases where the optional argument is really optional.  I find
it rather distracting to get see all possible options immediately.  But
that's only me.

> 3. if we choose `width=` and start to type:
>    1. `\line`, indeed `\linewidth` is available with TAB, but we have to
>       type `\` which is not handy on e.g. French keyboards,

Why do start to type after 'width='.  Just hit TAB and the backslash is
inserted in the minibuffer and you can go on with 'l TAB'.

While we're at it, does TXS has something like `C-c C-m' or does it
inline completion like company for Emacs where you start typing and get
a drop-down list to select of?  I admit I've never used anything else
than (X)Emacs so I don't know.

>    2. `0.7\line` because we want `width=0.7\linewidth`, `\linewidth` is
>       not available with TAB.

True, but this is then by design of Emacs and completion tables.  I
think the main problem is the amount of choices you have with:

    width=\linewidth
    width=0.7\linewidth
    width=5cm

You have to find a compromise.

> It may happen e.g. if, afterwards, you change your mind and want to
> change `\includegraphics[width=15cm]{...}` into
> `\includegraphics[width=\linewidth]{...}`.

Again, I'd prefer not to pollute the completion list for macros with
non-macros like this -- this is a key/val thing.

>> Any specific package you're missing?
>
> I would say, all! :) What I want to say is that I don't need a specific
> one at the moment but anybody can miss any of them at anytime. By
> comparison, TXS provides 1387 completion files:
>
>   ┌────
>https://github.com/texstudio-org/texstudio/tree/master/completion
>   └────

That's one impressive number.  But again, dropping a line to
auctex-devel requesting a package or better providing code directly is
the best way to increase the number styles provided by AUCTeX.

Best, Arash




reply via email to

[Prev in Thread] Current Thread [Next in Thread]