在崇高文本中用没有波浪号的元音替换重音元音的片段

Snippet to replace accented vowel by vowel without tilde in sublime text

在下面的 LaTeX 包 (sublime text 3) 片段中,每次我输入 a: Space, . (dot), ?, *, #, 在 \label{sec:*****} 部分和 % section ***** (end) 部分被替换为“_”字符。还将大写字母替换为小写字母。这里是片段:

<snippet>
<content><![CDATA[
\section{${1:section name}} % (fold)
\label{sec:${2:${1/\\w+\{(.*?)\}|\(.)|(\w+)|([^\w\]+)/(?4:_:\L)/g}}}
${0:$TM_SELECTED_TEXT}
% section  (end)
]]></content>
    <tabTrigger>sec</tabTrigger>
    <scope>text.tex.latex</scope>
    <description>Section</description>
</snippet>

我的问题是:我该如何改变?用不带波浪号的元音替换重音元音的片段,即 如果我使用代码片段,结果是:

\section{acción además menú aquí acné} % (fold)
\label{sec:acción_además_menú_aquí_acné}

% section acción_además_menú_aquí_acné (end)

但我想得到以下信息:

\section{acción además menú aquí acné} % (fold)
\label{sec:accion_ademas_menu_aqui_acne}

% section accion_ademas_menu_aqui_acne (end)

您可以通过手动指定要查找的字符以及用什么来替换它们来完成此操作。这是因为不幸的是,ST 似乎不支持 POSIX character equivalents.

使用以下代码段:

<snippet>
<content><![CDATA[
\section{${1:section name}} % (fold)
\label{sec:${2:${1/(?i:(á)|([éę])|(í)|(ó)|(ú)|(ń))|\\w+\{(.*?)\}|\(.)|(\w)|([^\w\]+)/(?{10}_:\L(?1a:)(?2e:)(?3i:)(?4o:)(?5u:)(?6n:))/g}}}
${0:$TM_SELECTED_TEXT}
% section  (end)
]]></content>
    <tabTrigger>sec</tabTrigger>
    <scope>text.tex.latex</scope>
    <description>Section</description>
</snippet>
例如,

acción además menú aquí acné ńę 中键入 sec Tab 和 typing/pasting 将导致:

\section{acción además menú aquí acné_ńę} % (fold)
\label{sec:accion_ademas_menu_aqui_acne_ne}

% section accion_ademas_menu_aqui_acne_ne (end)

有关替换格式语法的详细信息,请参阅http://www.boost.org/doc/libs/1_56_0/libs/regex/doc/html/boost_regex/format/boost_format_syntax.html