<div class="gmail_quote"><div>On 24/01/2012, at 20.54, Dirk Günther wrote:</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I use the LaTeX grammar and I have defined my own shortverb command [...] What should I do that |c| in \tabular{...} is not defined as verbatim?</blockquote>
<div><br></div><div>As Allan suggested, I think that you need to have a rule in the LaTeX grammar that will match the column specification part of the tabular environment. Instead of writing a completely new rule, I tried changing the relevant existing rule, copied below. The only difference is in the begin match. I also tried adding your rule for scoping anything between pipes as verbatim, and this change to the tabular rules seems to do what you want - anything in the column spec is not scoped as verbatim. Hope that helps!</div>
<div><br></div><div>-Daniel Grady</div><div><br></div><div>{<span class="Apple-tab-span" style="white-space:pre"> </span>begin = '(?x)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(?:\s*)<span class="Apple-tab-span" style="white-space:pre"> </span># Optional whitespace</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>((\\)begin)<span class="Apple-tab-span" style="white-space:pre"> </span># Marker - Function</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(\{)<span class="Apple-tab-span" style="white-space:pre"> </span># Open Bracket</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>(array|tabular[xy*]?)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(\})<span class="Apple-tab-span" style="white-space:pre"> </span># Close Bracket</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>(\s*\{.*\})?<span class="Apple-tab-span" style="white-space:pre"> </span># Column specification</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(\s*\n)?<span class="Apple-tab-span" style="white-space:pre"> </span># Match to end of line absent of content</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>captures = {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>1 = { name = 'support.function.be.latex'; };</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>2 = { name = 'punctuation.definition.function.latex'; };</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>3 = { name = 'punctuation.definition.arguments.begin.latex'; };</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>4 = { name = 'variable.parameter.function.latex'; };</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>5 = { name = 'punctuation.definition.arguments.end.latex'; };</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>6 = { name = 'variable.columnspec.tabular.latex'; };</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>};</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>contentName = 'meta.data.environment.tabular.latex';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>end = '(?x)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(?:\s*)<span class="Apple-tab-span" style="white-space:pre"> </span># Optional whitespace</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>((\\)end)<span class="Apple-tab-span" style="white-space:pre"> </span># Marker - Function</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(\{)<span class="Apple-tab-span" style="white-space:pre"> </span># Open Bracket</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>(\4)<span class="Apple-tab-span" style="white-space:pre"> </span># Previous capture from begin</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(\})<span class="Apple-tab-span" style="white-space:pre"> </span># Close Bracket</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>(?:\s*\n)?<span class="Apple-tab-span" style="white-space:pre"> </span># Match to end of line absent of content</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>name = 'meta.function.environment.tabular.latex';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>patterns = (</div><div>
<span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>match = '\\';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>name = 'punctuation.definition.table.row.latex';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>},</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>begin = '(?:^|(?<=\\\\))(?!\\\\|\s*\\end\{(?:tabular|array))';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>end = '(?=\\\\|\s*\\end\{(?:tabular|array))';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>name = 'meta.row.environment.tabular.latex';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>patterns = (</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>match = '&';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>name = 'punctuation.definition.table.cell.latex';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>},</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>begin = '(?:^|(?<=&))((?!&|\\\\|$))';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>end = '(?=&|\\\\|\s*\\end\{(?:tabular|array))';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>name = 'meta.cell.environment.tabular.latex';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>patterns = ( { include = '$base'; } );</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>},</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>include = '$base'; },</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>},</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>include = '$base'; },</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>} </div></div>