My objective is to replace math delimiters path $...$
by \(...\)
\documentclass[12pt,a4paper]{article}
\begin{document}
This is a sample text $ \sin\alpha $ and $ \cos\alpha. $
\begin{enumerate}
\item $ \lim\limits_{x\to 0} \frac{\sin x}{x} $
\item $ \tan\alpha=\frac{\sin\alpha}{\cos\alpha} $
\end{enumerate}
\end{document}
Expected output:
\documentclass[12pt,a4paper]{article}
\begin{document}
This is a sample text \( \sin\alpha \) and \( \cos\alpha. \)
\begin{enumerate}
\item \( \lim\limits_{x\to 0} \frac{\sin x}{x} \)
\item \( \tan\alpha=\frac{\sin\alpha}{\cos\alpha} \)
\end{enumerate}
\end{document}
How can we do this in TeXstudio TeX editor?
Best Answer
You can create a macro for that to make the replacement in one click or with a press of the shortcut (Ctrl+Alt+1 in the example).
This approach also takes into account
$$
display math and dollar signs in a text\$
, so that your project won't break in case there are some of them.