% File: rpgicons-doc.tex % Copyright 2024 Jasper Habicht (mail(at)jasperhabicht.de). % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License version 1.3c, % available at http://www.latex-project.org/lppl/. % % This file is part of the `rpgicons' package (The Work in LPPL) % and all files in that bundle must be distributed together. % % This work has the LPPL maintenance status `maintained'. % \documentclass[a4paper]{article} \def\rpgiconsfileversion{1.8.3} \def\rpgiconsfiledate{15 May 2024} \usepackage[T1]{fontenc} \usepackage{Alegreya} \usepackage{AlegreyaSans} \usepackage{FiraMono} \usepackage{geometry, longtable, booktabs, tcolorbox, hyperref} \geometry{margin=25mm, left=45mm} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \renewcommand{\headrulewidth}{0pt} \fancyfoot[R]{\thepage} \linespread{1.1}\selectfont \addtolength{\skip\footins}{1em plus 5pt} \makeatletter \renewcommand*{\thefootnote}{\fnsymbol{footnote}} \renewcommand{\@makefntext}[1]{% \noindent\hbox to 0.75em{\normalfont\@thefnmark\hss}~#1% } \makeatother \tcbuselibrary{listings} \lstdefinestyle{rpgiconsdocmacro}{ basicstyle=\small\ttfamily, literate=*{<}{{{\color{black!50}\guilsinglleft}}}1 {>}{{{\color{black!50}\guilsinglright}}}1, keywords={}, moredelim=[is][\bfseries]{|}{|}, moredelim=[is][\color{black!50}]{!}{!}, } \lstdefinestyle{rpgiconsdoccodeexample}{ basicstyle=\small\ttfamily, keywords={}, } \hypersetup{colorlinks} \ExplSyntaxOn \int_new:N \l_rpgicons_doc_change_int \NewDocumentCommand{\changes}{ m m m }{ \int_incr:N \l_rpgicons_doc_change_int \prop_new:c { l_rpgicons_doc_change_ \int_to_roman:n { \l_rpgicons_doc_change_int } _prop } \prop_put:cnn { l_rpgicons_doc_change_ \int_to_roman:n { \l_rpgicons_doc_change_int } _prop } { version } {#1} \prop_put:cnn { l_rpgicons_doc_change_ \int_to_roman:n { \l_rpgicons_doc_change_int } _prop } { date } {#2} \prop_put:cnn { l_rpgicons_doc_change_ \int_to_roman:n { \l_rpgicons_doc_change_int } _prop } { changes } {#3} } \NewDocumentCommand{\printchanges}{ }{ \section{Changes} \begin{description} \int_step_inline:nn { \l_rpgicons_doc_change_int } { \item[ \prop_item:cn { l_rpgicons_doc_change_ \int_to_roman:n { ##1 } _prop } { version } ] ( \prop_item:cn { l_rpgicons_doc_change_ \int_to_roman:n { ##1 } _prop } { date } ) \\ \prop_item:cn { l_rpgicons_doc_change_ \int_to_roman:n { ##1 } _prop } { changes } } \end{description} } \tl_new:N \l_rpgicons_doc_doctitle_tl \NewExpandableDocumentCommand{\makedoctitle}{ o m o m m o m }{ \hypersetup{ pdfauthor={#5}, pdftitle={\IfValueTF{#1}{#1}{#2}}, pdfsubject={\IfValueTF{#3}{#3}{#4}} } \tl_set:Nn \l_rpgicons_doc_doctitle_tl { \group_begin: \tcbset{ title ~ style ~ hook/.style={ boxrule=2pt, fontupper=\huge\ttfamily } } \setlength{\parindent}{0pt}\sffamily \Huge{\bfseries #2}\par\bigskip \Large #4\par\bigskip \large #5 \IfValueT{#6}{ \,\footnote{#6}\par\bigskip } #7\par\bigskip \rule{\textwidth}{.08em} \group_end: } } \NewExpandableDocumentCommand{\printdoctitle}{ }{ \tl_use:N \l_rpgicons_doc_doctitle_tl } \ExplSyntaxOff \tcbset{ size=small, arc=2.5pt, outer arc=2.5pt, colframe=black!10, colback=black!10, title style hook/.style={} } \NewTCBListing{macrodef}{ }{ listing only, listing style={rpgiconsdocmacro}, grow to left by=2cm, boxrule=0pt, after={\par\smallskip\noindent} } \NewTCBListing{codeexample}{ }{ text side listing, lefthand width=4.5cm, listing style={rpgiconsdoccodeexample}, after={\par\smallskip\noindent} } \NewTotalTCBox{\macro}{ O{} v }{ verbatim, size=tight, arc=1pt, outer arc=1pt, top=0.5pt, bottom=0.5pt, left=2pt, right=2pt, boxrule=0pt, colframe=black!10, colback=black!10, fontupper=\small\ttfamily, #1 }{\vphantom{/g}\lstinline^#2^} \NewTotalTCBox{\titlemacro}{ s O{} m }{ verbatim, size=tight, arc=1pt, outer arc=1pt, top=0.5pt, bottom=0.5pt, left=2pt, right=2pt, boxrule=0pt, colframe=black!10, colback=black!10, fontupper=\small\ttfamily, title style hook, #2 }{\vphantom{/g}\IfBooleanT{#1}{\textbackslash}#3} \usepackage{rpgicons-l3} \usepackage[pics]{rpgicons-pgf} \ExplSyntaxOn \clist_new:N \l_rpgicons_doc_logo_icons_clist \clist_new:N \l_rpgicons_doc_logo_colors_clist \cs_generate_variant:Nn { \color_set:nnn } { nne } \clist_set:Nn \l_rpgicons_doc_logo_colors_clist { 264653 , 287271 , 2a9d8f , e9c46a , f4a261 , e76f51 } \int_step_inline:nn { \clist_count:N \l_rpgicons_doc_logo_colors_clist } { \color_set:nne { rpgiconslogo \int_to_roman:n { #1 } } { HTML } { \clist_item:Nn \l_rpgicons_doc_logo_colors_clist { #1 } } } \clist_set:Nn \l_rpgicons_doc_logo_icons_clist { twentyside , charisma , armor , buff , ranged , proficiency } \NewDocumentCommand{\rpgiconslogo}{ O{1} }{ \draw_begin: \draw_transform_scale:n { #1 } \int_step_inline:nn { \clist_count:N \l_rpgicons_doc_logo_icons_clist } { \hcoffin_set:Nn \l_tmpa_coffin { \draw_suspend_begin: \RPGIconsAbility[negative]{ \clist_item:Nn \l_rpgicons_doc_logo_icons_clist { ##1 } }[color=rpgiconslogo \int_to_roman:n { ##1 } ] \draw_suspend_end: } \draw_scope_begin: \draw_transform_shift:n { % fix bug in older l3draw version \cs_if_exist:NTF \__draw_transform_shift:nnnn { \draw_point_polar:nn { 0.33cm } { 60 * ##1 + 10 } } { \draw_point_transform:n { \draw_point_polar:nn { 0.33cm } { 60 * ##1 + 10 } } } } \draw_coffin_use:Nnn \l_tmpa_coffin { hc } { vc } \draw_scope_end: } \draw_end: } \ExplSyntaxOff \NewDocumentEnvironment{rpgiconsiconlist}{ }{ \begin{longtable}{ @{} p{20em} p{5em} p{\dimexpr\linewidth-25em-4\tabcolsep} @{} } \toprule \textbf{Command} & \textbf{Icon} & \textbf{Shape} \\ \midrule\endhead }{ \bottomrule \end{longtable} } \makedoctitle [The rpgicons package] {The \titlemacro{rpgicons} package} {A set of high-quality icons for use in notes for tabletop role-playing games} {Jasper Habicht}[E-mail: \href{mailto:mail@jasperhabicht.de}{mail@jasperhabicht.de}. I am grateful to Joseph Wright who fixes bugs at an astonishing speed and to all other contributors to this package.] {Version \rpgiconsfileversion, released on \rpgiconsfiledate} \changes{v1.1.0}{2023/08/15}{First public release.} \changes{v1.1.1}{2023/11/15}{Fudge dice icon added.} \changes{v1.1.2}{2023/11/16}{Bug fixed that caused wrong spacing when using dice icons without quantifier.} \changes{v1.2.0}{2023/11/20}{Corrections in the manual. Icons for six-sided dice with one to nine pips, plus sign and minus sign added.} %\changes{v1.2.1}{2023/11/20}{Documentation of lengths for spacing added.} %\changes{v1.2.2}{2023/11/21}{Corrections in the manual.} \changes{v1.3.0}{2023/11/21}{Option to set background color added. Renamed global option.} \changes{v1.3.1}{2024/02/18}{Correction of initializing code. Correction of default value of after sep. Addition of pics.} %\changes{v1.3.2}{2024/02/19}{Reformatting of the manual.} %\changes{v1.3.4}{2024/02/20}{Minor corrections of some shapes.} \changes{v1.4.0}{2024/02/21}{L3 variant added.} \changes{v1.4.1}{2024/02/21}{Corrections in L3 variant.} \changes{v1.4.2}{2024/02/21}{Alternative set of commands in L3 variant defined.} \changes{v1.4.3}{2024/02/22}{Added option to L3 variant to enable upward compatibility.} \changes{v1.4.4}{2024/02/24}{Added styles for every instance of command or shape, correction of recent \titlemacro{l3draw} code.} \changes{v1.5.0}{2024/02/25}{Alternative set of commands defined, added support of styles in pics.} \changes{v1.5.1}{2024/02/28}{Addition of opacity to L3 variant.} \changes{v1.5.2}{2024/02/29}{Unification of scaling, minor corrections.} \changes{v1.5.3}{2024/03/03}{Optimisation of code in L3 variant.} \changes{v1.5.4}{2024/03/06}{Correction of baseline settings in L3 variant, added accessibililty support for L3 variant.} %\changes{v1.5.5}{2024/03/07}{Optimsation of accessibililty support for L3 variant.} \changes{v1.6.0}{2024/03/15}{Four attribute icons added, minor correction of styles.} \changes{v1.6.1}{2024/03/16}{Unified size of negative attribute icon.} \changes{v1.7.0}{2024/03/16}{Macro for easy typesetting using roll dice syntax added in L3 variant, compatibility mode updated.} \changes{v1.8.0}{2024/03/24}{Unified wrapper to load either package variant.} \changes{v1.8.2}{2024/04/28}{Roll dice syntax for PGF variant.} \changes{v1.8.3}{2024/05/15}{Minor compatibility fix. Example of how to use pics added to ducumentation.} \begin{document} \vspace*{-1cm} \noindent\rpgiconslogo[4] \bigskip \printdoctitle \bigskip \section{Introduction} The \macro{rpgicons} package provides a set of high-quality icons for use in notes for tabletop role-playing games. The icons are meant to be used in the body text, but they can also be used in other contexts such as graphics or diagrams. The package comes in two variants, a L3 variant based on the \macro{l3draw} package which is loaded per default and a PGF variant based on PGF/Ti\emph{k}Z. \section{Loading the package} To install the package, copy the relevant package files \macro{rpgicons.sty}, \macro{rpgicons-l3.sty} and \macro{rpgicons-pgf.sty} into the working directory or into the \macro{texmf} directory. After the package has been installed, the \macro{rpgicons} package is loaded by calling \macro{\usepackage{rpgicons}} in the preamble of the document. \begin{macrodef}l3\end{macrodef} The L3 variant of the package is loaded by default. To load it explicitly, the package can be loaded using the option \macro{l3}. Alternatively, \macro{\usepackage{rpgicons-l3}} can be called instead. \begin{macrodef}pgf\end{macrodef} To load the PGF variant of the package the package needs to be loaded with the option \macro{pgf}. Alternatively, \macro{\usepackage{rpgicons-pgf}} can be called instead. \subsection{Dependencies} The L3 variant of the package loads the \macro{l3draw} package. If the package is loaded with the \macro{opacity} option to enable transparency, the \macro{l3opacity} package is also loaded. The PGF variant of the package loads the \macro{tikz} package which in turn loads the \macro{xcolor} package. To make use of specific options these packages provide, you need to load the packages with the relevant options beforehand or use, such as \macro{\PassOptionsToPackage{svgnames}{xcolor}}. \section{Main user commands} Regardless of the variant of the package, a set of user commands is always available. These are described in the following. Depending on the use of the L3 or the PGF variant, certain specific commands or options are available that are explained in the following sections in further detail. Because of the way the package defines the icons, every of the below described user commands can actually be used together with every shape. However, the combinations of shapes and commands as described in the following subsections are preferable. \subsection[Command \textbackslash die]{Command \titlemacro*{die}} \begin{macrodef} |\die|[