From e485beb757ea16546ad127f4ea145deffbc9e143 Mon Sep 17 00:00:00 2001 From: Jacob Zimmerman Date: Wed, 12 Apr 2017 00:55:16 -0400 Subject: [PATCH 1/3] Allow for \[ ... \] delimited math block --- syntax/pandoc.vim | 1 + tests/latex.pdc | 3 +++ 2 files changed, 4 insertions(+) diff --git a/syntax/pandoc.vim b/syntax/pandoc.vim index 0970d49..eed5fc5 100644 --- a/syntax/pandoc.vim +++ b/syntax/pandoc.vim @@ -222,6 +222,7 @@ syn region pandocLaTeXInlineMath start=/\\\@ Date: Wed, 12 Apr 2017 00:55:48 -0400 Subject: [PATCH 2/3] Correct how \( ... \) math is handled The previous regex had been copy/pasted from the regex for '$'. It was doing special things to try to guess if the '$' was being used for a monetary value. It's unnecessary to do this for \(\). --- syntax/pandoc.vim | 2 +- tests/latex.pdc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/syntax/pandoc.vim b/syntax/pandoc.vim index eed5fc5..c964e5e 100644 --- a/syntax/pandoc.vim +++ b/syntax/pandoc.vim @@ -218,7 +218,7 @@ call s:WithConceal('html_c_e', 'syn match pandocHTMLCommentEnd /-->/ contained', unlet b:current_syntax syn include @LATEX syntax/tex.vim syn region pandocLaTeXInlineMath start=/\v\\@ Date: Wed, 12 Apr 2017 00:58:49 -0400 Subject: [PATCH 3/3] Allow LaTeX highlighting in more places --- syntax/pandoc.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntax/pandoc.vim b/syntax/pandoc.vim index c964e5e..f932a74 100644 --- a/syntax/pandoc.vim +++ b/syntax/pandoc.vim @@ -239,7 +239,7 @@ syn match pandocTitleBlockTitle /\%^%.*\n/ contained containedin=pandocTitleBloc "}}} " Blockquotes: {{{2 " -syn match pandocBlockQuote /^\s\{,3}>.*\n\(.*\n\@1.*\n\(.*\n\@1/ contained containedin=pandocEmphasis,pandocStrong,pandocPCite,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocUListItem,pandocNoFormatted " }}} @@ -416,7 +416,7 @@ call s:WithConceal("footnote", 'syn match pandocFootnoteDefHead /\^\[/ contained call s:WithConceal("footnote", 'syn match pandocFootnoteDefTail /\]/ contained containedin=pandocFootnoteDef', 'conceal') " regular footnotes -syn region pandocFootnoteBlock start=/\[\^.\{-}\]:\s*\n*/ end=/^\n^\s\@!/ contains=pandocReferenceLabel,pandocReferenceURL,pandocLatex,pandocPCite,pandocCiteKey,pandocStrong,pandocEmphasis,pandocNoFormatted,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocEnDash,pandocEmDash,pandocNewLine,pandocStrongEmphasis,pandocEllipses,pandocBeginQuote,pandocEndQuote,@Spell skipnl +syn region pandocFootnoteBlock start=/\[\^.\{-}\]:\s*\n*/ end=/^\n^\s\@!/ contains=pandocReferenceLabel,pandocReferenceURL,pandocLatex,pandocPCite,pandocCiteKey,pandocStrong,pandocEmphasis,pandocNoFormatted,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocEnDash,pandocEmDash,pandocNewLine,pandocStrongEmphasis,pandocEllipses,pandocBeginQuote,pandocEndQuote,pandocLaTeXInlineMath,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXRegion,@Spell skipnl syn match pandocFootnoteBlockSeparator /:/ contained containedin=pandocFootnoteBlock syn match pandocFootnoteID /\[\^.\{-}\]/ contained containedin=pandocFootnoteBlock call s:WithConceal("footnote", 'syn match pandocFootnoteIDHead /\[\^/ contained containedin=pandocFootnoteID', 'conceal cchar='.s:cchars["footnote"])