Skip to content

Commit

Permalink
fix(syntax): highlight pycode inside tikz
Browse files Browse the repository at this point in the history
refer: #1563
  • Loading branch information
lervag committed Feb 19, 2025
1 parent 10c6c16 commit 29fa6c1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/vimtex/syntax/p/tikz.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"

function! vimtex#syntax#p#tikz#load(cfg) abort " {{{1
syntax cluster texClusterTikz contains=texCmdTikz,texTikzEnvBgn,texTikzSemicolon,texTikzDraw,texTikzCycle,texCmd,texGroup,texComment
syntax cluster texClusterTikz contains=texCmdTikz,texTikzEnvBgn,texTikzSemicolon,texTikzDraw,texTikzCycle,texCmd,texGroup,texComment,texPythontexZone
syntax cluster texClusterTikzset contains=texTikzsetArg,texMathZoneLI,texMathZoneTI,texTypeSize,@texClusterOpt

syntax match texCmdTikzset "\\tikzset\>"
Expand Down
20 changes: 20 additions & 0 deletions test/test-syntax/test-tikz-python.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
\documentclass{article}

\usepackage{pythontex}
\usepackage{tikz}

\begin{document}

\begin{pycode}
print(r'This is python.')
\end{pycode}

\begin{tikzpicture}

\begin{pycode}
print(r'\node {This is python};')
\end{pycode}

\end{tikzpicture}

\end{document}

0 comments on commit 29fa6c1

Please sign in to comment.