From 38035d16f502e46fac8ff2451219410a87edf7e9 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 10 Jul 2019 20:28:04 +0000 Subject: codeanatomy (10jul19) git-svn-id: svn://tug.org/texlive/trunk@51596 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/codeanatomy/codeanatomy.sty | 126 +++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/codeanatomy/codeanatomy.sty (limited to 'Master/texmf-dist/tex/latex/codeanatomy/codeanatomy.sty') diff --git a/Master/texmf-dist/tex/latex/codeanatomy/codeanatomy.sty b/Master/texmf-dist/tex/latex/codeanatomy/codeanatomy.sty new file mode 100644 index 00000000000..f90479793fa --- /dev/null +++ b/Master/texmf-dist/tex/latex/codeanatomy/codeanatomy.sty @@ -0,0 +1,126 @@ +%% +%% This is file `codeanatomy.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% codeanatomy.dtx (with options: `package') +%% +\NeedsTeXFormat{LaTeX2e}[2018/12/01] +\ProvidesPackage{codeanatomy}[2019/07/10 v0.1-Alpha draw Code Anatomy] +\RequirePackage{expl3} +\RequirePackage{xparse} +\RequirePackage[rgb]{xcolor} +\RequirePackage{tikz} +\usetikzlibrary{ + tikzmark + ,fit + ,arrows.meta + ,bending + ,shapes + ,chains + ,backgrounds + ,scopes + ,decorations + ,decorations.pathmorphing +} + +\definecolor{annotationcolor}{rgb}{0,0.50002,1} % Blue +\colorlet{bgcmdcolor}{gray} % Grey +\tikzset{anatomy/.style={% + anchor=south west,% + inner sep=0,% + align=left,% + font=\ttfamily + } +} +\tikzset{code part/.style={% + rectangle,% + draw=annotationcolor,% + align=left,% + minimum height=1.175em,% + inner sep=1.75pt,% + outer sep=0.1pt,% + font=\ttfamily + } +} +\tikzset{fit extrem/.style={% + rectangle,% + draw=annotationcolor,% + align=left,% + minimum height=1.175em,% + inner sep=1.75pt,% + outer sep=0.1pt,% + font=\ttfamily + } +} +\tikzset{annotation/.style={% + preaction={ + draw=white,% + line width=3.5pt,% + arrows={-Triangle Cap[]},% + },% + draw=annotationcolor,% + arrows={-Latex[% + round,% + color=annotationcolor] + } + } +} +\tikzset{code annotation/.style={% + inner sep=2pt,% + text=annotationcolor,% + align=center,% + font=\sffamily\small + } +} +\tikzset{code grid debug/.style={% + step=1.0,% + draw=gray!20,% + very thin,% + on background layer + } +} +\NewDocumentCommand{\codeBlock}{m}% + {\node(code) [anatomy] at (0,0) {#1};} +\NewDocumentCommand{\cPart}{mm} % + {\tikzmarknode[code part]{#1}{#2}} +\NewDocumentCommand{\iPart}{mm} % + {\tikzmarknode[code part,draw=none,inner sep=0.75pt]{#1}{#2}} +\NewDocumentCommand{\mtPoint}{m} + {\tikzmarknode{#1}{\phantom{\rule[1.8ex]{0.1ex}{0.1ex}}}} +\NewDocumentCommand{\hmtPoint}{m} + {\tikzmarknode{#1}{\phantom{\rule[2.5ex]{0.1ex}{0.1ex}}}} +\NewDocumentCommand{\mbPoint}{m} + {\tikzmarknode{#1}{\phantom{\rule[-0.55ex]{0.1ex}{0.1ex}}}} +\NewDocumentCommand{\dmbPoint}{m} + {\tikzmarknode{#1}{\phantom{\rule[-2ex]{0.1ex}{0.1ex}}}} +\NewDocumentCommand{\extremPoint}{m O{0ex} O{0.1ex} O{} } + {\tikzmarknode[#4]{#1}{\phantom{\rule[#2]{#3}{0.1ex}}}} +\NewDocumentCommand{\fitExtrem}{mm} + {\node(#1)[fit extrem,fit={#2}]{};} +\NewDocumentCommand{\bgcode}{m}{\textcolor{bgcmdcolor}{#1}} +\NewDocumentCommand{\ptab}{}{\phantom{hhhh}} +\NewDocumentCommand{\phspace}{}{\phantom{h}} +\NewDocumentCommand{\codeAnnotation}{m r() m } % +{ + \node(#1)[code annotation] at (#2) {#3} ; +} +%% Copyright (C) 2008-2019 by +%% ME +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% https://www.latex-project.org/lppl.txt +%% +%% +%% This work consists of the files codeanatomy.dtx, +%% codeanatomy.ins, +%% and the derived files codeanatomy.pdf, +%% codeanatomy.sty. +%% +%% +%% End of file `codeanatomy.sty'. -- cgit v1.2.3