All Questions
153
questions
1
vote
3
answers
83
views
Detect (and replace) math symbols in a string
TL;DR; How can I detect the presence of math symbols in a string?
I collect a lot of text data from others, through sources like google forms or directly in spreadsheets. Often the individuals doing ...
0
votes
1
answer
63
views
Nested parentheses using C# Regex [duplicate]
I want to extract fractions from latex text using Regex patterns.
My code:
string inputText = "frac{frac{1/2}}frac{frac{255/7890}/2}frac{frac{frac{ZZ/99}/66}/33}frac{frac{66/77}/frac{88/99}}"...
1
vote
1
answer
54
views
Find all theorems in a long LaTeX document
I've got a LaTeX document which looks something like this:
Now, we go onto the following theorem:
\theorem{$\sqrt{2}$ is irrational.}{Blah blah blah...}
\remark{This proof is often attributed to ...
0
votes
2
answers
33
views
Parse latex macro trough sed
General overview
The goal is to match the content of all \foo occurrences to transform it into <p>content of \foo</p>.
The details
The goal is to match some LaTeX macro’s content from it ...
1
vote
1
answer
185
views
Converting adoc to markdown while preserving latex style math equations
I have a group of adoc documents that I'm converting to markdown. For most of them I've been able to convert them with:
asciidoc -b docbook -o temp.xml <infile>
pandoc -f docbook -t ...
-2
votes
1
answer
56
views
Regex in Notepad++for sections from latex to markdown
I have many tex files containing something like \chapter{ccc}, \section{sss}, etc. I want to change them to markdown format like # ccc, ## sss, etc.; my minimal demo is as follows:
\chapter{math}
mmm
...
0
votes
0
answers
61
views
LaTeX regex working on RegExr but not in VSCode
I'm trying to match TeX commands like \def and \char in VSCode settings.json with the following regex:
(?<!%.*)(\\\\)(def|char)(\\b|[^[a-z]]|[0-9])
This correctly matches \def and \char but also ...
0
votes
2
answers
372
views
Find and Replace text from same Environments / Commands in Latex
I am using Overleaf to write Latex and I want to easily find and replace particular text from same environments of a Latex file.
example text,
abc xyz \a{} mno
\begin{equation}
\a{}=a+c
\a{}=c+...
0
votes
1
answer
82
views
capture string in one indexed position and move to another indexed position in xml file
I am a Python beginner and want to convert an existing xml file to a LaTeX document. The xml contains a lot of footnotes that sometimes are split - as they did not fit on one page in the original ...
2
votes
2
answers
87
views
How to use VSCode regexp to find all ocurrences of \cite without ~?
I need to find in several files of my thesis all occurrences of any text\cite{...} and change them to any text~\cite{...}. But I don't understand how VSCode search regexp works.
I have tried ^[!~]\...
1
vote
1
answer
402
views
Swift - regex to remove "\\text { and_whatever_is_here }" from string
Swift 5
I am calling an API that returns a string containing LaTex elements. In a perfect world, a lot of the unneeded content would be removed by the API but it is returned and I need to remove it ...
0
votes
1
answer
236
views
Find a regex generic string and replace it with the same string enclosed in parenthesis - Latex and TeXStudio
I have made my BIB file and I am compiling my project using BIBTEX on TeXStudio. In my particular case, I get an error when the reference entry has the month in the following format:
month = jan,
It ...
1
vote
1
answer
109
views
Wrap Latex Equation using custom tag PHP regex
I just want to wrap the Math latex equation using any html tag. The string be like
y = x2 or \(x = \sqrt{y}\) . For all \(y \geq 0\), x is defined. Thus, y is set of all non-negative and real number. ...
1
vote
1
answer
107
views
Find, cut and paste regex in sublimeText3
I have the following in my text file:
53\footnote{Author Name, \textit{Book Title}, p..}
3\footnote{Author Another, \textit{Book Old}, p..}
5-6\footnote{Author Onemore, \textit{Book New}, p..}
I have ...
2
votes
1
answer
81
views
regex to match othermost tags (string pair)
I have a book that was written in Sweave and contains a lot of Latex that I am trying to convert to Rmarkdown. I have managed to write a script that converts most of the Latex to reasonable markdown ...