unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ralf Angeli <angeli@iwi.uni-sb.de>
Subject: Re: [cs-usenet@arcor.de: tex-mode: too many _ (underscores) interpreted as subscripts]
Date: Sun, 03 Oct 2004 15:52:48 +0200	[thread overview]
Message-ID: <cjp02u$236$1@sea.gmane.org> (raw)
In-Reply-To: E1CDv1l-0004xy-QH@fencepost.gnu.org

* Richard Stallman (2004-10-03) writes:

> Would someone please investigate this bug report and DTRT?
> Stefan made these changes, but he hasn't responded to
> my mail about this, so I think it is time to look
> for someone else.
>
> From: Christian Schlauer <cs-usenet@arcor.de>
> Subject: tex-mode: too many _  (underscores) interpreted as subscripts
> To: emacs-pretest-bug@gnu.org
> Date: Fri, 30 Jul 2004 15:21:23 +0200
[...]
> The News file of CVS Emacs announces the following for TeX mode:
>
> *** verbatim environments are now highlighted in courier by font-lock
> and super/sub-scripts are made into super/sub-scripts.
>
> At the moment, it considers too many underscores as subscript
> commands. While it leaves \cite{blah99:_long_title} and
> \verb+file_name+ alone, it displays the commands
> \nolinkurl{file_name_with_underscore.txt} and
> \url{file_name_with_underscore.txt} (both available with the hyperref
> package, the last one also with url.sty) wrong, that is, the first
> letter after an underscore in these commands is transformed into a
> subscript.

Inhibiting the subscript and superscript fontification is achieved by
checking if certain faces are present.  So a quick fix, only covering
\nolinkurl and \url, would be to add these commands e.g. to the
`citations' keywords in `tex-font-lock-keywords-2'.

If this should be fixed for arbitrary LaTeX commands which are not
fontified, one would have to check if the underscores in concern are
located inside of math environments.  In AUCTeX we are using
texmathp.el (which is distributed with AUCTeX) for these purposes.
But calls to `texmathp' can get very expensive especially in larger
LaTeX files.

-- 
Ralf

  reply	other threads:[~2004-10-03 13:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-03  1:19 [cs-usenet@arcor.de: tex-mode: too many _ (underscores) interpreted as subscripts] Richard Stallman
2004-10-03 13:52 ` Ralf Angeli [this message]
2004-10-03 19:21   ` Stefan
2004-10-03 19:53   ` Stefan
2004-10-04 15:19   ` Richard Stallman
2004-10-05  9:56     ` Ralf Angeli
2004-10-05 10:16     ` Ralf Angeli
2004-10-06 17:10       ` Richard Stallman
2004-10-07  9:08         ` Ralf Angeli
2004-10-08 16:05           ` Richard Stallman
2004-10-08 16:33             ` Ralf Angeli
2004-10-08 18:49               ` David Kastrup
2004-10-09 15:43                 ` Richard Stallman

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='cjp02u$236$1@sea.gmane.org' \
    --to=angeli@iwi.uni-sb.de \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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