[Top][All Lists]

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

a function that converts expression1/expression2 to \frac{expression1}{e

From: Uwe Brauer
Subject: a function that converts expression1/expression2 to \frac{expression1}{expression2}
Date: Wed, 29 Dec 2021 08:22:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)


This has annoyed me for years, honestly.

I sometimes receive latex files, with constructions like this

In fact, if $6/5<\gamma<2$, there exists a solution
  \rho(t, x)=\left\{
      {\left[\frac{K \gamma}{4 \pi 
\kappa(\gamma-1)}\right]^{1/\left(2-\gamma^{\prime}\right)} u(|x|)^{1 
/(\gamma-1)}} & \text { for } 0 \leqq|x| \leqq R \\
      0 & \text { for } R<|x|

What annoys me is the use of 6/5 instead of \frac{5}{6} (I know
sometimes it is even advised to use it).

But in general I want \frac

So I have the following function

(defun my-change-frac ()                
  "Changes stuff like 1/2 to \frac{1}{2}."
  (query-replace-regexp "\\(\\<[0-9]*\\)\\([\\/]\\)\\([0-9]*\\>\\)" 

It covers the 6/5 case but not, for example,

Does anybody have an idea?
In general shouldn't auctex have such a function?


Uwe Brauer

Attachment: smime.p7s
Description: S/MIME cryptographic signature

reply via email to

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