From: Hongyi Zhao <hongyi.zhao@gmail.com>
To: auctex-devel@gnu.org
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: A strange auto typesetting problem when using auctex.
Date: Mon, 14 Jun 2021 14:12:33 +0800 [thread overview]
Message-ID: <CAGP6POJ6iDWpF9qaCycA=YbZBU5Mk=fBEgQn=ETXCJirxwk9xw@mail.gmail.com> (raw)
In-Reply-To: <CAGP6POJRFN0qz+C=+sxcMrGfG2hG+ok1fc=5yOnsX+yVjhmbwg@mail.gmail.com>
On Mon, Jun 14, 2021 at 11:45 AM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
>
> On Ubuntu 20.04, I use the latest git master Emacs version compiled by
> myself. I install and load auctex's git master version with the
> following bootstrap code in `~/.emacs.d/init.el':
>
> ;;Bootstrap auctex via straight
> (straight-use-package
> `( auctex :type git :host nil :repo
> "https://git.savannah.gnu.org/git/auctex.git"
> :pre-build ,(pcase system-type
> (`berkeley-unix '("gmake"))
> (_ '(
> ;("bash" "-c" "cd ~/.emacs.d/straight/repos/auctex")
> ("./autogen.sh")
> ("./configure")
> ("make")
> ("sudo" "make" "install"))))))
>
> (load "auctex.el" nil t t)
> (load "preview-latex.el" nil t t)
> ;;; auctex config ends here
>
> Then I try to test auctex with the following LaTeX sample file:
>
> %% LaTeX sample file
> \documentclass{paper}
> \usepackage{hyperref}
> \begin{document}
> See
> \href{http://www.fulviofrisone.com/attachments/article/480/Ballentine%20L.%20Quantum%20mechanics%20-%20a%20modern%20development%20(1998)(T)(673s).pdf}{page
> 98}
> \end{document}
> %% LaTeX sample file ends here
>
> When I put the point after the `{page 98}' and hit RET, the LaTeX file
> will be automatically completed into the following:
>
> %% LaTeX sample file
> \documentclass{paper}
> \usepackage{hyperref}
> \begin{document}
> See
> \href{http://www.fulviofrisone.com/attachments/article/480/Ballentine%20L.%20Quantum%20mechanics%20-%20a%20modern%20development%20(1998)(T)(673s).pdf}{page
> % 98}
>
> \end{document}
> %% LaTeX sample file ends here
>
> As you can see, the auto-completed typesetting result is wrong due to
> the leading `%' before ` 98}'.
>
> Any hints for this problem?
Finally, I found the problem was caused by the '%' character appearing
in the URL, which in its literal form, is a comment character of
LaTeX, so the Emacs/auctex thinks that the newline should be commented
out continuously.
Change the URL line into the following will fix the problem:
\href{http://www.fulviofrisone.com/attachments/article/480/Ballentine\%20L.\%20Quantum\%20mechanics\%20-\%20a\%20modern\%20development\%20(1998)(T)(673s).pdf}{page
98}
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
next prev parent reply other threads:[~2021-06-14 6:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-14 3:45 A strange auto typesetting problem when using auctex Hongyi Zhao
2021-06-14 6:12 ` Hongyi Zhao [this message]
2021-06-14 11:48 ` Tassilo Horn
2021-06-14 15:43 ` Hongyi Zhao
2021-06-14 19:14 ` Tassilo Horn
2021-06-15 0:48 ` Hongyi Zhao
2021-06-14 20:04 ` Arash Esbati
2021-06-15 0:51 ` Hongyi Zhao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGP6POJ6iDWpF9qaCycA=YbZBU5Mk=fBEgQn=ETXCJirxwk9xw@mail.gmail.com' \
--to=hongyi.zhao@gmail.com \
--cc=auctex-devel@gnu.org \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).