help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: A strange auto typesetting problem when using auctex.


From: Hongyi Zhao
Subject: Re: A strange auto typesetting problem when using auctex.
Date: Tue, 15 Jun 2021 08:48:15 +0800

On Tue, Jun 15, 2021 at 3:35 AM Tassilo Horn <tsdh@gnu.org> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> >> That's because the URL contains % and therefore looks like a "code
> >> comment" to auctex, e.g.
> >>
> >>   \some\latex{code}% And some comment bla bla bla bla...
> >>
> >> which would be properly filled as
> >>
> >>   \some\latex{code}% And some comment bla bla bla
> >>                    % ...bla...
> >>
> >> Of course, here it is wrong.
> >>
> >> I don't see what we could do here, unfortunately.  But please file a bug
> >> report (M-x TeX-submit-bug-report RET).
> >
> > Where will this submit the bug report?
>
> To the GNU bug tracker, debbugs.gnu.org, assigned to the package auctex.
>
> > But now, very strange, the problem disappeared.
>
> Me neither. :-)
>
> The reason is that once the auto-parser has kicked in and seen that you
> are using the hyperref LaTeX package, it'll recognize the \href macro
> (which is now also fontified correctly, e.g., not with
> font-lock-comment-face including and after the first %) and know that
> the % in the URL are not starting a comment.
>
> To demonstrate: When you comment the \usepackage{hyperref} and hit `C-c
> C-n' the problem will be back.  Uncommenting it again then and hitting
> `C-c C-n' makes it disappear.

Thank you for your insightful analysis.

>
> Bye the way, you might want to add
>
>     (setq TeX-parse-self t)
>     (setq TeX-auto-save t)

So far, I am using the following settings:

(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)


>
> to your auctex config as described in (info "(auctex) Top").
>
> Bye,
> Tassilo

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China



reply via email to

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