diff options
author | Norbert Preining <norbert@preining.info> | 2024-04-27 03:01:43 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-04-27 03:01:43 +0000 |
commit | 71f3eefe319b1194e0470ee83dd8723b3288f8d4 (patch) | |
tree | 503b3ee87a27155262bbddff29f79ad8d14edf15 /graphics | |
parent | cb867271b21bfe7bea226cbe72cc596124933dfc (diff) |
CTAN sync 202404270301
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/pgf/contrib/jigsaw/DEPENDS.txt | 3 | ||||
-rw-r--r-- | graphics/pgf/contrib/jigsaw/README.md | 29 | ||||
-rw-r--r-- | graphics/pgf/contrib/jigsaw/jigsaw-doc-settings.sty | 196 | ||||
-rw-r--r-- | graphics/pgf/contrib/jigsaw/jigsaw-doc.pdf | bin | 183243 -> 149829 bytes | |||
-rw-r--r-- | graphics/pgf/contrib/jigsaw/jigsaw-doc.tex | 195 | ||||
-rw-r--r-- | graphics/pgf/contrib/jigsaw/jigsaw.sty | 2 | ||||
-rw-r--r-- | graphics/pgf/contrib/tikzbricks/DEPENDS.txt | 4 | ||||
-rw-r--r-- | graphics/pgf/contrib/tikzbricks/README.md | 27 | ||||
-rw-r--r-- | graphics/pgf/contrib/tikzbricks/tikzbricks-doc-settings.sty | 199 | ||||
-rw-r--r-- | graphics/pgf/contrib/tikzbricks/tikzbricks-doc.pdf | bin | 271210 -> 245454 bytes | |||
-rw-r--r-- | graphics/pgf/contrib/tikzbricks/tikzbricks-doc.tex | 248 | ||||
-rw-r--r-- | graphics/pgf/contrib/tikzbricks/tikzbricks.sty | 2 |
12 files changed, 629 insertions, 276 deletions
diff --git a/graphics/pgf/contrib/jigsaw/DEPENDS.txt b/graphics/pgf/contrib/jigsaw/DEPENDS.txt new file mode 100644 index 0000000000..4a5b9136d9 --- /dev/null +++ b/graphics/pgf/contrib/jigsaw/DEPENDS.txt @@ -0,0 +1,3 @@ +hard pgf +hard iftex +hard epstopdf-pkg diff --git a/graphics/pgf/contrib/jigsaw/README.md b/graphics/pgf/contrib/jigsaw/README.md index 85fd24c58a..9ec853f080 100644 --- a/graphics/pgf/contrib/jigsaw/README.md +++ b/graphics/pgf/contrib/jigsaw/README.md @@ -1,9 +1,32 @@ +![](https://raw.githubusercontent.com/samcarter/jigsaw/main/ICON.png) + + # Jigsaw +[![GitHub](https://img.shields.io/github/license/samcarter/jigsaw.svg?color=blue)](http://www.latex-project.org/lppl.txt) +[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/samcarter/jigsaw.svg?label=current%20version)](https://github.com/samcarter/jigsaw/releases/latest) +[![CTAN](https://img.shields.io/ctan/v/jigsaw.svg)](https://ctan.org/pkg/jigsaw) + + A small LaTeX package to draw jigsaw pieces with TikZ. It is possible to draw individual pieces and adjust their shape, produce tile patterns or to automatically generate complete jigsaws. -Current version: 2023/02/21 version v0.4 +This project is licensed under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt . + +The project repository, including a bug tracker, can be found at https://github.com/samcarter/jigsaw . + +### Usage + +```latex +\documentclass{standalone} +\usepackage{jigsaw} + +\begin{document} + +\begin{tikzpicture} + \piece[color=teal]{1}{-1}{1}{-1} +\end{tikzpicture} -This project is licensed under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt +\end{document} +``` -The project repository, including a bug tracker, can be found at https://github.com/samcarter/jigsaw/issues +For more details, please consult the [package documentation](https://github.com/samcarter/jigsaw/blob/main/DOCUMENTATION.pdf). diff --git a/graphics/pgf/contrib/jigsaw/jigsaw-doc-settings.sty b/graphics/pgf/contrib/jigsaw/jigsaw-doc-settings.sty new file mode 100644 index 0000000000..13a1498c38 --- /dev/null +++ b/graphics/pgf/contrib/jigsaw/jigsaw-doc-settings.sty @@ -0,0 +1,196 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Personal helper theme for package documentations +% Copyright samcarter +% +% This file may be distributed and/or modified +% under the LaTeX Project Public License 1.3c or later +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Usage: +% ln ~/Life/latex/beamertheme-sam/themesam.sty package-doc-settings.sty +% \usepackage[ +% themecolor=samdblue +% ]{\jobname-settings} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Colours +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\RequirePackage{xcolor} +\definecolor{samyellow}{RGB}{246,193,65} +\definecolor{samorange}{RGB}{241,147,45} +\definecolor{samred}{RGB}{191,26,46}% TikZbricks +\definecolor{sammagenta}{RGB}{170,42,104}% TikZmarmots +\definecolor{samviolet}{RGB}{136,46,114}% TikZlings +\definecolor{samlila}{RGB}{101,67,159}% Rainbow beamer theme +\definecolor{samdblue}{RGB}{0,51,134}% beamer theme +\definecolor{samlblue}{RGB}{22,89,155}% TikZducks +\definecolor{samteal}{RGB}{25,143,157}% Tcolorbox beamer theme +\definecolor{samlgreen}{RGB}{68,170,153}% Jigsaw +\definecolor{samdgreen}{RGB}{78,178,125} +\definecolor{samlgray}{RGB}{160,160,185} +\definecolor{samdgray}{RGB}{60,60,85} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Package options +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\RequirePackage{xkeyval} +\DeclareOptionX{themecolor}[samdblue]{\colorlet{themecolor}{#1}} +\DeclareOptionX{listingcolor}[samlblue]{\colorlet{listingcolor}{#1}} +\ExecuteOptionsX{themecolor,listingcolor} +\ProcessOptionsX + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Packages +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\@ifclassloaded{beamer}{}{% + \RequirePackage[english]{babel} + \RequirePackage[paper=a4paper,margin=2.9cm]{geometry} + \RequirePackage{scrlayer-scrpage} + \let\hrulefillx\hrulefill + \RequirePackage[bitstream-charter]{mathdesign} + \let\hrulefill\hrulefillx + \RequirePackage[hang,flushmargin,bottom]{footmisc} + \RequirePackage{footnotehyper} + \makesavenoteenv{tcolorbox} + \RequirePackage[all]{nowidow} + \RequirePackage[colorlinks=true,breaklinks=true,allcolors=themecolor,hyperfootnotes=false]{hyperref} +} +\RequirePackage[T1]{fontenc} +\RequirePackage{xspace} +\RequirePackage{inconsolata}% mono font with bold, but italic is missing +% \RequirePackage[scale=0.85]{cascadia-code} +% \AddToHook{cmd/ttfamily/before}{\fontseries{sl}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Listings +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\RequirePackage[ + cachedir=./build/ +]{minted} + +% smuggling custom pygmentize style in cache folder +% (a real pygmentise style would need installtion in some python folder) +\begin{filecontents*}[noheader]{./build/sam.pygstyle} +\makeatletter +\def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax% + \let\PYG@ul=\relax \let\PYG@tc=\relax% + \let\PYG@bc=\relax \let\PYG@ff=\relax} +\def\PYG@tok#1{\csname PYG@tok@#1\endcsname} +\def\PYG@toks#1+{\ifx\relax#1\empty\else% + \PYG@tok{#1}\expandafter\PYG@toks\fi} +\def\PYG@do#1{\PYG@bc{\PYG@tc{\PYG@ul{% + \PYG@it{\PYG@bf{\PYG@ff{#1}}}}}}} +\def\PYG#1#2{\PYG@reset\PYG@toks#1+\relax+\PYG@do{#2}} + +% optional arguments +\expandafter\def\csname PYG@tok@na\endcsname{\def\PYG@tc##1{\textcolor{black}{##1}}} + +% macros +\expandafter\def\csname PYG@tok@k\endcsname{\def\PYG@tc##1{\textcolor{listingcolor}{\bfseries ##1}}} +% curly brakets +\expandafter\def\csname PYG@tok@nb\endcsname{\def\PYG@tc##1{\textcolor{listingcolor}{\bfseries ##1}}} + +% comments (italics won't work with the inconsolata font) +\expandafter\def\csname PYG@tok@c\endcsname{\def\PYG@tc##1{\textcolor{gray}{##1}}} + +\def\PYGZbs{\char`\\} +\def\PYGZus{\char`\_} +\def\PYGZob{\char`\{} +\def\PYGZcb{\char`\}} +\def\PYGZca{\char`\^} +\def\PYGZam{\char`\&} +\def\PYGZlt{\char`\<} +\def\PYGZgt{\char`\>} +\def\PYGZsh{\char`\#} +\def\PYGZpc{\char`\%} +\def\PYGZdl{\char`\$} +\def\PYGZhy{\char`\-} +\def\PYGZsq{\char`\'} +\def\PYGZdq{\char`\"} +\def\PYGZti{\char`\~} +% for compatibility with earlier versions +\def\PYGZat{@} +\def\PYGZlb{[} +\def\PYGZrb{]} +\makeatother +\end{filecontents*} + +\usemintedstyle{sam} +\setminted{ + breaksymbolleft={}, + tabsize=2, + breaklines=true, +} +\newminted[samcode]{latex}{} +\newmintinline[saminline]{latex}{} + +% use non-bold and all coloured for inline code in articles +\ifdefined\insertaspectratio\else + \patchcmd{\minted@inputpyg@inline}{\minted@input}{\color{listingcolor}\renewcommand\textcolor[3][]{##3}\renewcommand\bfseries{}\minted@input}{}{} +\fi + +\RequirePackage[most]{tcolorbox} +\tcbuselibrary{minted} +\tcbset{% + colframe=themecolor, + fonttitle=\bfseries, + sidebyside, + center lower, + righthand width=5.7cm, + bottom=2pt, + top=2pt, + left=3pt, + right=3pt, + sidebyside gap=10pt, + lower separated=false, + listing engine=minted, + minted language=latex, + colback=themecolor!10, + sharp corners, + boxrule=0pt, + before title={\strut} +} + +% avoid page breaks right in front of the tcolorbox +\@ifclassloaded{beamer}{}{ + \tcbuselibrary{hooks} + \tcbset{before pre={\nopagebreak[4]}} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% document settings +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\@ifclassloaded{scrartcl}{% + \KOMAoptions{parskip=half} + \addtokomafont{sectioning}{\color{themecolor}} + \addtokomafont{date}{\normalsize} + \addtokomafont{author}{\normalsize} + \setlength{\footnotemargin}{0.7em} +}{} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Custom macros +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\providecommand*{\CTAN}{\textsc{CTAN}\xspace} +\providecommand*{\TikZ}{Ti\emph{k}Z\xspace} +\providecommand*{\miktex}{MiK\TeX\xspace} +\providecommand*{\texlive}{\TeX{}Live\xspace} +\providecommand*{\tikzbrick}{Ti\emph{k}Zbrick\xspace} +\providecommand*{\tikzducks}{Ti\emph{k}Zducks\xspace} +\providecommand*{\tikzlings}{Ti\emph{k}Zlings\xspace} +\providecommand*{\tikzmarmots}{Ti\emph{k}Zmarmots\xspace} +\providecommand*{\ConTeXt}{C\kern-.0333emon\-\kern-.0667em\TeX\kern-.0333emt}
\ No newline at end of file diff --git a/graphics/pgf/contrib/jigsaw/jigsaw-doc.pdf b/graphics/pgf/contrib/jigsaw/jigsaw-doc.pdf Binary files differindex 774686398a..cc286aa201 100644 --- a/graphics/pgf/contrib/jigsaw/jigsaw-doc.pdf +++ b/graphics/pgf/contrib/jigsaw/jigsaw-doc.pdf diff --git a/graphics/pgf/contrib/jigsaw/jigsaw-doc.tex b/graphics/pgf/contrib/jigsaw/jigsaw-doc.tex index 18ff47f514..d52b2fb216 100644 --- a/graphics/pgf/contrib/jigsaw/jigsaw-doc.tex +++ b/graphics/pgf/contrib/jigsaw/jigsaw-doc.tex @@ -11,91 +11,40 @@ % See http://www.latex-project.org/lppl.txt % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\documentclass[parskip=half]{scrartcl} - -% packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\usepackage[T1]{fontenc} -\usepackage[utf8]{inputenc} -\usepackage[english]{babel} -\usepackage[bitstream-charter]{mathdesign} -%\usepackage{duckuments} -\usepackage{jigsaw} -\usetikzlibrary{matrix} -\usepackage[most]{tcolorbox} -\usepackage[paper=a4paper,margin=2.9cm]{geometry} -\usepackage{url} -\usepackage{xspace} -\usepackage{scrlayer-scrpage} -\usepackage[hang,flushmargin,bottom]{footmisc} -\usepackage[colorlinks=true,breaklinks=true,urlcolor=duckblue,linkcolor=duckblue,citecolor=duckblue,filecolor=duckblue]{hyperref} - -% macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\newcommand{\CTAN}{\textsc{CTAN}\xspace} -\newcommand{\TikZ}{Ti\emph{k}Z\xspace} -\newcommand{\miktex}{MiK\TeX\xspace} -\newcommand{\texlive}{\TeX{}Live\xspace} - -% customisation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\definecolor{duckblue}{RGB}{0,70,140} -\definecolor{marmotred}{RGB}{140,20,40} -\addtokomafont{sectioning}{\color{teal}} -\addtokomafont{date}{\normalsize} -\addtokomafont{author}{\normalsize} -\setlength{\footnotemargin}{0.7em} - -% from https://tex.stackexchange.com/a/147848 -\def\beginlstdelim#1#2#3% -{% - \def\endlstdelim{#2\egroup}% - \ttfamily#1\bgroup\color{#3}\aftergroup\endlstdelim% -} - -\lstdefinestyle{jigsawstyle}{% - language={[latex]TeX}, - tabsize=2, - breaklines, - basicstyle=\footnotesize\ttfamily, - commentstyle={\color{teal}\slshape}, - columns=fullflexible, - texcsstyle=*\color{duckblue}\bfseries, - keywordstyle=\color{red!60!black}\bfseries, - morekeywords={tikzpicture,scope}, - moretexcs={path,node,draw,clip,pic,includegraphics,color,piece,tile,jigsaw}, - delim ={[s][\ttfamily\color{green!50!black}]{$}{$}}, - moredelim=[is][\footnotesize\ttfamily\color{orange!70!black}]{|}{|}, - moredelim={[s][\color{gray}]{<}{>}}, -% moredelim = **[is][\beginlstdelim{\{}{\}}{orange!70!black}]{\{}{\}}, -% moredelim = **[is][\beginlstdelim{[}{]}{orange!70!black}]{[}{]}, -} - -\tcbset{% - colframe=teal, - arc=2mm, - fonttitle=\bfseries, - sidebyside, - listing options={style=jigsawstyle}, - center lower, - righthand width=5.7cm, - bottom=0pt, - top=0pt, - sidebyside gap=10pt -} - -\lstset{style=jigsawstyle} +% !TeX program = txs:///arara +% arara: latexmk: { +% arara: --> engine: pdflatex, +% arara: --> options: [ +% arara: --> '-shell-escape', +% arara: --> '-synctex=1', +% arara: --> '-interaction=nonstopmode', +% arara: --> ] +% arara: --> } +\documentclass{scrartcl} % meta %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \title{The jigsaw package} \subtitle{Drawing jigsaw pieces in \TikZ} \author{% - \texorpdfstring{ - \begin{tikzpicture} - \piece[lightgray!70!white]{1}{-1}{1}{-1} - \end{tikzpicture}\\[0.8em] - \texttt{samcarter}\\ - \url{https://github.com/samcarter/jigsaw}\\ - \url{https://www.ctan.org/pkg/jigsaw} - }{samcarter}} -\date{Version v0.4 \textendash{} 2023/02/21} + \texorpdfstring{ + \begin{tikzpicture} + \piece[lightgray!70!white]{1}{-1}{1}{-1} + \end{tikzpicture}\\[0.8em] + \texttt{samcarter}\\ + \url{https://github.com/samcarter/jigsaw}\\ + \url{https://www.ctan.org/pkg/jigsaw} + }{samcarter}} +\date{Version v0.5 \textendash{} 2024/04/25} + +\usepackage[ + themecolor=samlgreen +]{\jobname-settings} + +\colorlet{teal}{samlgreen} +\colorlet{violet}{samviolet} + +\usepackage{jigsaw} +\usetikzlibrary{matrix} \begin{document} \maketitle @@ -114,20 +63,22 @@ Copyright \raisebox{0.2em}{\tiny\fontfamily{cmr}\selectfont\textcopyright} \text An individual jigsaw piece can be drawn with \begin{tcolorbox}[title={Jigsaw piece}] -\begin{lstlisting} +\begin{samcode} \piece{<bottom>}{<right>}{<top>}{<left>} -\end{lstlisting} +\end{samcode} \tcblower \begin{tikzpicture} - \piece{1}{-1}{1}{1} +\piece{1}{-1}{1}{1} \end{tikzpicture} \end{tcolorbox} -wherein arguments specify for each side if it should be a tab (-1), a straight line (0) or a slot (1). The following example will produce a jigsaw piece with one tab sticking out, one straight boarder and two slots: +wherein arguments specify for each side if it should be a tab (-1), a straight line (0) or a slot (1). + +The following example will produce a jigsaw piece with one tab sticking out, one straight boarder and two slots: \begin{tcblisting}{title={Jigsaw piece}} \begin{tikzpicture} - \piece{1}{-1}{0}{1} + \piece{1}{-1}{0}{1} \end{tikzpicture} \end{tcblisting} @@ -135,7 +86,7 @@ With an optional argument, a fill colour can be passed to the piece: \begin{tcblisting}{title={Filled piece}} \begin{tikzpicture} - \piece[teal]{-1}{1}{-1}{1} + \piece[teal]{-1}{1}{-1}{1} \end{tikzpicture} \end{tcblisting} @@ -143,69 +94,73 @@ Or to change the line colour: \begin{tcblisting}{title={Coloured piece}} \begin{tikzpicture} - \color{teal}\piece{-1}{-1}{1}{1} + \color{teal}\piece{-1}{-1}{1}{1} \end{tikzpicture} \end{tcblisting} -The piece shape is also available as \TikZ \verb|pic|: +The piece shape is also available as \TikZ \saminline|pic|: \begin{tcblisting}{title={\texttt{pic}}} \begin{tikzpicture} - \path (2,-3) pic[ - fill=lightgray, draw=teal, ultra thick, + \path (2,-3) pic[ + fill=lightgray, draw=teal, thick, scale=2, pic text={Some Text}, pic text options={text=violet} ]{piece={1}{-1}{1}{0}}; \end{tikzpicture} \end{tcblisting} -Using the \TikZ \verb|pic| allows to apply various \TikZ option like \verb|scale| or add text in the centre of the piece via \verb|pic text={...}|. +Using the \TikZ \saminline|pic| allows to apply various \TikZ option like \saminline|scale| or add text in the centre of the piece via \saminline|pic text={...}|. The shapes of the jigsaw pieces are designed to seamlessly fit into each other which allows to produce tile patters in various ways: \begin{tcblisting}{title={Manual tile pattern}} \begin{tikzpicture} \begin{scope} - \piece[teal]{1}{1}{0}{0} + \piece[teal]{1}{1}{0}{0} \end{scope} \begin{scope}[xshift=1cm] - \piece[lightgray]{1}{0}{0}{-1} + \piece[lightgray]{1}{0}{0}{-1} \end{scope} \begin{scope}[yshift=-1cm] - \piece[lightgray]{0}{-1}{-1}{0} + \piece[lightgray]{0}{-1}{-1}{0} \end{scope} \begin{scope}[xshift=1cm,yshift=-1cm] - \piece[teal]{0}{0}{-1}{1} + \piece[teal]{0}{0}{-1}{1} \end{scope} \end{tikzpicture} \end{tcblisting} \begin{tcblisting}{title={Manual pattern using \texttt{\textbackslash pic}}} \begin{tikzpicture} -\pic at (0,1) [fill=lightgray,draw] - {piece={1}{1}{0}{0}}; -\pic at (1,1) [fill=teal] - {piece={1}{0}{0}{-1}}; -\pic at (0,0) [fill=teal] - {piece={0}{-1}{-1}{0}}; -\pic at (1,0) [fill=lightgray,draw] - {piece={0}{0}{-1}{1}}; + \pic at (0,1) [fill=lightgray,draw] + {piece={1}{1}{0}{0}}; + \pic at (1,1) [fill=teal,draw] + {piece={1}{0}{0}{-1}}; + \pic at (0,0) [fill=teal,draw] + {piece={0}{-1}{-1}{0}}; + \pic at (1,0) [fill=lightgray,draw] + {piece={0}{0}{-1}{1}}; \end{tikzpicture} \end{tcblisting} \begin{tcblisting}{title={Manual pattern using Ti\emph{k}Z matrix}} % \usetikzlibrary{matrix} \begin{tikzpicture} -\matrix [nodes=draw]{ -\pic [fill=lightgray]{piece={-1}{1}{0}{0}};& -\pic [fill=teal]{piece={1}{0}{0}{-1}}; \\ -\pic [fill=teal]{piece={0}{-1}{1}{0}}; & -\pic [fill=lightgray]{piece={0}{0}{-1}{1}};\\ -}; + \matrix [nodes=draw]{ + \pic [fill=lightgray] + {piece={-1}{1}{0}{0}}; & + \pic [fill=teal] + {piece={1}{0}{0}{-1}}; \\ + \pic [fill=teal] + {piece={0}{-1}{1}{0}}; & + \pic [fill=lightgray] + {piece={0}{0}{-1}{1}};\\ + }; \end{tikzpicture} \end{tcblisting} -Manually position each jigsaw piece at the correct position can be tedious, therefore the command \lstinline|\tile[<colour>]{<bottom>}{<right>}{<top>}{<left>}| was added. It can be used outside of of the \lstinline|tikzpicture| environment to place the pieces besides each other like normal letters in a text. Line breaks have to be added at the appropriate positions and one has to be careful not to introduce additional spaces between the jigsaw pieces from unprotected line endings. +Manually position each jigsaw piece at the correct position can be tedious, therefore the command \saminline|\tile[<colour>]{<bottom>}{<right>}{<top>}{<left>}| was added. It can be used outside of of the \saminline|tikzpicture| environment to place the pieces besides each other like normal letters in a text. Line breaks have to be added at the appropriate positions and one has to be careful not to introduce additional spaces between the jigsaw pieces from unprotected line endings. \begin{tcblisting}{title={The tile command}} \tile[violet]{1}{1}{0}{0}% @@ -221,23 +176,25 @@ Manually position each jigsaw piece at the correct position can be tedious, ther \tile[violet]{0}{0}{1}{1} \end{tcblisting} -Finally there is also the possibility to automatically generate complete jigsaw puzzles using the command \lstinline|\jigsaw{<x>}{<y>}|, with \lstinline|<x>| and \lstinline|<y>| the number of rows and columns, respectively. +Finally there is also the possibility to automatically generate complete jigsaw puzzles using the command \saminline|\jigsaw{<x>}{<y>}|, with \saminline|<x>| and \saminline|<y>| the number of rows and columns, respectively. -\begin{tcblisting}{title={Automatic jigsaw generation}} +\begin{tcblisting}{title={Automatic jigsaw generation},righthand width=6.1cm} \begin{tikzpicture} -\jigsaw{6}{4} + \jigsaw{6}{4} \end{tikzpicture} \end{tcblisting} This automatically generated jigsaw can also be overlaid on a picture: -\begin{tcblisting}{title={Overlaid image}} +\begin{tcblisting}{title={Overlaid image},righthand width=6.1cm} \begin{tikzpicture} -\clip (0,0) rectangle (6,4); -\node at (3,2) {% - \includegraphics[width=6cm,height=4cm]{example-image-duck}% -}; -\jigsaw{6}{4} + \clip (0,0) rectangle (6,4); + \node at (3,2) {% + \includegraphics[ + width=6cm,height=4cm + ]{example-image-duck}% + }; + \jigsaw{6}{4} \end{tikzpicture} \end{tcblisting} diff --git a/graphics/pgf/contrib/jigsaw/jigsaw.sty b/graphics/pgf/contrib/jigsaw/jigsaw.sty index 49f2b618be..5bc144aadf 100644 --- a/graphics/pgf/contrib/jigsaw/jigsaw.sty +++ b/graphics/pgf/contrib/jigsaw/jigsaw.sty @@ -12,7 +12,7 @@ % See http://www.latex-project.org/lppl.txt % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\ProvidesPackage{jigsaw}[2023/02/21 version v0.4 Draw jigsaw pieces in TikZ] +\ProvidesPackage{jigsaw}[2024/04/25 version v0.5 Draw jigsaw pieces in TikZ] \RequirePackage{tikz} diff --git a/graphics/pgf/contrib/tikzbricks/DEPENDS.txt b/graphics/pgf/contrib/tikzbricks/DEPENDS.txt new file mode 100644 index 0000000000..3b3dcac395 --- /dev/null +++ b/graphics/pgf/contrib/tikzbricks/DEPENDS.txt @@ -0,0 +1,4 @@ +hard pgf +hard iftex +hard epstopdf-pkg +hard tikz-3dplot diff --git a/graphics/pgf/contrib/tikzbricks/README.md b/graphics/pgf/contrib/tikzbricks/README.md index 8cd336a7c3..57dd862009 100644 --- a/graphics/pgf/contrib/tikzbricks/README.md +++ b/graphics/pgf/contrib/tikzbricks/README.md @@ -1,11 +1,30 @@ +![](https://raw.githubusercontent.com/samcarter/tikzbricks/main/ICON.png) + # TikZbricks +[![GitHub](https://img.shields.io/github/license/samcarter/tikzbricks.svg?color=blue)](http://www.latex-project.org/lppl.txt) +[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/samcarter/tikzbricks.svg?label=current%20version)](https://github.com/samcarter/tikzbricks/releases/latest) +[![CTAN](https://img.shields.io/ctan/v/tikzbricks.svg)](https://ctan.org/pkg/tikzbricks) + A small LaTeX package to draw bricks with TikZ. The user can modify the colour, shape and viewpoint. -Current version: 2022/07/21 version v0.4 +This project is licensed under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt . + +The project repository, including a bug tracker, can be found at https://github.com/samcarter/tikzbricks . + +### Usage + +```latex +\documentclass{standalone} +\usepackage{tikzbricks} + +\begin{document} -![example image of three bricks](https://raw.githubusercontent.com/samcarter/TikZbricks/main/showcase/showcase.svg) +\begin{tikzpicture} + \brick[color=blue]{4}{2} +\end{tikzpicture} -This project is licensed under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt +\end{document} +``` -The project repository, including a bug tracker, can be found at https://github.com/samcarter/TikZbricks/issues +For more details, please consult the [package documentation](https://github.com/samcarter/tikzbricks/blob/main/DOCUMENTATION.pdf). diff --git a/graphics/pgf/contrib/tikzbricks/tikzbricks-doc-settings.sty b/graphics/pgf/contrib/tikzbricks/tikzbricks-doc-settings.sty new file mode 100644 index 0000000000..777cedba6e --- /dev/null +++ b/graphics/pgf/contrib/tikzbricks/tikzbricks-doc-settings.sty @@ -0,0 +1,199 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Personal helper theme for package documentations +% Copyright samcarter +% +% This file may be distributed and/or modified +% under the LaTeX Project Public License 1.3c or later +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Usage: +% ln ~/Life/latex/beamertheme-sam/themesam.sty package-doc-settings.sty +% \usepackage[ +% themecolor=samdblue +% ]{\jobname-settings} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Colours +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\RequirePackage{xcolor} +\definecolor{samyellow}{RGB}{246,193,65} +\definecolor{samorange}{RGB}{241,147,45} +\definecolor{samred}{RGB}{191,26,46}% TikZbricks +\definecolor{sammagenta}{RGB}{170,42,104}% TikZmarmots +\definecolor{samviolet}{RGB}{136,46,114}% TikZlings +\definecolor{samlila}{RGB}{101,67,159}% Rainbow beamer theme +\definecolor{samdblue}{RGB}{0,51,134}% beamer theme +\definecolor{samlblue}{RGB}{22,89,155}% TikZducks +\definecolor{samteal}{RGB}{25,143,157}% Tcolorbox beamer theme +\definecolor{samlgreen}{RGB}{68,170,153}% Jigsaw +\definecolor{samdgreen}{RGB}{78,178,125} +\definecolor{samlgray}{RGB}{160,160,185} +\definecolor{samdgray}{RGB}{60,60,85} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Package options +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\RequirePackage{xkeyval} +\DeclareOptionX{themecolor}[samdblue]{\colorlet{themecolor}{#1}} +\DeclareOptionX{listingcolor}[samlblue]{\colorlet{listingcolor}{#1}} +\ExecuteOptionsX{themecolor,listingcolor} +\ProcessOptionsX + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Packages +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\@ifclassloaded{beamer}{}{% + \RequirePackage[english]{babel} + \RequirePackage[paper=a4paper,margin=2.9cm]{geometry} + \RequirePackage{scrlayer-scrpage} + \let\hrulefillx\hrulefill + \RequirePackage[bitstream-charter]{mathdesign} + \let\hrulefill\hrulefillx + \RequirePackage[hang,flushmargin,bottom]{footmisc} + \RequirePackage{footnotehyper} + \makesavenoteenv{tcolorbox} + \RequirePackage[all]{nowidow} + \RequirePackage[colorlinks=true,breaklinks=true,allcolors=themecolor,hyperfootnotes=false]{hyperref} +} +\RequirePackage[T1]{fontenc} +\RequirePackage{xspace} +\RequirePackage{inconsolata}% mono font with bold, but italic is missing +% \RequirePackage[scale=0.85]{cascadia-code} +% \AddToHook{cmd/ttfamily/before}{\fontseries{sl}} +\RequirePackage{iexec} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Listings +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\RequirePackage[ + cachedir=$TMPDIR/minted/ +]{minted} + +% smuggling custom pygmentize style in cache folder +% (a real pygmentise style would need installtion in some python folder) +\begin{filecontents*}[noheader]{./sam.pygstyle} +\makeatletter +\def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax% + \let\PYG@ul=\relax \let\PYG@tc=\relax% + \let\PYG@bc=\relax \let\PYG@ff=\relax} +\def\PYG@tok#1{\csname PYG@tok@#1\endcsname} +\def\PYG@toks#1+{\ifx\relax#1\empty\else% + \PYG@tok{#1}\expandafter\PYG@toks\fi} +\def\PYG@do#1{\PYG@bc{\PYG@tc{\PYG@ul{% + \PYG@it{\PYG@bf{\PYG@ff{#1}}}}}}} +\def\PYG#1#2{\PYG@reset\PYG@toks#1+\relax+\PYG@do{#2}} + +% optional arguments +\expandafter\def\csname PYG@tok@na\endcsname{\def\PYG@tc##1{\textcolor{black}{##1}}} + +% macros +\expandafter\def\csname PYG@tok@k\endcsname{\def\PYG@tc##1{\textcolor{listingcolor}{\bfseries ##1}}} +% curly brakets +\expandafter\def\csname PYG@tok@nb\endcsname{\def\PYG@tc##1{\textcolor{listingcolor}{\bfseries ##1}}} + +% comments (italics won't work with the inconsolata font) +\expandafter\def\csname PYG@tok@c\endcsname{\def\PYG@tc##1{\textcolor{gray}{##1}}} + +\def\PYGZbs{\char`\\} +\def\PYGZus{\char`\_} +\def\PYGZob{\char`\{} +\def\PYGZcb{\char`\}} +\def\PYGZca{\char`\^} +\def\PYGZam{\char`\&} +\def\PYGZlt{\char`\<} +\def\PYGZgt{\char`\>} +\def\PYGZsh{\char`\#} +\def\PYGZpc{\char`\%} +\def\PYGZdl{\char`\$} +\def\PYGZhy{\char`\-} +\def\PYGZsq{\char`\'} +\def\PYGZdq{\char`\"} +\def\PYGZti{\char`\~} +% for compatibility with earlier versions +\def\PYGZat{@} +\def\PYGZlb{[} +\def\PYGZrb{]} +\makeatother +\end{filecontents*} + +\iexec{mkdir -p $TMPDIR/minted && mv sam.pygstyle $TMPDIR/minted/.} + +\usemintedstyle{sam} +\setminted{ + breaksymbolleft={}, + tabsize=2, + breaklines=true, +} +\newminted[samcode]{latex}{} +\newmintinline[saminline]{latex}{} + +% use non-bold and all coloured for inline code in articles +\ifdefined\insertaspectratio\else + \patchcmd{\minted@inputpyg@inline}{\minted@input}{\color{listingcolor}\renewcommand\textcolor[3][]{##3}\renewcommand\bfseries{}\minted@input}{}{} +\fi + +\RequirePackage[most]{tcolorbox} +\tcbuselibrary{minted} +\tcbset{% + colframe=themecolor, + fonttitle=\bfseries, + sidebyside, + center lower, + righthand width=5.7cm, + bottom=2pt, + top=2pt, + left=3pt, + right=3pt, + sidebyside gap=10pt, + lower separated=false, + listing engine=minted, + minted language=latex, + colback=themecolor!10, + sharp corners, + boxrule=0pt, + before title={\strut} +} + +% avoid page breaks right in front of the tcolorbox +\@ifclassloaded{beamer}{}{ + \tcbuselibrary{hooks} + \tcbset{before pre={\nopagebreak[4]}} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% document settings +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\@ifclassloaded{scrartcl}{% + \KOMAoptions{parskip=half} + \addtokomafont{sectioning}{\color{themecolor}} + \addtokomafont{date}{\normalsize} + \addtokomafont{author}{\normalsize} + \setlength{\footnotemargin}{0.7em} +}{} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Custom macros +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\providecommand*{\CTAN}{\textsc{CTAN}\xspace} +\providecommand*{\TikZ}{Ti\emph{k}Z\xspace} +\providecommand*{\miktex}{MiK\TeX\xspace} +\providecommand*{\texlive}{\TeX{}Live\xspace} +\providecommand*{\tikzbrick}{Ti\emph{k}Zbrick\xspace} +\providecommand*{\tikzducks}{Ti\emph{k}Zducks\xspace} +\providecommand*{\tikzlings}{Ti\emph{k}Zlings\xspace} +\providecommand*{\tikzmarmots}{Ti\emph{k}Zmarmots\xspace} +\providecommand*{\ConTeXt}{C\kern-.0333emon\-\kern-.0667em\TeX\kern-.0333emt}
\ No newline at end of file diff --git a/graphics/pgf/contrib/tikzbricks/tikzbricks-doc.pdf b/graphics/pgf/contrib/tikzbricks/tikzbricks-doc.pdf Binary files differindex 0b39ca2b61..121c6d41ba 100644 --- a/graphics/pgf/contrib/tikzbricks/tikzbricks-doc.pdf +++ b/graphics/pgf/contrib/tikzbricks/tikzbricks-doc.pdf diff --git a/graphics/pgf/contrib/tikzbricks/tikzbricks-doc.tex b/graphics/pgf/contrib/tikzbricks/tikzbricks-doc.tex index febcba5c36..3895d6675e 100644 --- a/graphics/pgf/contrib/tikzbricks/tikzbricks-doc.tex +++ b/graphics/pgf/contrib/tikzbricks/tikzbricks-doc.tex @@ -11,76 +11,43 @@ % See http://www.latex-project.org/lppl.txt % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\documentclass[parskip=half]{scrartcl} +% !TeX program = txs:///arara +% arara: latexmk: { +% arara: --> engine: pdflatex, +% arara: --> options: [ +% arara: --> '-shell-escape', +% arara: --> '-synctex=1', +% arara: --> '-interaction=nonstopmode', +% arara: --> ] +% arara: --> } +\documentclass{scrartcl} + +% meta %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\title{The \tikzbrick{}s package} +\subtitle{Drawing bricks with \TikZ} +\author{% + \texorpdfstring{ + \begin{tikzpicture} + \brick[color=blue]{4}{2} + \end{tikzpicture}\\[0.8em] + \texttt{samcarter}\\ + \url{https://github.com/samcarter/TikZbricks}\\ + \url{https://www.ctan.org/pkg/tikzbricks} + }{samcarter}} +\date{Version v0.5 \textendash{} 2024/04/26} + +\usepackage[ + themecolor=samred +]{\jobname-settings} + +\colorlet{red}{samred} +\colorlet{blue}{samlblue} +\colorlet{orange}{samorange} +\colorlet{teal}{samteal} -% packages %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\usepackage[T1]{fontenc} -\usepackage[utf8]{inputenc} -\usepackage[english]{babel} -\usepackage[bitstream-charter]{mathdesign} \usepackage{tikzbricks} -\usepackage[most]{tcolorbox} -\usepackage[paper=a4paper,margin=2.9cm]{geometry} -\usepackage{url} -\usepackage{xspace} -\usepackage{scrlayer-scrpage} -\usepackage[hang,flushmargin,bottom]{footmisc} -\usepackage[colorlinks=true,breaklinks=true,urlcolor=darkblue,linkcolor=darkblue,citecolor=darkblue,filecolor=darkblue]{hyperref} - -% macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\newcommand{\CTAN}{\textsc{CTAN}\xspace} -\newcommand{\TikZ}{Ti\emph{k}Z\xspace} -\newcommand{\miktex}{MiK\TeX\xspace} -\newcommand{\texlive}{\TeX{}Live\xspace} -\newcommand{\tikzbrick}{Ti\emph{k}Zbrick\xspace} % customisation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\definecolor{darkblue}{RGB}{0,70,140} -\addtokomafont{sectioning}{\color{gray}} -\addtokomafont{date}{\normalsize} -\addtokomafont{author}{\normalsize} -\setlength{\footnotemargin}{0.7em} - -% from https://tex.stackexchange.com/a/147848 -\def\beginlstdelim#1#2#3% -{% - \def\endlstdelim{#2\egroup}% - \ttfamily#1\bgroup\color{#3}\aftergroup\endlstdelim% -} - -\lstdefinestyle{tikzbricksstyle}{% - language={[latex]TeX}, - tabsize=2, - breaklines, - basicstyle=\footnotesize\ttfamily, - commentstyle={\color{gray}\slshape}, - columns=fullflexible, - texcsstyle=*\color{darkblue}\bfseries, - keywordstyle=\color{red!60!black}\bfseries, - morekeywords={tikzpicture,wall,brickx,bricky,brickz}, - moretexcs={brick,tdplotsetmaincoords,wallbrick,newrow}, - delim ={[s][\ttfamily\color{green!50!black}]{$}{$}}, - moredelim=[is][\footnotesize\ttfamily\color{orange!70!black}]{|}{|}, - moredelim={[s][\color{gray}]{<}{>}}, - emphstyle=\color{orange!60!black}, - emph=[1]{color,brickheight,bricklength,brickwidth,studradius,studheight,studtext,scale,xshift,frontcolor,topcolor,sidecolor,studcolor}, -} - -\tcbset{% - colframe=gray, - arc=2mm, - fonttitle=\bfseries, - sidebyside, - listing options={style=tikzbricksstyle}, - center lower, - righthand width=5.7cm, - bottom=0pt, - top=0pt, - sidebyside gap=10pt -} - -\lstset{style=tikzbricksstyle} - \setlength{\footheight}{50pt} \pagestyle{scrheadings} \pgfmathsetseed{10} @@ -89,24 +56,10 @@ \pgfmathsetmacro{\G}{rnd}% \pgfmathsetmacro{\B}{rnd}% \definecolor{randomcol}{rgb}{\R,\G,\B}% - \begin{tikzpicture}[scale=0.5] - \brick[color=randomcol]{\thepage}{1} + \begin{tikzpicture}[scale=0.5] + \brick[color=randomcol]{\thepage}{1} \end{tikzpicture} -} - -% meta %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\title{The \tikzbrick{}s package} -\subtitle{Drawing bricks with \TikZ} -\author{% - \texorpdfstring{ - \begin{tikzpicture} - \brick[color=blue]{4}{2} - \end{tikzpicture}\\[0.8em] - \texttt{samcarter}\\ - \url{https://github.com/samcarter/TikZbricks}\\ - \url{https://www.ctan.org/pkg/tikzbricks} - }{samcarter}} -\date{Version v0.4 \textendash{} 2022/07/21} +} \begin{document} \maketitle @@ -116,10 +69,10 @@ \label{intro} The idea for the \tikzbrick{}s package was born at the \href{https://tug.org/tug2021/}{TUG'21 conference}, at which one of the interviewees, John Hammersley, had a very cool collection of brick models in the background (\href{https://www.youtube.com/watch?v=-9_Iy5Fqr4E}{link to video}). - -The package allows to draw bricks with \TikZ. The user can modify their colour, shape and change the viewpoint. Internally the \href{https://ctan.org/pkg/tikz-3dplot}{tikz-3dplot} package is used for the 3D rendering. -The package is included in both \texlive and \miktex and available from \CTAN (\url{https://ctan.org/pkg/tikzbricks}). +The package allows to draw bricks with \TikZ. The user can modify their colour, shape and change the viewpoint. Internally the \href{https://ctan.org/pkg/tikz-3dplot}{tikz-3dplot} package is used for the 3D rendering. + +The package is included in both \texlive and \miktex and available from \CTAN (\url{https://ctan.org/pkg/tikzbricks}). The development version of this package is located on github at \url{https://github.com/samcarter/TikZbricks}. If you have any problems, ideas or other feedback, please make constructive use of its bug tracker. Copyright \raisebox{0.2em}{\tiny\fontfamily{cmr}\selectfont\textcopyright} \texttt{samcarter}. Permission is granted to copy, distribute and\slash or modify this software under the terms of the \href{http://www.latex-project.org/lppl.txt}{LaTeX project public licence, version 1.3c or later}. @@ -129,71 +82,71 @@ Copyright \raisebox{0.2em}{\tiny\fontfamily{cmr}\selectfont\textcopyright} \text An individual \tikzbrick can be drawn with \begin{tcblisting}{title={\tikzbrick}} \begin{tikzpicture} -\brick{4}{2} + \brick{4}{2} \end{tikzpicture} \end{tcblisting} -in which the first argument specifies the length of the block and the second argument its width. +in which the first argument specifies the length of the block and the second argument its width. In addition to this basic block, the user can customise the block via the following optional arguments (the value in parenthesis denotes the default value): \begin{tcblisting}{title={Brick colour (red)}} \begin{tikzpicture} - \brick[color=blue]{1}{3} + \brick[color=blue]{1}{3} \end{tikzpicture} \end{tcblisting} \begin{tcblisting}{title={Front colour (color!60)}} \begin{tikzpicture} - \brick[frontcolor=blue]{2}{1} + \brick[frontcolor=blue]{2}{1} \end{tikzpicture} \end{tcblisting} \begin{tcblisting}{title={Top colour (color!40)}} \begin{tikzpicture} - \brick[topcolor=blue]{2}{1} + \brick[topcolor=blue]{2}{1} \end{tikzpicture} \end{tcblisting} \begin{tcblisting}{title={Side colour (color)}} \begin{tikzpicture} - \brick[sidecolor=blue]{2}{1} + \brick[sidecolor=blue]{2}{1} \end{tikzpicture} \end{tcblisting} \begin{tcblisting}{title={Stud colour (color)}} \begin{tikzpicture} - \brick[studcolor=blue]{2}{1} + \brick[studcolor=blue]{2}{1} \end{tikzpicture} \end{tcblisting} \begin{tcblisting}{title={Brick height (1.3)}} \begin{tikzpicture} - \brick[brickheight=0.3]{2}{1} + \brick[brickheight=0.3]{2}{1} \end{tikzpicture} \end{tcblisting} \begin{tcblisting}{title={Brick length (1)}} \begin{tikzpicture} - \brick[bricklength=1.5]{2}{1} + \brick[bricklength=1.5]{2}{1} \end{tikzpicture} \end{tcblisting} \begin{tcblisting}{title={Brick width (1)}} \begin{tikzpicture} - \brick[brickwidth=2]{2}{1} + \brick[brickwidth=2]{2}{1} \end{tikzpicture} \end{tcblisting} \begin{tcblisting}{title={Stud radius (0.35)}} \begin{tikzpicture} - \brick[studradius=0.2]{2}{1} + \brick[studradius=0.2]{2}{1} \end{tikzpicture} \end{tcblisting} \begin{tcblisting}{title={Stud height (0.3)}} \begin{tikzpicture} - \brick[studheight=0.6]{2}{1} + \brick[studheight=0.6]{2}{1} \end{tikzpicture} \end{tcblisting} \begin{tcblisting}{title={Stud text ()}} \begin{tikzpicture} - \brick[studtext={TikZ}]{2}{3} + \brick[studtext={TikZ}]{2}{3} \end{tikzpicture} \end{tcblisting} All the above options are also available as package options to change the value for the whole document. The default colour can for example be specified like this: \begin{tcolorbox}[title={Package options ()}] -\begin{lstlisting}[morekeywords={tikzbricks,standalone,document}] +\begin{samcode} \documentclass{standalone} \usepackage[color=blue]{tikzbricks} @@ -201,11 +154,11 @@ All the above options are also available as package options to change the value \begin{document} \begin{tikzpicture} -\brick{3}{2} + \brick{3}{2} \end{tikzpicture} \end{document} -\end{lstlisting} +\end{samcode} \tcblower \makeatletter @@ -216,30 +169,30 @@ All the above options are also available as package options to change the value \end{tikzpicture} \end{tcolorbox} -To change the viewpoint, one can make use of the fact, that the \texttt{tikz-3dplot} package is used internally. By default, the \tikzbrick{}s package uses \lstinline|\tdplotsetmaincoords{70}{160}|, but this can be adjusted as desired: +To change the viewpoint, one can make use of the fact, that the \texttt{tikz-3dplot} package is used internally. By default, the \tikzbrick{}s package uses \saminline|\tdplotsetmaincoords{70}{160}|, but this can be adjusted as desired: \begin{tcblisting}{title={Viewpoint}} \tdplotsetmaincoords{70}{110} \begin{tikzpicture} -\brick{4}{2} + \brick{4}{2} \end{tikzpicture} \end{tcblisting} -Caveat: don't move away too far from the default viewpoint, otherwise the correct rendering of the brick is not guaranteed. +Caveat: don't move away too far from the default viewpoint, otherwise the correct rendering of the brick is not guaranteed. In addition to these \tikzbrick specific options, one can also use all normal Ti\emph{k}Z options: \begin{tcblisting}{title={Ti\emph{k}Z options}} \begin{tikzpicture} -\brick[scale=1.5]{1}{1} -\brick[xshift=3cm]{2}{2} + \brick[scale=1.5]{1}{1} + \brick[xshift=3cm]{2}{2} \end{tikzpicture} \end{tcblisting} \section{Wall building} -So what to do with the \tikzbrick{}s? Like with any other building blocks, they are made to build things. Using the \lstinline|wall| environment one can place \lstinline|\wallbrick| besides each other. +So what to do with the \tikzbrick{}s? Like with any other building blocks, they are made to build things. Using the \saminline|wall| environment one can place \saminline|\wallbrick| besides each other. -Due to the perspective and order of drawing, the wall is build from bottom to top and from right to left. To leave gaps or change into another layer, one can add to the \lstinline|brickx|, \lstinline|bricky| and \lstinline|brickz| counters. +Due to the perspective and order of drawing, the wall is build from bottom to top and from right to left. To leave gaps or change into another layer, one can add to the \saminline|brickx|, \saminline|bricky| and \saminline|brickz| counters. -Inside the \lstinline|wall| environment one can use \lstinline|\newrow| as a shortcut to go one row up and back to the start at the right hand side. +Inside the \saminline|wall| environment one can use \saminline|\newrow| as a shortcut to go one row up and back to the start at the right hand side. \begin{tcblisting}{title={Wall building}} \begin{wall} \wallbrick[color=blue]{2}{1} @@ -248,30 +201,29 @@ Inside the \lstinline|wall| environment one can use \lstinline|\newrow| as a sho \wallbrick[color=orange]{1}{1} \newrow \addtocounter{brickx}{1}{1} - \wallbrick[color=cyan]{4}{1} + \wallbrick[color=teal]{4}{1} \end{wall} \end{tcblisting} -\clearpage \section{img2bricks (by @Scott Pakin)} -To make creating large structures easier, \href{https://github.com/spakin}{Scott Pakin} contributed the \lstinline|img2bricks| python script, which converts image into \tikzbrick{}s. The script can be downloaded from \url{https://github.com/samcarter/TikZbricks/blob/main/img2bricks}. +To make creating large structures easier, \href{https://github.com/spakin}{Scott Pakin} contributed the \saminline|img2bricks| python script, which converts image into \tikzbrick{}s. The script can be downloaded from \url{https://github.com/samcarter/TikZbricks/blob/main/img2bricks}. The script can be executed with python: -\begin{tcolorbox}[lower separated=false] -\begin{lstlisting} +\begin{tcolorbox}[righthand width=0cm,title={Usage}] +\begin{samcode} python3 img2bricks image.png -\end{lstlisting} +\end{samcode} \end{tcolorbox} -Additional options are -\begin{tcolorbox}[lower separated=false,,righthand width=0cm,right=0cm] -\begin{lstlisting}[columns=flexible] --h, --help show an help message +Additional options are +\begin{tcolorbox}[righthand width=0cm,title={Options}] +\begin{samcode} +-h, --help show an help message --output LATEX-FILE, -o LATEX-FILE name of output file ---depth DEPTH depth of each brick ---widths NUM[,NUM] comma-separated list of allowable brick widths -\end{lstlisting} +--depth DEPTH depth of each brick +--widths NUM[,NUM] comma-separated list of allowable brick widths +\end{samcode} \end{tcolorbox} When preparing an image to convert into \tikzbrick{}s: @@ -289,62 +241,62 @@ One example inspired by the documentation of the \href{https://www.ctan.org/pkg title={Brick Duck}, text above listing, sidebyside=false, - breakable + breakable, + righthand width=0cm, } \begin{wall}[scale=0.5] \addtocounter{brickx}{3} \wallbrick[color=yellow!80!orange]{6}{2} \newrow \addtocounter{brickx}{2} - \wallbrick[color=yellow!80!orange]{8}{2} + \wallbrick[color=yellow!80!orange]{8}{2} \newrow \addtocounter{brickx}{1} - \wallbrick[color=yellow!80!orange]{3}{2} + \wallbrick[color=yellow!80!orange]{3}{2} \addtocounter{brickx}{4} - \wallbrick[color=yellow!80!orange]{3}{2} + \wallbrick[color=yellow!80!orange]{3}{2} \newrow \addtocounter{brickx}{1} - \wallbrick[color=yellow!80!orange]{2}{2} + \wallbrick[color=yellow!80!orange]{2}{2} \addtocounter{brickx}{1} - \wallbrick[color=yellow!80!orange]{4}{2} + \wallbrick[color=yellow!80!orange]{4}{2} \addtocounter{brickx}{1} - \wallbrick[color=yellow!80!orange]{3}{2} + \wallbrick[color=yellow!80!orange]{3}{2} \newrow \addtocounter{brickx}{1} - \wallbrick[color=yellow!80!orange]{8}{2} + \wallbrick[color=yellow!80!orange]{8}{2} \addtocounter{brickx}{1} - \wallbrick[color=yellow!80!orange]{2}{2} + \wallbrick[color=yellow!80!orange]{2}{2} \newrow \addtocounter{brickx}{2} - \wallbrick[color=yellow!80!orange]{11}{2} + \wallbrick[color=yellow!80!orange]{11}{2} \newrow \addtocounter{brickx}{3} - \wallbrick[color=yellow!80!orange]{7}{2} + \wallbrick[color=yellow!80!orange]{7}{2} \addtocounter{brickx}{1} - \wallbrick[color=yellow!80!orange]{2}{2} + \wallbrick[color=yellow!80!orange]{2}{2} \newrow \addtocounter{brickx}{1} - \wallbrick[color=orange]{3}{2} - \wallbrick[color=yellow!80!orange]{3}{2} + \wallbrick[color=orange]{3}{2} + \wallbrick[color=yellow!80!orange]{3}{2} \addtocounter{brickx}{5} - \wallbrick[color=yellow!80!orange]{1}{2} + \wallbrick[color=yellow!80!orange]{1}{2} \newrow - \wallbrick[color=orange]{3}{2} - \wallbrick[color=yellow!80!orange]{5}{2} + \wallbrick[color=orange]{3}{2} + \wallbrick[color=yellow!80!orange]{5}{2} \newrow \addtocounter{brickx}{2} - \wallbrick[color=orange]{1}{2} - \wallbrick[color=yellow!80!orange]{1}{2} - \wallbrick[color=black]{1}{2} - \wallbrick[color=yellow!80!orange]{3}{2} - \newrow + \wallbrick[color=orange]{1}{2} + \wallbrick[color=yellow!80!orange]{1}{2} + \wallbrick[color=black]{1}{2} + \wallbrick[color=yellow!80!orange]{3}{2} + \newrow \addtocounter{brickx}{2} - \wallbrick[color=yellow!80!orange]{6}{2} + \wallbrick[color=yellow!80!orange]{6}{2} \newrow \addtocounter{brickx}{3} - \wallbrick[color=yellow!80!orange]{4}{2} + \wallbrick[color=yellow!80!orange]{4}{2} \end{wall} \end{tcblisting} - \end{document} diff --git a/graphics/pgf/contrib/tikzbricks/tikzbricks.sty b/graphics/pgf/contrib/tikzbricks/tikzbricks.sty index bc8889a971..01b070bb60 100644 --- a/graphics/pgf/contrib/tikzbricks/tikzbricks.sty +++ b/graphics/pgf/contrib/tikzbricks/tikzbricks.sty @@ -12,7 +12,7 @@ % See http://www.latex-project.org/lppl.txt % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\ProvidesPackage{tikzbricks}[2022/07/21 v0.4 Drawing bricks with TikZ] +\ProvidesPackage{tikzbricks}[2024/04/26 version v0.5 Drawing bricks with TikZ] \RequirePackage{tikz} \RequirePackage{tikz-3dplot} |