texlive[51000] Master: chordbox (15apr19)

commits+karl at tug.org commits+karl at tug.org
Sun May 5 19:39:21 CEST 2019


Revision: 51000
          http://tug.org/svn/texlive?view=revision&revision=51000
Author:   karl
Date:     2019-05-05 19:39:20 +0200 (Sun, 05 May 2019)
Log Message:
-----------
chordbox (15apr19)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-music.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/chordbox/
    trunk/Master/texmf-dist/doc/latex/chordbox/README.md
    trunk/Master/texmf-dist/doc/latex/chordbox/chordbox.pdf
    trunk/Master/texmf-dist/doc/latex/chordbox/chordbox.tex
    trunk/Master/texmf-dist/tex/latex/chordbox/
    trunk/Master/texmf-dist/tex/latex/chordbox/chordbox.sty
    trunk/Master/tlpkg/tlpsrc/chordbox.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/chordbox/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/chordbox/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/chordbox/README.md	2019-05-05 17:39:20 UTC (rev 51000)
@@ -0,0 +1,44 @@
+# Chordbox
+
+A LaTeX package for drawing string instrument chord diagrams
+
+## Requirements
+
+Chordbox depends on the following LaTeX packages:
+* tikz;
+* xifthen;
+* xstrings.
+
+## Installation
+
+Please follow the procedure of your TeX distribution.
+
+## Usage
+
+After including `\usepackage{chordbox}` in your preamble, you can draw chord
+boxes using the commands `\chordbox` and `\bchordbox` (for barre chords).
+Examples:
+```
+\chordbox{Am}{x,0,2,2,1,0}
+\bchordbox{Bm}{x,2,4,4,3,2}{2}
+```
+
+For more examples including the graphics, please refer to the documentation.
+
+## Author
+
+* [Steven Franzen](https://github.com/sfranzen)
+
+## License
+
+Copyright 2018 Steven Franzen
+
+This work may be distributed and/or modified under the conditions of the LaTeX
+Project Public License, either version 1.3 of this license or (at your option)
+any later version. The latest version of this license is in
+http://www.latex-project.org/lppl.txt and version 1.3 or later is part of all
+distributions of LaTeX version 2005/12/01 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The Current Maintainer of this work is Steven Franzen.


Property changes on: trunk/Master/texmf-dist/doc/latex/chordbox/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/chordbox/chordbox.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/chordbox/chordbox.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/chordbox/chordbox.pdf	2019-05-05 17:38:46 UTC (rev 50999)
+++ trunk/Master/texmf-dist/doc/latex/chordbox/chordbox.pdf	2019-05-05 17:39:20 UTC (rev 51000)

Property changes on: trunk/Master/texmf-dist/doc/latex/chordbox/chordbox.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/chordbox/chordbox.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/chordbox/chordbox.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/chordbox/chordbox.tex	2019-05-05 17:39:20 UTC (rev 51000)
@@ -0,0 +1,472 @@
+%% LyX 2.3.2 created this file.  For more info, see http://www.lyx.org/.
+%% Do not edit unless you really know what you are doing.
+\documentclass[english]{scrartcl}
+\usepackage[osf]{libertineRoman}
+\usepackage[osf]{biolinum}
+\renewcommand{\ttdefault}{cmtt}
+\usepackage[libertine]{newtxmath}
+\usepackage[T1]{fontenc}
+\usepackage[latin9]{inputenc}
+\setcounter{tocdepth}{2}
+\usepackage{color}
+\usepackage{babel}
+\usepackage{booktabs}
+\usepackage{textcomp}
+\usepackage{url}
+\usepackage{microtype}
+\usepackage[unicode=true,
+ bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
+ breaklinks=false,pdfborder={0 0 0},pdfborderstyle={},backref=false,colorlinks=false]
+ {hyperref}
+
+\makeatletter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
+\newcommand{\noun}[1]{\textsc{#1}}
+\newcommand*\LyXZeroWidthSpace{\hspace{0pt}}
+%% Because html converters don't know tabularnewline
+\providecommand{\tabularnewline}{\\}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
+\usepackage{chordbox}
+\usepackage{filecontents}
+
+\newcommand\TikZ{Ti\emph{k}Z}
+\newcommand\version{v1.0}
+\hypersetup{
+	pdftitle={Chordbox \version\ Documentation},
+	pdfauthor={Steven Franzen}
+}
+\setkomafont{descriptionlabel}{\ttfamily\color{red}}
+\makeatletter
+\newcommand\namedlabel[2]{\begingroup
+   \def\@currentlabel{#2}%
+   \label{#1}\endgroup
+}
+\makeatother
+\begin{filecontents}{chordbox.bib}
+ at software{leadsheets,
+ 	author = {Clemens Niederberger},
+  	title = {leadsheets},
+  	url = {https://ctan.org/pkg/leadsheets/},
+  	version = {0.5b},
+  	date = {2017-09-26},
+}
+ at software{guitarchordschemes,
+ 	author = {Clemens Niederberger},
+  	title = {guitarchordschemes},
+  	url = {https://ctan.org/pkg/guitarchordschemes/},
+  	version = {0.7},
+  	date = {2016-08-16},
+}
+ at software{gchords,
+ 	author = {Kasper Peeters},
+  	title = {gchords},
+  	url = {https://ctan.org/pkg/gchords/},
+  	version = {1.20},
+  	date = {2008-02-03},
+}
+ at software{xifthen,
+ 	author = {Josselin Noirel},
+  	title = {xifthen},
+  	url = {https://ctan.org/pkg/xifthen/},
+  	version = {1.4.0},
+  	date = {2015-11-05},
+}
+ at software{xstring,
+ 	author = {Christian Tellechea},
+  	title = {xstring},
+  	url = {https://ctan.org/pkg/xstring/},
+  	version = {1.7c},
+  	date = {2013-10-13},
+}
+ at manual{pgfmanual,
+   author    = {Till Tantau},
+   title     = {The TikZ and PGF Packages},
+   subtitle  = {Manual for version 3.0.1a},
+   url       = {http://sourceforge.net/projects/pgf/},
+   date      = {2015-08-29},
+}
+\end{filecontents}
+
+\makeatother
+
+\usepackage[bibstyle=standard,citestyle=authortitle-comp]{biblatex}
+\addbibresource{chordbox.bib}
+\begin{document}
+\titlehead{\centering\chordbox[3]{G\sharp^{maj7}}{4,x,6,5,4,3}}
+\title{Chordbox}
+\subtitle{A \LaTeX{} package for drawing string instrument chord diagrams}
+\author{Steven Franzen}
+\date{\version\quad\today}
+\publishers{\url{https://github.com/sfranzen/chordbox}}
+
+\maketitle
+\tableofcontents{}
+
+\clearpage{}
+
+\section{Package introduction}
+
+This package is the result of a search similar to the one undertaken
+by Clemens Niederberger for his \texttt{leadsheets} \autocite{leadsheets}
+package: over the years I have collected many textual guitar tabs
+and chord sheets that I finally wanted to put together and typeset
+properly using \LaTeX , including guitar chord diagrams. The first
+part of my requirements is now more than fulfilled by \texttt{leadsheets},
+which provides all the tools for putting together chords and lyrics.
+For the second part I found that there were only two relevant existing
+packages: \texttt{guitarchordschemes}\autocite{guitarchordschemes}
+and \texttt{gchords}\autocite{gchords}. Neither of these achieved
+exactly what I wanted, so this package is my own attempt at providing
+that tool.
+
+Note that I am far from a \TeX{} guru; I know a bit of \LaTeX{} and
+also have some familiarity with \TikZ{}, so I have gratefully used
+the higher level interfaces provided by said package as well as \texttt{xifthen}\autocite{xifthen}
+and \texttt{xstring}\autocite{xstring} for inspecting arguments.
+The \noun{pgf}/\TikZ{} packages provide a powerful and versatile
+framework for creating vector graphics using \LaTeX{} commands paired
+with a special drawing syntax. One advantage of this is that you can
+fully integrate graphics into your document that will always look
+great: they will use the document fonts and can be rendered at any
+size you desire, avoiding some issues associated with the use of external
+images. This does not come without a cost, however; although the syntax
+introduced by \TikZ{} is concise and easy to read, composing images
+will require some thought, multiple commands and adjustments and can
+be labour-intensive. Also, there is simply so much functionality that
+the official manual\autocite{pgfmanual} currently spans almost 1200
+pages of dense, though amply illustrated information.
+
+The main aim of the present package is therefore to provide a way
+of typesetting chord diagrams using \TikZ{}, while sparing the user
+from the need to plough through its documentation to learn the required
+drawing syntax. It does this by defining two commands that require
+only a few arguments and encapsulate the necessary drawing instructions.
+Their basic usage is introduced in Section \ref{sec:Usage}, along
+with examples illustrating the various possibilities. Further information
+needed by the drawing algorithm is stored using \noun{pgf}/\TikZ{}'
+native key-value management system, which also makes it quite easy
+to expose settings for modification by the user, allowing you to influence
+the appearance of the resulting chord boxes. These are documented
+in Section \ref{sec:Settings}, with some examples of the commands
+you can use to change them.
+
+\subsection{Loading the package}
+
+\texttt{chordbox} currently does not support \LaTeX{} options, so it
+is loaded simply by putting
+
+\texttt{\textbackslash usepackage\{chordbox\}}\\
+in your document's preamble.
+
+\subsection{License}
+
+This file is part of chordbox. Chordbox may be distributed and/or
+modified under the conditions of the \LaTeX{} Project Public License,
+either version 1.3 of this license or (at your option) any later version.
+The latest version of this license is in \url{http://www.latex-project.org/lppl.txt}
+and version 1.3 or later is part of all distributions of \LaTeX{} version
+2005/12/01 or later.
+
+Chordbox has the \noun{lppl} maintenance status `maintained'. The
+Current Maintainer of chordbox is Steven Franzen.
+
+\section{Usage\label{sec:Usage}}
+
+The package provides two similar commands, \texttt{\textbackslash chordbox}
+and \texttt{\textbackslash bchordbox}. The latter extends the former
+to draw barred chords.
+
+\subsection{The \texttt{\textbackslash chordbox} command}
+
+Syntax: \texttt{\textbackslash chordbox{[}}\textlangle \emph{base
+fret}\textrangle \texttt{{]}\{}\textlangle \emph{chord name}\textrangle\texttt{\}\{}\textlangle \emph{fret
+positions}\textrangle\texttt{\}}
+
+The simplest form of the command requires you to specify only the
+\textlangle \emph{chord name}\textrangle{} and \textlangle \emph{fret
+positions}\textrangle . The former can contain any text and math symbols
+(see below), the latter should be a comma-separated list of elements,
+one for each string, which may take the following values:
+\begin{itemize}
+\item \textlangle \emph{fret number}\textrangle {[}:\textlangle \emph{fingering
+text}\textrangle {]}\\
+A (positive) \textlangle \emph{fret number}\textrangle{} marks the
+current string as fretted at that position. It may optionally be followed
+by a colon and a \textlangle \emph{fingering text}\textrangle{} that
+can be displayed on the fret symbol or below the chord box.
+\item \emph{0} (zero)\\
+Marks the current string as open (unfretted).
+\item \emph{Anything else}\\
+An empty element or one starting with anything other than a number
+marks the current string as muted (not played).
+\end{itemize}
+It draws a grid resembling vertical strings crossing horizontal frets,
+with a black bar at the top figuring as the instrument's nut. The
+number of strings drawn is determined by the number of \textlangle \emph{fret
+positions}\textrangle{} passed to the command, so generating chord
+diagrams for different instruments is no problem:
+\begin{center}
+\begin{tabular}{ccc}
+Ukulele & 5-string banjo & 6-string guitar\tabularnewline
+\texttt{\small{}\textbackslash chordbox\{Am\}\{2,0,0,0\}} & \texttt{\small{}\textbackslash chordbox\{Am\}\{x,2,2,1,2\}} & \texttt{\small{}\textbackslash chordbox\{Am\}\{x,0,2,2,1,0\}}\tabularnewline
+\chordbox{Am}{2,0,0,0} & \chordbox{Am}{x,2,2,1,2} & \chordbox{Am}{x,0,2,2,1,0}\tabularnewline
+\end{tabular}
+\par\end{center}
+
+The number of frets drawn is initially 4, but this can be changed
+through the configuration key \texttt{\ref{key:numfrets}}.
+
+As mentioned, you can optionally provide fingering information for
+a chord, which is particularly useful for writing chord charts and
+other training materials. Because text on the fret symbol has to be
+scaled to fit inside it and the default scale is small, \texttt{chordbox}
+is initially configured to put this text below the strings, where
+it can be rendered at a larger size. However, the other option may
+be more appealing for larger diagrams, so both options can be used,
+see \texttt{\ref{key:textbelow}} and \texttt{\ref{key:textonnode}}.
+They are illustrated below, where the letter T is used for the thumb
+and the digits for the other fingers, starting at 1 for the index
+finger. The larger chord box on the right has been given a scale of
+2.5 times the default.
+\begin{center}
+\begin{tabular}[t]{cc}
+\multicolumn{2}{c}{\texttt{\small{}\textbackslash chordbox\{F\}\{1:T,3:3,3:4,2:2,1:1,x\}}}\tabularnewline
+\chordbox{F}{1:T,3:3,3:4,2:2,1:1,x} & \pgfkeys{/chordbox/.cd,text on node=fingering,text below=none}
+\tikzset{chordbox/.append style={scale=2}}
+\chordbox{F}{1:T,3:3,3:4,2:2,1:1,x}\tabularnewline
+\end{tabular}
+\par\end{center}
+
+By default, the \textlangle \emph{chord name}\textrangle{} is processed
+by a command that typesets it in math mode and roman type (see \texttt{\nameref{key:name}}).
+This allows the use of math symbols like \texttt{\textbackslash flat}
+and \texttt{\textbackslash sharp} as well as the \textasciicircum{}
+(superscript) operator to typeset decorated chord names:
+\begin{center}
+\begin{tabular}{cc}
+\texttt{\small{}\textbackslash chordbox\{B\textbackslash flat m\}\{x,x,x,3,2,1\}} & \texttt{\small{}\textbackslash chordbox\{F\textbackslash sharp\textasciicircum\{maj7\}\}\{2,x,3,3,2,x\}}\tabularnewline
+\chordbox{B\flat m}{x,x,x,3,2,1} & \chordbox{F\sharp^{maj7}}{2,x,3,3,2,x}\tabularnewline
+\end{tabular}
+\par\end{center}
+
+For best results, make sure to select the same typeface for both text
+and math typesetting. Of course, if you are also using the \texttt{leadsheets}
+package, you could opt to use its \texttt{\textbackslash writechord}
+command for typesetting chord names, see also subsection \ref{subsec:Other-keys}.
+
+The \textlangle \emph{base fret}\textrangle{} is the number that,
+although formally an optional argument, must be provided for chords
+extending past the number of frets in the chord box. It is used to
+position the box and fretted notes relative to this fret, for example
+\texttt{\textbackslash chordbox{[}6{]}\{D\textbackslash sharp m\textasciicircum\{7\textbackslash flat
+5\}\}\{x,6,7,6,7,x\}}:
+
+\chordbox[6]{D\sharp m^{7\flat 5}}{x,6,7,6,7,x}
+
+As can be seen, the nut is not drawn in these cases.
+
+Finally, \texttt{chordbox} can also display the pitch of each note
+in a chord, although the default is not to. The pitches do not need
+to be specified manually, but are determined from the fret positions
+given to the command and the configured tuning (\texttt{\ref{key:tuning}}).
+Just like fingering information, you may choose to display it inside
+the symbols or underneath the chord box, or combine both types of
+information:
+\begin{center}
+\begin{tabular}{rccc}
+Command & \multicolumn{3}{c}{\texttt{\small{}\textbackslash chordbox\{D\}\{x,x,0,2:1,3:3,2:2\}}}\tabularnewline
+\midrule
+Scale & default & 2.5 $\times$ larger & 2.5 $\times$ larger\tabularnewline
+\texttt{text on node} & \texttt{none} & \texttt{pitch} & \texttt{fingering}\tabularnewline
+\texttt{text below} & \texttt{pitch} & \texttt{none} & \texttt{pitch}\tabularnewline
+\midrule
+Result & \pgfkeys{/chordbox/text below=pitch}
+\chordbox{D}{x,x,0,2,3,2} & \pgfkeys{/chordbox/text on node=pitch}
+\tikzset{chordbox/.append style={scale=2.5}}
+\chordbox{D}{x,x,0,2,3,2} & \pgfkeys{/chordbox/.cd,text on node=fingering,text below=pitch}
+\tikzset{chordbox/.append style={scale=2.5}}
+\chordbox{D}{x,x,0,2:1,3:3,2:2}\tabularnewline
+\bottomrule
+\end{tabular}
+\par\end{center}
+
+Chords may of course feature accidentals on some or all of their notes,
+depending on their associated musical key. Typesetting such pitches
+clearly in limited space is more challenging than just single characters,
+such as finger positions. With \TikZ{}, text is most conveniently
+positioned using so-called \emph{nodes}, which can also be scaled
+to display their contents at any size. This leads to the following
+two possible choices:
+\begin{enumerate}
+\item Scale the nodes to the chord box, so they are always as large as possible
+without overlapping;
+\item Do not scale the nodes, but choose a fixed font size for the text,
+small enough to avoid overlap at the chosen scale.
+\end{enumerate}
+The first option has the advantage that overlap is precluded entirely,
+but the node text is scaled as well and will therefore need to be
+changed to a size near that of the unscaled node. Additionally, the
+scaling operation is a purely graphical transformation, which yields
+worse results than selecting a similar font size in the first place.
+This is because a well-designed font has different (namely slightly
+thicker) glyphs for smaller sizes to maintain readability. The second
+option instead has the disadvantage that a font size must be chosen
+manually and calibrated to the size of the chord boxes one wishes
+to render. However, because documents will not usually contain chord
+boxes of many different sizes, I consider this to be a minor point
+and have, at least for now, chosen the second option. The font size
+initially configured specifically for pitch names below the strings
+is \texttt{\textbackslash tiny}, which should produce readable results
+even for the default chord box size.
+
+\subsection{The \texttt{\textbackslash bchordbox} command}
+
+Syntax: \texttt{\textbackslash bchordbox{[}}\textlangle \emph{base
+fret}\textrangle \texttt{{]}\{}\textlangle \emph{chord name}\textrangle\texttt{\}\{}\textlangle \emph{fret
+positions}\textrangle\texttt{\}\{}\textlangle \emph{barre frets}\textrangle\texttt{\}}
+
+As mentioned, this command is for drawing barre chords, for which
+it requires an additional comma-separated list of fret numbers. A
+thick line is drawn over the string symbols at these frets. The other
+arguments are identical to those of \texttt{\textbackslash chordbox},
+see for example \texttt{\textbackslash bchordbox\{Bm\textasciicircum 7\}\{x,2,4,2,3,2\}\{2\}}
+and \texttt{\textbackslash bchordbox{[}3{]}\{C\}\{x,3,5,5,5,3\}\{3,5\}}:
+
+\bchordbox{Bm^7}{x,2,4,2,3,2}{2} \bchordbox[3]{C}{x,3,5,5,5,3}{3,5}
+
+\section{Settings\label{sec:Settings}}
+
+Because \texttt{chordbox} relies on \noun{pgf}/\TikZ{} for drawing,
+it makes sense to use the powerful \noun{pgf} key management system
+that comes with it. Therefore this package stores its code and style
+settings as keys, some of which may be modified to customise the output.
+This can be done in the preamble or in any part of the document by
+means of \texttt{\textbackslash tikzset} and the more generic \texttt{\textbackslash pgfkeys}
+command. Some examples of usage will be given below, but for more
+reading about \noun{pgf} keys and their handling please refer to Section
+82 of the \noun{pgf} manual\autocite{pgfmanual} where everything
+is documented in full detail. In any case, modifying a key stores
+its value for the \LaTeX{} group where the command is issued and its
+child groups, which can override it again, but it does not propagate
+up to parent groups.
+
+\subsection{\TikZ{} keys}
+
+The items described in this section are called \emph{styles} in \TikZ{}
+terminology and contain (lists of) keys and values that can be applied
+to various drawing commands. Most importantly, the \texttt{chordbox}
+style applies to the whole \texttt{\{tikzpicture\}} environment of
+every chord box produced. The default setting is to scale all coordinates
+by a quarter, because the drawing is done in \noun{pgf}'s ``natural''
+units that, though convenient to use, result in an impractically large
+picture. Note that this scaling only influences the \TikZ{} coordinates;
+in particular, fonts are not affected by default\footnote{This is because text is put in nodes, which are scaled independently
+of the picture and require the \texttt{scale} and/or \texttt{transform
+shape} options to be supplied.}.
+
+Because these keys are all stored in the \texttt{/tikz} path, it is
+most convenient to change them using the \texttt{\textbackslash tikzset}
+command, for example \texttt{\textbackslash tikzset\{chordbox/.style=\{scale=0.4,
+thick\}\}}. Setting options like this through the \texttt{.style}
+\emph{key handler}, as it is called, replaces any previous contents.
+Other handlers, like \texttt{.prefix style} and \texttt{.append style},
+can be used to insert additional keys before or after the existing
+style, respectively. For example, calling \texttt{\textbackslash tikzset\{chordbox/.append
+style=\{scale=2\}\}} results in an effective \texttt{chordbox} style
+of \texttt{\{baseline, scale=0.5\}}, because the \texttt{scale} factor
+was set twice. These are special in that multiple values are multiplied
+together, whereas for most other keys only the last occurrence applies.
+\begin{description}
+\item [{/tikz/chordbox}] \hfill{}(style, initially \texttt{\{baseline,
+scale=0.25\}})\\
+This style is applied to every \texttt{\{tikzpicture\}} environment
+produced by this package. The \texttt{baseline} key sets the base
+line of the picture at a height of 0 pt, which is the top of the grid
+and the bottom of the nut (if drawn). It ensures that multiple chord
+boxes in a row align properly.
+\item [{/tikz/fret~node~text}] \hfill{}(style, initially \texttt{\{font=\textbackslash Large\textbackslash bfseries,text=white\}})\\
+This style is applied to text drawn on fretted or open string nodes,
+with the colour switched to black for the latter. It aims to make
+the text as clear and as big as possible without increasing the node
+size, which will occur if the text is too tall or wide.
+\item [{/tikz/pitch~text~below}] \hfill{}(style, initially \texttt{\{font=\textbackslash tiny\}})\\
+This affects only pitch names typeset below the chord box. The initial
+setting is \texttt{\textbackslash tiny} to keep neighbouring notes
+with accidentals from overlapping each other at the default scale.
+\end{description}
+The rest of the styles define the three symbol shapes used for the
+fretted (\tikz[chordbox,above]\coordinate[string=fretted];), open
+(\tikz[chordbox]\coordinate[string=open];) and muted (\tikz[chordbox]\coordinate[string=muted];)
+string positions.
+\begin{description}
+\item [{/tikz/string/base}] \hfill{}(style, initially \texttt{\{circle,
+draw, inner sep=0, minimum size=20, transform shape\}})\\
+Common options for all three symbols. The \texttt{transform shape}
+option is required to correctly scale the symbols, which are implemented
+as \TikZ{} nodes, with the rest of the picture.
+\item [{/tikz/string/fretted}] \hfill{}(style, initially \texttt{\{string/base,
+fill\}})
+\item [{/tikz/string/open}] \hfill{}(style, initially \texttt{\{string/base,
+above\}})
+\item [{/tikz/string/muted}] \hfill{}(style, initially \texttt{\{string/open,
+cross out, minimum size=19\}})
+\end{description}
+
+\subsection{Other keys\label{subsec:Other-keys}}
+
+The following keys are not passed directly to \TikZ{} commands, but
+used to store various other settings and code. They are all in the
+\texttt{/chordbox} path and should be set using the \texttt{\textbackslash pgfkeys}
+command, for example \texttt{\textbackslash pgfkeys\{/chordbox/name/.code=\textbackslash writechord\{\#1\}\}}.
+Keys that execute code, like this example, produce output with occurrences
+of \texttt{\#1} replaced by the relevant value. If you want to change
+more than one of these settings at once, it is shorter to issue a
+command like the following: \texttt{\textbackslash pgfkeys\{/chordbox/.cd,
+numfrets=5, fingering text=on node\}}.
+\begin{description}
+\item [{/chordbox/numfrets\texttt{\textcolor{black}{\small{}=\textlangle }}\texttt{\textcolor{black}{\emph{\small{}number}}}\texttt{\textcolor{black}{\small{}\textrangle }}\namedlabel{key:numfrets}{/chordbox/numfrets}}] \hfill{}(initially
+\texttt{4}) \\
+The number of frets drawn in each chord box.
+\item [{/chordbox/base~fret}] \hfill{}(initially \texttt{\{fr\textbackslash raisebox\{.5ex\}\{\textbackslash scriptsize\#1\}})\\
+This key stores the code used to typeset the base fret position of
+a chord box, if provided and greater than 1.
+\item [{/chordbox/name\label{key:name}}] \hfill{}(initially \texttt{\textbackslash ensuremath\{\textbackslash mathrm\{\#1\}\}})\\
+The code that is used to typeset the name of the chord.
+\end{description}
+The next two keys govern the placement of extra information in the
+chord box. In both cases, the \texttt{fingering} text is only displayed
+if actually present in the input.
+\begin{description}
+\item [{/chordbox/text~below\texttt{\textcolor{black}{\small{}=none|fingering|pitch}}\namedlabel{key:textbelow}{/chordbox/text below}}] \hfill{}(initially
+\texttt{fingering})\\
+Selects what to display below each string.
+\item [{/chordbox/text~on~node\texttt{\textcolor{black}{\small{}=none|fingering|pitch}}\namedlabel{key:textonnode}{/chordbox/text on node}}] \hfill{}(initially
+\texttt{none})\\
+Selects what to display inside the string symbols.
+\end{description}
+The remaining keys determine how pitch information is calculated and
+displayed. Pitches should be given enclosed in quotation marks and
+accidentals should be specified as \texttt{b} (flat) or \texttt{\textbackslash\#}
+(sharp); these will be replaced by their respective symbols.
+\begin{description}
+\item [{/chordbox/flat~symbol\texttt{\textcolor{black}{\small{}=\textlangle }}\texttt{\textcolor{black}{\emph{\small{}symbol}}}\texttt{\textcolor{black}{\small{}\textrangle{}}}}] \hfill{}(initially
+\texttt{\textbackslash flat})
+\item [{/chordbox/sharp~symbol\texttt{\textcolor{black}{\small{}=\textlangle }}\texttt{\textcolor{black}{\emph{\small{}symbol}}}\texttt{\textcolor{black}{\small{}\textrangle{}}}}] \hfill{}(initially
+\texttt{\textbackslash sharp})
+\item [{/chordbox/pitch~names\texttt{\textcolor{black}{\small{}=\textlangle }}\texttt{\textcolor{black}{\emph{\small{}list~of~pitches}}}\texttt{\textcolor{black}{\small{}\textrangle{}}}}] \hfill{}(initially
+\texttt{\{\textquotedbl A\textquotedbl ,\textquotedbl A\textbackslash\#\textquotedbl ,\textquotedbl B\textquotedbl ,\textquotedbl C\textquotedbl ,\textquotedbl C\textbackslash\#\textquotedbl ,\LyXZeroWidthSpace\textquotedbl D\textquotedbl ,\textquotedbl D\textbackslash\#\textquotedbl ,\textquotedbl E\textquotedbl ,\textquotedbl F\textquotedbl ,\textquotedbl F\textbackslash\#\textquotedbl ,\textquotedbl G\textquotedbl ,\textquotedbl G\textbackslash\#\textquotedbl\}})\\
+The names of the pitches to be used for display. The list need not
+start at A, but it must contain twelve sequential semitones.
+\item [{/chordbox/tuning\texttt{\textcolor{black}{\small{}=\textlangle }}\texttt{\textcolor{black}{\emph{\small{}list~of~pitches}}}\texttt{\textcolor{black}{\small{}\textrangle }}\namedlabel{key:tuning}{/chordbox/tuning}}] \hfill{}(initially
+\texttt{\{"E","A","D","G","B","E"\}})\\
+The tuning of the instrument for which chord boxes are to be drawn.
+It is used to determine the pitches of the chord and must consist
+of elements present in \texttt{pitch names}.
+\end{description}
+
+\appendix
+\printbibliography[heading=bibintoc]
+
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/latex/chordbox/chordbox.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/chordbox/chordbox.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/chordbox/chordbox.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/chordbox/chordbox.sty	2019-05-05 17:39:20 UTC (rev 51000)
@@ -0,0 +1,210 @@
+%
+% Copyright 2018 Steven Franzen
+%
+% This file is part of chordbox.
+%
+% Chordbox may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License, either version 1.3 of this license or (at your
+% option) any later version. The latest version of this license is in
+% http://www.latex-project.org/lppl.txt and version 1.3 or later is part of all
+% distributions of LaTeX version 2005/12/01 or later.
+%
+% Chordbox has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of chordbox is Steven Franzen.
+%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{chordbox}[2019/04/14 v1.0 Minor improvement to documentation]
+
+\RequirePackage{tikz, xifthen, xstring}
+\usetikzlibrary{shapes.misc, scopes, backgrounds}
+
+\newif\ifcb at startbarre
+
+% Set up keys for the drawing code
+\pgfqkeys{/chordbox}{
+    % This fills a bar of width 0.4 that scales properly, without requiring
+    % extra libraries
+    draw barre/.code 2 args={%
+        \fill (#1) -- +(0, -0.2) -| (#2) -- +(0, 0.2) -| cycle;
+    },
+    draw barre/.value required,
+    % Number of frets displayed
+    numfrets/.initial=4,
+    % Base fret number parser
+    base fret/.code={fr\raisebox{.5ex}{\scriptsize#1}},
+    % Chord name parser
+    name/.code=\ensuremath{\mathrm{#1}},
+    name/.value required,
+    % Configuration of text below the chord box and on the nodes
+    text below/.is choice,
+    text below/none/.code={\def\cb at textbelow{0}},
+    text below/fingering/.code={\def\cb at textbelow{1}},
+    text below/pitch/.code={\def\cb at textbelow{2}},
+    text below/fingering,
+    text on node/.is choice,
+    text on node/none/.code={\def\cb at textonnode{0}},
+    text on node/fingering/.code={\def\cb at textonnode{1}},
+    text on node/pitch/.code={\def\cb at textonnode{2}},
+    text on node/none,
+    % Symbols for pitch notation
+    flat symbol/.initial=\flat,
+    sharp symbol/.initial=\sharp,
+    % Pitch name settings; arrays only seem to work with TeX macros
+    pitch names/.store in=\cb at pitchnames,
+    pitch names={"A","A\#","B","C","C\#","D","D\#","E","F","F\#","G","G\#"},
+    tuning/.store in=\cb at tuning,
+    tuning={"E","A","D","G","B","E"},
+    % The base fret of a given chord box
+    @basefret/.initial=1,
+    % Calculate the given fret position #1, corrected for the base fret
+    @fretnum/.code=\pgfmathtruncatemacro{\fretnum}{%
+        1 + #1 - \pgfkeysvalueof{/chordbox/@basefret}
+    },
+    % Whether the barre has yet to be started
+    @start barre/.is if=cb at startbarre,
+    % Find and typeset pitch of string number #1 at fret number #2
+    @typeset pitch/.code 2 args={
+        \pgfmathparse{{\cb at tuning}[#1-1]}
+        \ifnum#2=0
+            \pgfkeys{@replace symbols=\pgfmathresult}
+        \else
+            \foreach \p in {0,...,11} {%
+                \pgfmathsetmacro{\stringpitch}{{\cb at pitchnames}[\p]}%
+                \if\stringpitch\pgfmathresult
+                    \pgfmathparse{{\cb at pitchnames}[mod(\p + #2, 12)]}
+                    \pgfkeys{@replace symbols=\pgfmathresult}%
+                    \breakforeach
+                \fi
+            }
+        \fi
+    },
+    % Replace pitch text with math symbols
+    @replace symbols/.code={%
+        \def\#{\ensuremath{\pgfkeysvalueof{/chordbox/sharp symbol}}}%
+        \StrSubstitute{#1}{b}{%
+            \ensuremath{\pgfkeysvalueof{/chordbox/flat symbol}}%
+        }
+    }
+}
+
+% Define tikz drawing styles. The muted string symbol size is slightly smaller
+% to make it visually similar to the open symbol. Both are also placed above
+% their given coordinate for better separation from the box.
+\tikzset{
+    chordbox/.style={baseline, scale=0.25},
+    chordbox/.value forbidden,
+    fret node text/.style={font=\Large\bfseries,text=white},
+    fret node text/.value forbidden,
+    pitch text below/.style={font=\tiny},
+    string/.is choice,
+    string/base/.style={%
+        circle, draw, inner sep=0, minimum size=20, transform shape%
+    },
+    string/fretted/.style={string/base, fill},
+    string/open/.style={string/base, above},
+    string/muted/.style={string/open, cross out, minimum size=19}
+}
+
+% Environment with parts common to both commands
+\newenvironment{chordboxenv}[3]{%
+    \pgfqkeys{/chordbox}{@basefret={#1}, numfrets/.get=\numfrets}
+    \pgfqkeys{}{.search also=/chordbox}
+    % The code that draws the chord box. Argument #1 specifies the base fret
+    % (>1) of the chord box, #2 is the chord name and #3 the comma-separated
+    % list of finger positions, e.g. {x,0,2:2,2:3,1:1,0}.
+    \begin{tikzpicture}[chordbox]%
+        % Put coordinates at finger positions and above the frets (index 0),
+        % store string count, then draw the string grid and decorations
+        \foreach[count=\n] \fretposition in {#3} {
+            \foreach \fret in {0,...,\numfrets}
+                \coordinate (\n\fret) at (\n - 1, 0.5 - \fret);
+            % Extra coordinate for text below each string
+            \coordinate (\n) at (\n - 1, -\numfrets);
+        }
+        \draw grid (\n - 1, -\numfrets);
+        \ifthenelse{\isempty{#1}\or#1<2}{% Draw the "nut"
+            \fill rectangle (\n - 1, .2);
+        }{% Draw the position indicator
+            \node[left] at (11) {\pgfkeys{base fret={#1}}};
+        }
+        % Center chord name over strings
+        \pgfmathparse{0.5 * (\n - 1)}
+        \node[above] at (\pgfmathresult, 1.25) {\pgfkeys{name={#2}}};
+        % Draw the string symbols according to argument #3
+        \foreach[count=\s] \fret in {#3} {
+            \ifnum\pdfmatch{^[0-9]+}{\fret}=1
+                \StrBehind{\pdflastmatch 0}{>}[\num]
+                \StrBehind{\fret}{:}[\frettext]
+                \def\pitch{\pgfkeys{@typeset pitch={\s}{\num}}}
+                \let\nodetext\empty
+                \ifcase\cb at textonnode
+                \or
+                    \let\nodetext\frettext % 1
+                \or
+                    \let\nodetext\pitch % 2
+                \fi
+                \ifnum\num=0
+                    \node[string=open, fret node text, black] at (\s0)
+                        {\nodetext};
+                \else
+                    \pgfkeys{@fretnum=\num}
+                    \node[string=fretted, fret node text] at (\s\fretnum)
+                        {\nodetext};
+                \fi
+                % Display the "text below"
+                \ifnum\cb at textbelow>0
+                    \if1\cb at textbelow
+                        \if\frettext\empty
+                        \else
+                            \node[below] at (\s) {\frettext};
+                        \fi
+                    \else
+                        % Insert vphantom here to align all pitch names
+                        \node[below, pitch text below] at (\s)
+                            {\vphantom{\pgfkeys{@replace symbols=\#b}}\pitch};
+                    \fi
+                \fi
+            \else % Anything other than a number is taken to mean "muted"
+                \node[string=muted] at (\s0) {};
+            \fi
+        }
+}{%
+    \end{tikzpicture}
+}
+
+% Draw a chord box without barres, for example:
+%   \chordbox{Am}{x,0,2,2,1,0}
+%   \chordbox[5]{A}{5,7,7,6,5,5}
+\providecommand{\chordbox}[3][1]{%
+    \begin{chordboxenv}{#1}{#2}{#3}
+    \end{chordboxenv}
+}
+
+% Draw a chord box for a barre chord. Extra argument for the fret number(s)
+% whose notes should be barred, for example:
+%   \bchordbox[3]{C}{x,3,5,5,5,3}{3,5}
+\providecommand{\bchordbox}[4][1]{%
+    \begin{chordboxenv}{#1}{#2}{#3}
+        \foreach \b in {#4} {
+            \pgfkeys{@start barre=true, @fretnum=\b}
+            \foreach[count=\s] \f in {#3} {
+                \if\f\b
+                    \ifcb at startbarre
+                        \coordinate (start) at (\s\fretnum);
+                        \global\cb at startbarrefalse
+                    \else
+                        \coordinate (end) at (\s\fretnum);
+                    \fi
+                \fi
+            }
+            \scoped[on background layer]
+                \pgfkeys{draw barre={start}{end}};
+        }
+    \end{chordboxenv}
+}
+
+\endinput
+[2018/12/07 v0.3 Support for pitch info]
+[2018/12/04 v0.2 Support for fingering info, further customisation]
+[2018/12/01 v0.1 Initial release]


Property changes on: trunk/Master/texmf-dist/tex/latex/chordbox/chordbox.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2019-05-05 17:38:46 UTC (rev 50999)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2019-05-05 17:39:20 UTC (rev 51000)
@@ -153,7 +153,7 @@
     chemnum chemschemex chemsec chemstyle cherokee
     chess chess-problem-diagrams chessboard chessfss chet chextras
     chicago chicago-annote chickenize childdoc chivo
-    chkfloat chletter chngcntr chordbars chronology
+    chkfloat chletter chngcntr chordbars chordbox chronology
     chronosys chs-physics-report chscite churchslavonic
     cinzel circ circuitikz
     cite citeall citeref cje cjhebrew cjk cjk-gs-integrate cjk-ko cjkpunct

Added: trunk/Master/tlpkg/tlpsrc/chordbox.tlpsrc
===================================================================
Modified: trunk/Master/tlpkg/tlpsrc/collection-music.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-music.tlpsrc	2019-05-05 17:38:46 UTC (rev 50999)
+++ trunk/Master/tlpkg/tlpsrc/collection-music.tlpsrc	2019-05-05 17:39:20 UTC (rev 51000)
@@ -8,6 +8,7 @@
 depend autosp
 depend bagpipe
 depend chordbars
+depend chordbox
 depend figbas
 depend gchords
 depend gregoriotex



More information about the tex-live-commits mailing list