[Top][All Lists]

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

Re: [AUCTeX-devel] change: documents with $$ to \begin{documents}

From: Lars Madsen
Subject: Re: [AUCTeX-devel] change: documents with $$ to \begin{documents}
Date: Mon, 5 Jan 2015 08:28:19 +0000

I hacked together this one at some point

(defun fix-double-dollar-to-eqstar ()
 (defun fix-double-dollar-to-eqstar ()
  (let (
        (start (point)) 
        (case-fold-search nil)
      (while (re-search-forward 
              nil t
        (catch 'continue
          (when (TeX-in-comment)
            (goto-char (match-end 0))
            (throw 'continue nil)
            (replace-match (concat 
                            (regexp-quote TeX-esc)
                            (regexp-quote TeX-esc)
            ) ;; end catch
        ) ;;  end while

Since people also tend to use 

$$ ... $$ 

it might be an idea to look out for those as well have put then into a more 
readable form.

I have a macro that can do that as well, though need further testing.

BTW: at one point I got caught by someone writing something like


That *is* valid, but the macro of course does not gard against it.

/Lars Madsen
Institut for Matematik / Department of Mathematics
Aarhus Universitet / Aarhus University
Mere info: / More information:

From: address@hidden address@hidden on behalf of Uwe Brauer address@hidden
Sent: 03 January 2015 23:57
To: auctex-devel
Subject: [AUCTeX-devel] change: documents with $$ to \begin{documents}


Sometimes I receive documents with have basically only
\int f =0
constructions instead of say
\begin{displaymath} or {equation*} etc.

Anybody has a idea how to change the evil $$ to true latex constructs by
using sophisticated regexp?


Uwe Brauer

[1]  happy new year

reply via email to

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