Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE language SYSTEM "language.dtd">
- <language name="ConTeXt" version="1.02" section="Markup" kateversion="2.3" extensions="*.mkii;*.mkiv" mimetype="text/x-tex" casesensitive="1"
- author="Michael Krauss ([email protected])" license="LGPL" >
- <!-- I modified it based on the LaTeX highlighting file to (1) allow spell-checking only in text sections and (2) show section* headings in bold. I prefer to use the extension, .context to prevent confusing the text editor. You may want to change that, above. -->
- <highlighting>
- <contexts>
- <!-- Normal text -->
- <context name="Normal Text" attribute="Normal Text" lineEndContext="#stay">
- <RegExpr String="\\setup" attribute="Structure" context="FindSetup" />
- <RegExpr String="\\start" attribute="Environment" context="FindStart" beginRegion="block"/>
- <RegExpr String="\\stop" attribute="Environment" context="FindStop" endRegion="block"/>
- <RegExpr String="\\type" attribute="Keyword" context="FindVerbatimCom"/>
- <RegExpr String="\\(part|chapter|section|subsection|subsubsection|title|subject|subsubject|subsubsubject)" attribute="Structure" context="Sectioning"/>
- <DetectChar char="$" attribute="Math" context="MathModeTeX" beginRegion="mathMode" />
- <RegExpr String="\\(matNormal Texthematics|math)" attribute="Keyword" context="FindMathConTeXt" beginRegion="mathMode"/>
- <!-- Recognize quoted symbols -->
- <RegExpr String="\\[^a-zA-Z]" attribute="Keyword" context="#stay" />
- <DetectChar char="%" attribute="Comment" context="Comment"/>
- <DetectChar char="\" attribute="Keyword" context="Command"/>
- </context>
- <!-- LaTeX sectioning commands -->
- <context name="Sectioning" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
- <RegExpr String="\[[^\]]*\]" attribute="Normal Text" context="#stay"/>
- <DetectChar char=" " attribute="Normal Text" context="#stay"/>
- <DetectChar char="{" attribute="Normal Text" context="SectioningInside"/>
- <DetectChar char="}" attribute="Normal Text" context="#pop"/>
- <DetectChar char="%" attribute="Comment" context="Comment"/>
- </context>
- <context name="SectioningInside" attribute="Structure Text" lineEndContext="#stay">
- <DetectChar char="{" attribute="Normal Text" context="SectioningInside"/>
- <DetectChar char="}" attribute="Normal Text" context="#pop"/>
- <StringDetect String="\(" attribute="Structure Math" context="SectioningMathMode" />
- <DetectChar char="\" attribute="Structure Keyword" context="SectioningContrSeq"/>
- <DetectChar char="$" attribute="Structure Math" context="SectioningMathMode" />
- <DetectChar char="%" attribute="Comment" context="Comment"/>
- <DetectChar char="×" attribute="Bullet" context="#stay"/>
- </context>
- <context name="SectioningContrSeq" attribute="Keyword" lineEndContext="#pop">
- <DetectChar char="×" attribute="Bullet" context="#stay"/>
- <RegExpr String="[a-zA-Z]+(\+?|\*{0,3})" attribute="Structure Keyword" context="#pop"/>
- <RegExpr String="[^a-zA-Z]" attribute="Structure Keyword" context="#pop" />
- </context>
- <context name="SectioningMathMode" attribute="Structure Math" lineEndContext="#stay">
- <StringDetect String="$$" attribute="Error" context="#stay" />
- <DetectChar char="$" attribute="Structure Math" context="#pop" />
- <Detect2Chars char="\" char1=")" attribute="Structure Math" context="#pop" />
- <Detect2Chars char="\" char1="]" attribute="Error" context="#stay" />
- <DetectChar char="\" attribute="Structure Keyword Mathmode" context="SectioningMathContrSeq"/>
- <DetectChar char="%" attribute="Comment" context="Comment"/>
- <DetectChar char="×" attribute="Bullet" context="#stay"/>
- </context>
- <context name="SectioningMathContrSeq" attribute="Structure Keyword Mathmode" lineEndContext="#pop">
- <DetectChar char="×" attribute="Bullet" context="#stay"/>
- <RegExpr String="[a-zA-Z]+\*?" attribute="Structure Keyword Mathmode" context="#pop"/>
- <RegExpr String="[^a-zA-Z]" attribute="Structure Keyword Mathmode" context="#pop" />
- </context>
- <!-- ConTeXt find setup commands -->
- <context name="FindSetup" attribute="Structure" lineEndContext="#stay" fallthroughContext="#pop" fallthrough="true">
- <DetectChar char="[" attribute="Normal Text" context="Parameter"/>
- <RegExpr String="[a-zA-Z]+" attribute="Structure" context="#stay"/>
- </context>
- <context name="ParameterList" attribute="Keyword" lineEndContext="#stay">
- <Detect2Chars char="]" char1="[" attribute="Normal Text" context="#stay"/>
- </context>
- <!-- ConTeXt scan parameter -->
- <context name="Parameter" attribute="Parameter" lineEndContext="#stay">
- <DetectChar char="[" attribute="Normal Text" context="Parameter"/>
- <DetectChar char="]" attribute="Normal Text" context="#pop"/>
- </context>
- <!-- ConTeXt find start of environment -->
- <context name="FindStart" attribute="Environment" lineEndContext="#pop" fallthroughContext="#pop#pop" fallthrough="true">
- <RegExpr String="typing(?![a-zA-Z])" attribute="Environment" context="VerbatimEnv"/>
- <RegExpr String="formula(?![a-zA-Z])" attribute="Environment" context="MathModeEnvConTeXt" beginRegion="mathMode"/>
- <DetectChar char="[" attribute="Normal Text" context="Parameter"/>
- <RegExpr String="[a-zA-Z]+" attribute="Environment" context="#stay"/>
- </context>
- <!-- ConTeXt find stop of environment -->
- <context name="FindStop" attribute="Environment" lineEndContext="#pop">
- <RegExpr String="[^a-zA-Z]" attribute="Normal Text" context="#pop"/>
- </context>
- <!-- ConTeXt verbatim environment -->
- <context name="VerbatimEnv" attribute="Verbatim" lineEndContext="#stay">
- <RegExpr String="\\stoptyping(?![a-zA-z])" attribute="Environment" context="#pop#pop" endRegion="block"/>
- </context>
- <!-- ConTeXt ordinary command -->
- <context name="Command" attribute="Keyword" lineEndContext="#pop" fallthroughContext="#pop" fallthrough="true">
- <DetectChar char="%" context="Comment"/>
- <DetectChar char="{" attribute="Normal Text" context="Argument"/>
- <DetectChar char="[" attribute="Normal Text" context="Parameter"/>
- <RegExpr String="[a-zA-Z]+" attribute="Keyword" context="#stay"/>
- </context>
- <!-- ConTeXt command argument -->
- <context name="Argument" attribute="Normal Text" lineEndContext="#stay">
- <RegExpr String="\\setup" attribute="Structure" context="FindSetup" />
- <RegExpr String="\\start" attribute="Environment" context="FindStart" beginRegion="block"/>
- <RegExpr String="\\stop" attribute="Environment" context="FindStop" endRegion="block"/>
- <RegExpr String="\\type" attribute="Keyword" context="FindVerbatimCom"/>
- <DetectChar char="%" attribute="Comment" context="Comment"/>
- <DetectChar char="\" attribute="Keyword" context="Command"/>
- <DetectChar char="}" attribute="Normal Text" context="#pop"/>
- <DetectChar char="{" attribute="Normal Text" context="Argument" />
- </context>
- <!-- ConTeXt found verbatim command -->
- <context name="FindVerbatimCom" attribute="Normal Text" lineEndContext="#stay">
- <DetectChar char="{" attribute="Normal Text" context="VerbatimCom"/>
- <RegExpr String="\S" attribute="Normal Text" context="#pop"/>
- </context>
- <!-- ConTeXt verbatim command -->
- <context name="VerbatimCom" attribute="Verbatim" lineEndContext="#stay">
- <DetectChar char="}" attribute="Normal Text" context="#pop#pop"/>
- </context>
- <!-- ConTeXt comment -->
- <context name="Comment" attribute="Comment" lineEndContext="#pop"/>
- <!-- ConTeXt find math ConTeXt style -->
- <context name="FindMathConTeXt" attribute="Normal Text" lineEndContext="#stay">
- <DetectChar char="{" attribute="Normal Text" context="MathModeConTeXt"/>
- <RegExpr String="\S" attribute="Normal Text" context="#pop"/>
- </context>
- <!-- ConTeXt inline math TeX style -->
- <context name="MathModeTeX" attribute="Math" lineEndContext="#stay">
- <DetectChar char="$" attribute="Math" context="#pop" endRegion="mathMode"/>
- <RegExpr String="\\[^a-zA-Z]" attribute="Keyword Mathmode" context="#stay" />
- <DetectChar char="\" attribute="Keyword Mathmode" context="MathCommand"/>
- </context>
- <!-- ConteXt inline math ConTeXt style -->
- <context name="MathModeConTeXt" attribute="Math" lineEndContext="#stay">
- <DetectChar char="}" attribute="Math" context="#pop#pop" endRegion="mathMode"/>
- </context>
- <!-- ConTeXt math environment ConTeXt style -->
- <context name="MathModeEnvConTeXt" attribute="Math" lineEndContext="#stay">
- <RegExpr String="(\\stopformula$|\\stopformula\s)" attribute="Environment" context="#pop#pop" endRegion="mathMode"/>
- <RegExpr String="\\[^a-zA-Z]" attribute="Keyword Mathmode" context="#stay" />
- <DetectChar char="\" attribute="Keyword Mathmode" context="MathCommand"/>
- </context>
- <!-- ConTeXt command in math mode -->
- <context name="MathCommand" attribute="Keyword Mathmode" lineEndContext="#pop" fallthroughContext="#pop" fallthrough="true">
- <DetectChar char="%" context="Comment"/>
- <RegExpr String="[a-zA-Z]+" attribute="Keyword Mathmode" context="#stay"/>
- <DetectChar char="{" attribute="Normal Text" context="MathArgument"/>
- <DetectChar char="[" attribute="Normal Text" context="Parameter"/>
- </context>
- <!-- ConTeXt math argument -->
- <context name="MathArgument" attribute="Math" lineEndContext="#stay">
- <DetectChar char="%" attribute="Comment" context="Comment"/>
- <DetectChar char="\" attribute="Keyword" context="MathCommand"/>
- <DetectChar char="}" attribute="Normal Text" context="#pop"/>
- <DetectChar char="{" attribute="Normal Text" context="MathArgument" />
- </context>
- </contexts>
- <itemDatas>
- <itemData name="Normal Text" defStyleNum="dsNormal"/>
- <itemData name="Keyword" defStyleNum="dsNormal" color="#800000" selColor="#60FFFF" bold="0" italic="0" spellChecking="false"/>
- <itemData name="Comment" defStyleNum="dsComment" spellChecking="false"/>
- <itemData name="Parameter" defStyleNum="dsDataType" color="#F0A000" selColor="#8090FF" spellChecking="false"/>
- <itemData name="Error" defStyleNum="dsAlert" spellChecking="false"/>
- <itemData name="Math" defStyleNum="dsNormal" color="#00A000" selColor="#FF40FF" bold="0" italic="0" spellChecking="false"/>
- <itemData name="Structure" defStyleNum="dsNormal" color="#F00000" selColor="#80FFD0" bold="0" italic="0" spellChecking="false"/>
- <itemData name="Keyword Mathmode" defStyleNum="dsNormal" color="#606000" selColor="#FFD0FF" bold="0" italic="0" spellChecking="false"/>
- <itemData name="Environment" defStyleNum="dsNormal" color="#0000D0" selColor="#FFFF90" bold="0" italic="0" spellChecking="false"/>
- <itemData name="Verbatim" defStyleNum="dsNormal" color="#a08000" selColor="#80D0FF" bold="0" italic="0"/>
- <itemData name="Region Marker" defStyleNum="dsRegionMarker" />
- <itemData name="Bullet" defStyleNum="dsNormal" color="#FF00C4" bold="1" underline="1" spellChecking="false"/>
- <itemData name="Alert" defStyleNum="dsAlert" spellChecking="false"/>
- <itemData name="Structure Text" defStyleNum="dsNormal" color="#000000" selColor="#FFFFFF" bold="1" italic="0"/>
- <itemData name="Structure Keyword" defStyleNum="dsNormal" color="#800000" selColor="#60FFFF" bold="1" italic="0" spellChecking="false"/>
- <itemData name="Structure Math" defStyleNum="dsNormal" color="#00A000" selColor="#FF40FF" bold="1" italic="0"/>
- <itemData name="Structure Keyword Mathmode" defStyleNum="dsNormal" color="#606000" selColor="#FFD0FF" bold="1" italic="0" spellChecking="false"/>
- </itemDatas>
- </highlighting>
- <general>
- <keywords weakDeliminator="\" wordWrapDeliminator=",{}[]"/>
- <comments>
- <comment name="singleLine" start="%" />
- </comments>
- </general>
- </language>
- <!--
- // kate: space-indent on; indent-width 2; replace-tabs on;
- -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement