texlive[73307] Master/texmf-dist: tikz-decofonts (4jan25)

commits+karl at tug.org commits+karl at tug.org
Sat Jan 4 21:49:27 CET 2025


Revision: 73307
          https://tug.org/svn/texlive?view=revision&revision=73307
Author:   karl
Date:     2025-01-04 21:49:27 +0100 (Sat, 04 Jan 2025)
Log Message:
-----------
tikz-decofonts (4jan25)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/tikz-decofonts/tikz-decofonts-doc.pdf
    trunk/Master/texmf-dist/doc/latex/tikz-decofonts/tikz-decofonts-doc.tex
    trunk/Master/texmf-dist/doc/latex/tikz-decofonts/tkzbrushA.tex
    trunk/Master/texmf-dist/tex/latex/tikz-decofonts/tikz-decofonts.sty

Modified: trunk/Master/texmf-dist/doc/latex/tikz-decofonts/tikz-decofonts-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/tikz-decofonts/tikz-decofonts-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tikz-decofonts/tikz-decofonts-doc.tex	2025-01-04 20:49:16 UTC (rev 73306)
+++ trunk/Master/texmf-dist/doc/latex/tikz-decofonts/tikz-decofonts-doc.tex	2025-01-04 20:49:27 UTC (rev 73307)
@@ -3,6 +3,7 @@
 % arara: pdflatex: {shell: no, synctex: no, interaction: batchmode}
 
 \documentclass[11pt,a4paper]{ltxdoc}
+\usepackage{amsmath}
 \usepackage{bera}
 \usepackage{inconsolata}
 \usepackage[T1]{fontenc}
@@ -27,8 +28,8 @@
 \hypersetup{pdfborder=0 0 0}
 \usepackage[margin=2cm]{geometry}
 \setlength{\parindent}{0pt}
-\def\TPversion{0.1.0}
-\def\TPdate{14/10/2024}
+\def\TPversion{0.1.1}
+\def\TPdate{04/01/2025}
 \usepackage{tcolorbox}
 \tcbuselibrary{breakable,skins,hooks,listingsutf8}
 
@@ -76,10 +77,10 @@
 		keywordstyle={\color{violet}},%
 		classoffset=2,%
 		alsoletter={-},%
-		morekeywords={\tkzbrush,\tkzink,\tkzpixl,\tkzpixletter,\tkzpixlquote},%
+		morekeywords={\tkzbrush,\tkzink,\tkzpixl,\tkzpixletter,\tkzpixlquote,\tkzbicolor},%
 		keywordstyle={\color{green!50!black}},%
 		classoffset=3,%
-		morekeywords={color,lines,scale,height,offseth,offsetv,thick,gridcolor,gridafter,nospaceafter,border},%
+		morekeywords={color,lines,scale,height,offseth,offsetv,thick,gridcolor,gridafter,nospaceafter,border,colors,style,intdelta,paralcolors},%
 		keywordstyle={\color{orange}}
 	},%
 	#1
@@ -109,6 +110,10 @@
 	\lstinline{#1}%
 }
 
+\def\sampleformula{$\displaystyle\int_0^1 \dfrac{1+x}{1+x^2}\,\mathrm{d}x$}
+\def\sampletxt{But I must explain to you how all this mistaken idea of denouncing pleasure.}
+\def\samplenum{1500}
+
 \begin{document}
 
 \thispagestyle{empty}
@@ -146,12 +151,13 @@
 \begin{tcblisting}{colframe=lightgray,colback=lightgray!5,listing only}
 %paintbrush effect
 \tkzbrush[color=blue]{DECORATION}
-
 %paintink effect
 \tkzink[color=orange]{DECORATION}
-
 %pixeletter effect
 \tkzpixl[color=violet]{DECORATION}
+%bicolor effect
+\tkzbicolor[colors=blue/red,style=ndiag]{\Huge\sffamily DECORATION}
+\tkzbicolor[colors=teal/orange,style=ellips]{\Huge\sffamily DECORATION}
 \end{tcblisting}
 
 \begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
@@ -166,6 +172,10 @@
 \hfill\tkzpixl[color=violet]{Decoration}
 \end{tcolorbox}
 
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
+\hfill\tkzbicolor[colors=blue/red,style=ndiag]{\Huge\sffamily DECORATION}~~\tkzbicolor[colors=teal/orange,style=ellips]{\Huge\sffamily DECORATION}\hfill~
+\end{tcolorbox}
+
 \vfill~
 
 \hrule
@@ -203,7 +213,7 @@
 \usepackage{tikz-decofonts}
 \end{DemoCode}
 
-Loaded packages are \texttt{tikz}, \texttt{xintexpr}, \texttt{simplekv} and \texttt{xstring}.
+Loaded packages are \texttt{tikz}, \texttt{xintexpr}, \texttt{simplekv}, \texttt{listofitems} and \texttt{xstring}.
 
 Loaded \texttt{tikz.librairies} are \texttt{decorations}, \texttt{decorations.pathreplacing}, \texttt{calc}, \texttt{positioning}, \texttt{bbox}, \texttt{arrows.meta} and \texttt{bending}.
 
@@ -337,8 +347,77 @@
 
 \pagebreak
 
+\subsection{Bicolor effect}
+
+\begin{DemoCode}{listing only}
+%compatible with all fonts and/or sizes
+\tkzbicolor%
+    [colors=...,style=...,intdelta=...]
+    {text}
+
+\tkzbicolor%with paral style
+    [paralcolors=...,style=paral,intdelta=...]
+    {text}
+
+%style = midh/midv/rect/ellips/paral (paral by default)
+%colors = red/blue by default,
+%paralcolors = red/blue/orange/gray by default
+%intdelta = 0.66 by default, percentage of int dim for ellips/rect
+\end{DemoCode}
+
+\begin{DemoCode}{listing only}
+\def\sampleformula{$\displaystyle\int_0^1 \dfrac{1+x}{1+x^2}\,\mathrm{d}x$}
+\def\sampletxt{But I must explain to you how all this mistaken idea of denouncing pleasure.}
+\def\samplenum{1500}
+\end{DemoCode}
+
+\begin{DemoCode}{}
+\tkzbicolor[style=midh]{\sampleformula} 
+or \tkzbicolor[colors=violet/magenta,style=midv]{\sampleformula}
+or \tkzbicolor[colors=darkgray/olive,style=ndiag]{\sampleformula}
+or \tkzbicolor[colors=orange/teal,style=sdiag]{\sampleformula}
+or \tkzbicolor[colors=orange/teal,style=ellips]{\sampleformula}
+or \tkzbicolor[colors=pink/violet,style=rect]{\sampleformula}
+\end{DemoCode}
+
+\begin{DemoCode}{}
+\tkzbicolor[style=midh]{\sampletxt}\par
+\tkzbicolor[colors=violet/magenta,style=midv]{\sampletxt}\par
+\tkzbicolor[colors=darkgray/olive,style=ndiag]{\sampletxt}\par
+\tkzbicolor[colors=orange/teal,style=sdiag]{\sampletxt}\par
+\tkzbicolor[colors=orange/teal,style=ellips]{\sampletxt}\par
+\tkzbicolor[colors=pink/violet,style=rect]{\sampletxt}
+\end{DemoCode}
+
+\begin{DemoCode}{}
+\tkzbicolor[style=midh]{\parbox{2.5cm}{\sampletxt}} 
+\tkzbicolor[colors=violet/gray,style=midv]{\parbox{2.5cm}{\sampletxt}} 
+\tkzbicolor[colors=darkgray/olive,style=ndiag]{\parbox{2.5cm}{\sampletxt}} 
+\tkzbicolor[colors=orange/cyan,style=sdiag]{\parbox{2.5cm}{\sampletxt}} 
+\tkzbicolor[colors=pink/violet,style=ellips]{\parbox{2.5cm}{\sampletxt}} 
+\tkzbicolor[colors=pink/violet,style=ellips,intdelta=0.85]{\parbox{2.5cm}{\sampletxt}} 
+\tkzbicolor[colors=cyan/darkgray,style=rect]{\parbox{2.5cm}{\sampletxt}}
+\end{DemoCode}
+
+\begin{DemoCode}{}
+\tkzbicolor[style=paral]{\parbox{6cm}{\large\sffamily\sampletxt}}
+\end{DemoCode}
+
+\begin{DemoCode}{}
+\tkzbicolor[style=midh]{\samplenum}\par
+\tkzbicolor[colors=violet/magenta,style=midv]{\samplenum}\par
+\tkzbicolor[colors=darkgray/olive,style=ndiag]{\samplenum}\par
+\tkzbicolor[colors=orange/teal,style=sdiag]{\samplenum}\par
+\tkzbicolor[colors=orange/teal,style=ellips]{\samplenum}
+\end{DemoCode}
+
+
+\pagebreak
+
 \section{History}
 
+\texttt{0.1.1: Bicolor effect}
+
 \texttt{0.1.0: Initial version}
 
 \end{document}

Modified: trunk/Master/texmf-dist/doc/latex/tikz-decofonts/tkzbrushA.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/tikz-decofonts/tkzbrushA.tex	2025-01-04 20:49:16 UTC (rev 73306)
+++ trunk/Master/texmf-dist/doc/latex/tikz-decofonts/tkzbrushA.tex	2025-01-04 20:49:27 UTC (rev 73307)
@@ -8,4 +8,4 @@
 
 \tkzbrush[color=red,lines=20,scale=1.5]{CUSTOM TEXT}
 
-\end{document}
+\end{document}
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/tikz-decofonts/tikz-decofonts.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/tikz-decofonts/tikz-decofonts.sty	2025-01-04 20:49:16 UTC (rev 73306)
+++ trunk/Master/texmf-dist/tex/latex/tikz-decofonts/tikz-decofonts.sty	2025-01-04 20:49:27 UTC (rev 73307)
@@ -1,12 +1,13 @@
 % Author          : C. Pierquet
-% licences        : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
+% licences        : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt
 %                 : CC BY-SA 4.0 (https://tex.stackexchange.com/questions/475141/simulating-paintbrush-strokes-in-tikz from user121799)
 %                 :              (https://tex.stackexchange.com/questions/460836/custom-line-cap-to-simulate-inked-line-in-tikz/460842#460842 from user121799)
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tikz-decofonts}[2024/10/14 0.1.0 Custom fonts, made with TikZ, with effects]
+\ProvidesPackage{tikz-decofonts}[2025/01/04 0.1.1 Custom fonts, made with TikZ, with effects]
 
 %------History
+% 0.1.1	Bicolor txt
 % 0.1.0	Initial version
 
 %------Packages and library
@@ -13,6 +14,7 @@
 \RequirePackage{tikz}
 \RequirePackage{xstring}
 \RequirePackage{xintexpr}
+\RequirePackage{listofitems}
 \RequirePackage{simplekv}
 \usetikzlibrary{decorations,decorations.pathreplacing,calc,positioning,bbox,arrows.meta,bending}
 
@@ -892,5 +894,83 @@
 		}%
 }
 
+%====BICOLORTXT
+\defKV[bicolortxt]{colors=\def\bicolortxtcols{#1},style=\def\bicolortxtsttyle{#1},intdelta=\def\bicolortxtdelta{#1},paralcolors=\def\bicolortxtcolstrapez{#1}}
+\setKVdefault[bicolortxt]{colors={red/blue},style=midh,intdelta=0.66,paralcolors={red/blue/orange/gray}}
 
+\NewDocumentCommand\tkzbicolor{ O{} m }{%
+	\restoreKV[bicolortxt]%
+	\setKV[bicolortxt]{#1}%
+	\IfStrEq{\bicolortxtsttyle}{paral}%
+		{%
+			\setsepchar[.]{/}%
+			\readlist*\bicolortrapez{\bicolortxtcolstrapez}%
+		}%
+		{%
+			\StrCut{\bicolortxtcols}{/}{\bicolorabove}{\bicolorbelow}%
+		}%
+	\tikz[baseline=(l.base),inner sep=0pt,outer sep=0pt]{%
+		\node[inner sep=0pt,outer sep=0pt](l){\phantom{#2}};
+		\coordinate (lnw) at ([shift={(-0.5\pgflinewidth,0.5\pgflinewidth)}]l.north west) ;
+		\coordinate (ln) at ([shift={(0,0.5\pgflinewidth)}]l.north) ;
+		\coordinate (lne) at ([shift={(0.5\pgflinewidth,0.5\pgflinewidth)}]l.north east) ;
+		\coordinate (le) at ([shift={(0.5\pgflinewidth,0)}]l.east) ;
+		\coordinate (lse) at ([shift={(0.5\pgflinewidth,-0.5\pgflinewidth)}]l.south east) ;
+		\coordinate (ls) at ([shift={(0,-0.5\pgflinewidth)}]l.south) ;
+		\coordinate (lsw) at ([shift={(-0.5\pgflinewidth,-0.5\pgflinewidth)}]l.south west) ;
+		\coordinate (lw) at ([shift={(-0.5\pgflinewidth,0)}]l.west) ;
+		\IfStrEqCase{\bicolortxtsttyle}{%
+			{ellips}%
+				{%
+					\coordinate (lcircn) at ($(l.center)!\bicolortxtdelta!(l.north)$) ;
+					\coordinate (lcirce) at ($(l.center)!\bicolortxtdelta!(l.east)$) ;
+				}%
+			{rect}%
+				{%
+					\coordinate (lrectnw) at ($(l.center)!\bicolortxtdelta!(l.north west)$) ;
+					\coordinate (lrectse) at ($(l.center)!\bicolortxtdelta!(l.south east)$) ;
+				}%
+			{paral}%
+				{%
+					\coordinate (ltrapna) at ($(l.north west)!0.333!(l.north east)$) ;
+					\coordinate (ltrapnb) at ($(l.north west)!0.666!(l.north east)$) ;
+					\coordinate (ltrapsa) at ($(l.south west)!0.333!(l.south east)$) ;
+					\coordinate (ltrapsb) at ($(l.south west)!0.666!(l.south east)$) ;
+				}%
+		}%
+		\begin{scope}
+			\IfStrEqCase{\bicolortxtsttyle}{%
+				{midh}{\clip(ls)rectangle(lnw);\node[\bicolorabove]at(l){#2};}%
+				{midv}{\clip(lnw)rectangle(le);\node[\bicolorabove]at(l){#2};}%
+				{ndiag}{\clip(lnw)--(lne)--(lse)--cycle;\node[\bicolorabove]at(l){#2};}%
+				{sdiag}{\clip(lsw)--(lnw)--(lne)--cycle;\node[\bicolorabove]at(l){#2};}%
+				{ellips}{\clip(lsw)rectangle(lne);\node[\bicolorabove]at(l){#2};}%
+				{rect}{\clip(lsw)rectangle(lne);\node[\bicolorabove]at(l){#2};}%
+				{paral}{\clip(lsw)--(lnw)--(ltrapna)--cycle;\node[{\bicolortrapez[1]}]at(l){#2};}%
+			}%
+		\end{scope}
+		\begin{scope}
+			\IfStrEqCase{\bicolortxtsttyle}{%
+				{midh}{\clip(ls)rectangle(lne);\node[\bicolorbelow]at(l){#2};}%
+				{midv}{\clip(lsw)rectangle(le);\node[\bicolorbelow]at(l){#2};}%
+				{ndiag}{\clip(lsw)--(lnw)--(lse)--cycle;\node[\bicolorbelow]at(l){#2};}%
+				{sdiag}{\clip(lsw)--(lne)--(lse)--cycle;\node[\bicolorbelow]at(l){#2};}%
+				{ellips}{\clip(lsw)rectangle(lne);\pgfpathellipse{\pgfpointanchor{l}{center}}{\pgfpointanchor{lcirce}{center}}{\pgfpointanchor{lcircn}{center}}\pgfusepath{clip}\node[\bicolorbelow]at(l){#2};}%
+				{rect}{\clip(lrectnw)rectangle(lrectse);\node[\bicolorbelow]at(l){#2};}%
+				{paral}{\clip(lsw)--(ltrapna)--(ltrapnb)--(ltrapsa)--cycle;\node[{\bicolortrapez[2]}]at(l){#2};}%
+			}%
+		\end{scope}
+		\IfStrEq{\bicolortxtsttyle}{paral}%
+			{%
+				\begin{scope}%3
+					\clip(ltrapsa)--(ltrapnb)--(lne)--(ltrapsb)--cycle;\node[{\bicolortrapez[3]}]at(l){#2};
+				\end{scope}
+				\begin{scope}%
+					\clip(ltrapsb)--(lne)--(lse)--cycle;\node[{\bicolortrapez[4]}]at(l){#2};
+				\end{scope}
+			}%
+			{}%
+	}%
+}
+
 \endinput
\ No newline at end of file



More information about the tex-live-commits mailing list.