unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Convert some Latex expressions in Emacs.
@ 2022-05-16  3:25 Hongyi Zhao
  2022-05-16  4:49 ` Emanuel Berg
  2022-05-17  0:02 ` Michael Heerdegen
  0 siblings, 2 replies; 12+ messages in thread
From: Hongyi Zhao @ 2022-05-16  3:25 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1584 bytes --]

Currently, I've some LaTeX code OCRed into Emacs from a book, as shown
below and in the attached file:

```
\begin{array}{l}G_{192}^{1} \\ P^{12}=E ; Q^{4}=E ; R^{4}=E ; S^{8}=E
; Q^{2}=R^{2} ; S^{2}=P^{6} Q^{2} R ; Q P=P^{7} Q^{2} R ; Q
P^{3}=P^{3} Q \\ R P=P^{10} Q R ; R Q=P^{6} Q^{3} R ; S P=P^{2} R S ;
S Q=P^{3} Q^{3} R S ; S R=R S \\ C_{1}=E ; C_{2}=P^{3} Q^{2} ;
C_{3}=P^{6} ; C_{4}=P^{9} Q^{2} ; C_{5}=P^{6} R, Q^{3}, P^{9} Q^{3} R,
Q^{2} R, P^{6} Q, P^{3} Q R \\ C_{6}=P^{9} Q^{2} R, P^{3} Q, Q R,
P^{3} R, P^{9} Q^{3}, P^{6} Q^{3} R ; C_{7}=P^{11} Q, P^{8} Q^{2},
P^{5} Q^{2} R, P^{2} Q^{3} R, P^{7} R, P^{4} Q^{2}, P^{4} Q R, P Q^{3}
;\end{array}
```

Although there is no problem with the LaTeX code itself, I want to
tweak these code as follows, so that it can be used as a GAP [1]
input:

1. Remove the following stuff: `\begin{array}{l}', `\end{array}'.
2. For each word, remove '{' and '}', spaces, and add * between two
characters of it, i.e., `P^{5} Q^{2} R' should be changed to
`P^5*Q^2*R'.
3. Change `C_{digit}` to `Cdigit`, i.e., `C_{5}=P^{6} R' should be
changed to `C5=P^6*R'.
4. Change the first `\\' to new line.
5. Change the first appear of `\\' before the first `C_{digit}` to new line.
6. Change other `\\' to comma.
7. Change `;' to comma.

Any concise tips and tricks to achieve this goal?

[1] https://www.gap-system.org/

Regards
-- 
Assoc. Prof. Hongsheng Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
No. 473, Quannan West Street, Xindu District, Xingtai, Hebei province

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 151111 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-05-18  0:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-16  3:25 Convert some Latex expressions in Emacs Hongyi Zhao
2022-05-16  4:49 ` Emanuel Berg
2022-05-17  0:02 ` Michael Heerdegen
2022-05-17  2:12   ` Hongyi Zhao
2022-05-17  2:22     ` Emanuel Berg
2022-05-17  3:23     ` Michael Heerdegen
2022-05-17  3:38       ` Michael Heerdegen
2022-05-17  3:44       ` Hongyi Zhao
2022-05-17  4:46         ` Emanuel Berg
2022-05-18  0:25           ` Hongyi Zhao
2022-05-17 23:45         ` Michael Heerdegen
2022-05-18  0:23           ` Hongyi Zhao

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