@facelessuser
[quote]This is what you need:
{
“name”: “latex_floats”,
“open”: “(\\begin\{(?:table|sidewaystable|figure|sidewaysfigure|algorithm)\})”,
“close”: “(\\end\{(?:table|sidewaystable|figure|sidewaysfigure|algorithm)\})”,
// “open”: “(\begin\{sidewaystable\})”,
// “close”: “(\end\{sidewaystable\})”,
“style”: “default”,
“scope_exclude”: “string”, “comment”],
“language_filter”: “whitelist”,
“language_list”: “LaTeX”],
“enabled”: true
},
[/quote]
Am I correct in assuming that this will not work with nested constructs? E.g.:
\begin{figure}[thb]
\begin{center}
\includegraphics]{Fig_Geometric_Nonlinear_Examples/Roll-up_Dyn/timegeo1.eps}
\end{center}
\end{figure}
I would think that it would be necessary to include an additional captured group in the open pattern, that was searched for in the close pattern. To try and get this to work I’ve been trying to hook up to the ht/xml tag matching. I tried adding the following (copying //HTML, and modifying the ends of the regex):
// LaTeX \begin{(...)} \end{(...)}
{
"name": "latex",
"open": "(\\\\begin\\{)(?=\\w\\:\\-]+(?:(?:\\s+\\w\\-:]+(?:\\s*=\\s*(?:\"^\"]*\"|'^']*'|^>\\s]+))?)*)\\s*\\/?>|\\/\\w\\:\\-]+^>]*\\})",
"close": "(?<=\\\\end\\{)(?:\\w\\:\\-]+(?:(?:\\s+\\w\\-:]+(?:\\s*=\\s*(?:\"^\"]*\"|'^']*'|^>\\s]+))?)*)\\s*\\/?|\\/\\w\\:\\-]+^>]*)(\\})",
"style": "tag",
"scope_exclude": "string", "comment"],
"language_filter": "whitelist",
"language_list": "LaTeX"],
"plugin_library": "bh_modules.tags",
"find_in_sub_search": "only",
"enabled": true
},
and then
"tag_mode": {
"xhtml": "XML", "LaTeX"], ...
But I don’t get anything. I haven’t been able to find info on how to hook up custom tags.