我正在使用laTex文件,我需要刪除兩個$之間的所有內容,包括換行符,並且只保留英文文本。
我使用這樣的命令處理的文件:
find "." -name "*.tex" | xargs perl -pi -e 's/\$[^\$].*?\$/ /g' *
實施例:
Then use the naturality formula
$t_{G^{n-1}M} G^{i+1} (\epsilon_{G^{n-i}M})
= G^{i+1} (\epsilon_{G^{n-i}M}) t_{G^n M}$ on the left-hand side.
輸出:
:
Then use the naturality formula
on the left-hand side.
從文件的另一示例例如:
\begin{itemize}
\item $M$ is atomic and finitely generated;
\item $M$ is cancellative;
\item $(M, \le_L)$ and $(M, \le_R)$ are lattices;
\item there exists an element $\Delta \in M$, called {\it Garside element}, such that the set
$L(\Delta)= \{ x \in M; x\le_L \Delta\}$ generates $M$ and is equal to $R(\Delta)= \{ x\in M;
x\le_R \Delta\}$.
\end{itemize}
OUTPUT:
\begin{itemize}
\item is atomic and finitely generated;
\item is cancellative;
\item and are lattices;
\item there exists an element , called {\it Garside element}, such that the set
generates and is equal to $R(\Delta)= \{ x\in M;
x\le_R \Delta\}$.
\end{itemize}
如果你可以看到($ R(\德爾塔)= {在一M×\; x \ le_R \ Delta} $。)不能被刪除!
實施例2從不同的文件,則輸入相同輸出一切都沒有改變:
Using the fact that is atomic and that $L(\Delta)=
\{x \in M; x \le_L \Delta\} M \pi_L(a) \neq 1 a \neq
1 k \partial_L^k(a)=1 k$ be the
*「它可以工作,但不適用於我在文件中的所有情況」*請給出一些示例不能正常工作的情況以及要處理的簡要示例文檔。要求我們在沒有看到任何輸入的情況下編寫軟件是不公平的。 – Borodin
我編輯回你的正則表達式/命令作爲我相關的信息的問題。我也更新了我的回答 –