summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid A. Kastrup <dak@gnu.org>2010-04-25 17:26:07 +0100
committerGraham Percival <graham@percival-music.ca>2010-04-25 17:26:07 +0100
commitd43f0a2575409659fbdd21b9b17b5f8440cc7268 (patch)
tree87ee9d6da893de704093990e55f6104e556a873b
parent86f2ab02e1e54b34c9d450484a227f97973d673b (diff)
Change lilypond-book's LaTeX environment option placement
This changes the documented option placement for LaTeX "lilypond" environments in lilypond-book mode to have the options after the environment name, like customary with LaTeX environments. lilypond-book is adapted to accept both previous and new order.
-rw-r--r--Documentation/changes.tely16
-rw-r--r--Documentation/de/usage/lilypond-book.itely8
-rw-r--r--Documentation/es/usage/lilypond-book.itely8
-rw-r--r--Documentation/ja/usage/lilypond-book.itely8
-rw-r--r--Documentation/usage/latex-example.latex2
-rw-r--r--Documentation/usage/latex-lilypond-example.latex20
-rw-r--r--Documentation/usage/lilypond-book.itely10
-rw-r--r--scripts/lilypond-book.py4
8 files changed, 46 insertions, 30 deletions
diff --git a/Documentation/changes.tely b/Documentation/changes.tely
index 3bc51314cc..da4b0f2fa4 100644
--- a/Documentation/changes.tely
+++ b/Documentation/changes.tely
@@ -65,6 +65,22 @@ which scares away people.
@end ignore
@item
+The documented syntax of @samp{lilypond} environments in the @LaTeX{}
+mode of @command{lilypond-book} has been changed to conform with
+standard @LaTeX{} syntax: options now come after the environment name:
+@example
+\begin@{lilypond@}[@var{options}] @dots{}
+@end example
+
+The previous syntax with options after @samp{\begin} is still accepted
+by @command{lilypond-book} but deprecated. Something like
+@example
+sed -i '/begin\[/s/begin\(\[[^]]*]\)\(@{lilypond@}\)/begin\2\1/'
+@end example
+
+might do the trick for conversion.
+
+@item
Aesthetics of shape note heads have been enhanced. Variable line thicknesses
have been implemented. All note widths have been made consistent.
Minor shape note commands that use the relative major key for scale steps
diff --git a/Documentation/de/usage/lilypond-book.itely b/Documentation/de/usage/lilypond-book.itely
index bc7380773b..de73af8746 100644
--- a/Documentation/de/usage/lilypond-book.itely
+++ b/Documentation/de/usage/lilypond-book.itely
@@ -102,7 +102,7 @@ kombinieren. Zum Beispiel:
Optionen für \verb+lilypond+ werden dabei in eckige Klammern gesetzt.
-\begin[fragment,quote,staffsize=26,verbatim]{lilypond}
+\begin{lilypond}[fragment,quote,staffsize=26,verbatim]
c'4 f16
\end{lilypond}
@@ -207,7 +207,7 @@ Benutzung von @LaTeX{}.
Musikbeispiele können eingegeben werden als
@example
-\begin[Optionen,kommen,]@{lilypond@}
+\begin@{lilypond@}[Optionen,kommen,hierhin]
IHR LILYPOND QUELLCODE
\end@{lilypond@}
@end example
@@ -233,7 +233,7 @@ liefert eine Datei, die dann mit @LaTeX{} weiter verarbeitet werden kann.
Dies soll hier an einigen Beispielen gezeigt werden. Die @code{lilypond}-Umgebung
@example
-\begin[quote,fragment,staffsize=26]@{lilypond@}
+\begin@{lilypond@}[quote,fragment,staffsize=26]
c' d' e' f' g'2 g'2
\end@{lilypond@}
@end example
@@ -337,7 +337,7 @@ wird, ist die Ausgabe nur eines Systems trivial.
@example
\def\betweenLilyPondSystem#1@{\endinput@}
-\begin[fragment]@{lilypond@}
+\begin@{lilypond@}[fragment]
c'1\( e'( c'~ \break c' d) e f\)
\end@{lilypond@}
@end example
diff --git a/Documentation/es/usage/lilypond-book.itely b/Documentation/es/usage/lilypond-book.itely
index ee85569988..2eb1a365c7 100644
--- a/Documentation/es/usage/lilypond-book.itely
+++ b/Documentation/es/usage/lilypond-book.itely
@@ -97,7 +97,7 @@ música y texto. Por ejemplo:
Las opciones se escriben entre corchetes.
-\begin[fragment,quote,staffsize=26,verbatim]{lilypond}
+\begin{lilypond}[fragment,quote,staffsize=26,verbatim]
c'4 f16
\end{lilypond}
@@ -201,7 +201,7 @@ breve a @LaTeX{}) para ver una panorámica sobre cómo usar @LaTeX{}.
La música se introduce usando
@example
-\begin[las,opciones,van,aquí]@{lilypond@}
+\begin@{lilypond@}[las,opciones,van,aquí]
EL CÓDIGO DE LILYPOND
\end@{lilypond@}
@end example
@@ -229,7 +229,7 @@ que se puede procesar posteriormente con @LaTeX{}.
A continuación mostramos algunos ejemplos. El entorno @code{lilypond}
@example
-\begin[quote,fragment,staffsize=26]@{lilypond@}
+\begin@{lilypond@}[quote,fragment,staffsize=26]
c' d' e' f' g'2 g'2
\end@{lilypond@}
@end example
@@ -1079,7 +1079,7 @@ Texto normal en LaTeX.
Más texto en LaTeX, y las opciones dentro de los corchetes.
-\begin[fragment,relative=2,quote,staffsize=26,verbatim]@{lilypond@}
+\begin@{lilypond@}[fragment,relative=2,quote,staffsize=26,verbatim]
d4 c b a
\end@{lilypond@}
\end@{document@}
diff --git a/Documentation/ja/usage/lilypond-book.itely b/Documentation/ja/usage/lilypond-book.itely
index 074c73dcf5..04449579e4 100644
--- a/Documentation/ja/usage/lilypond-book.itely
+++ b/Documentation/ja/usage/lilypond-book.itely
@@ -97,7 +97,7 @@ For example,
Options are put in brackets.
-\begin[fragment,quote,staffsize=26,verbatim]{lilypond}
+\begin{lilypond}[fragment,quote,staffsize=26,verbatim]
c'4 f16
\end{lilypond}
@@ -201,7 +201,7 @@ to use @LaTeX{}.
Music is entered using
@example
-\begin[options,go,here]@{lilypond@}
+\begin@{lilypond@}[options,go,here]
YOUR LILYPOND CODE
\end@{lilypond@}
@end example
@@ -228,7 +228,7 @@ processed with @LaTeX{}.
We show some examples here. The @code{lilypond} environment
@example
-\begin[quote,fragment,staffsize=26]@{lilypond@}
+\begin@{lilypond@}[quote,fragment,staffsize=26]
c' d' e' f' g'2 g'2
\end@{lilypond@}
@end example
@@ -328,7 +328,7 @@ is trivial.
@example
\def\betweenLilyPondSystem#1@{\endinput@}
-\begin[fragment]@{lilypond@}
+\begin@{lilypond@}[fragment]
c'1\( e'( c'~ \break c' d) e f\)
\end@{lilypond@}
@end example
diff --git a/Documentation/usage/latex-example.latex b/Documentation/usage/latex-example.latex
index bbc3bbacab..a622c305e4 100644
--- a/Documentation/usage/latex-example.latex
+++ b/Documentation/usage/latex-example.latex
@@ -11,7 +11,7 @@
\end{lilypond}
-\begin[fragment]{lilypond}
+\begin{lilypond}[fragment]
c d e
\end{lilypond}
diff --git a/Documentation/usage/latex-lilypond-example.latex b/Documentation/usage/latex-lilypond-example.latex
index a8b799badb..dbb057dfeb 100644
--- a/Documentation/usage/latex-lilypond-example.latex
+++ b/Documentation/usage/latex-lilypond-example.latex
@@ -36,7 +36,7 @@ LilyPond-book search for the \verb|\score| command when it decides
if the code is only a fragment. Thus, in the following code, you have
to use \verb|fragment| option, because the comment confuses lilypond-book.
-\begin[fragment]{lilypond}
+\begin{lilypond}[fragment]
c d e % \score
\end{lilypond}
@@ -46,14 +46,14 @@ There is also a shorthand version \verb|\lilypond[fragment]{c' e' g'}|:
that is the same as writing
\begin{verbatim}
-\begin[fragment]{lilypond}
+\begin{lilypond}[fragment]
c' e' g'
\end{lilypond}
\end{verbatim}
This C major
-%%\begin[staffsize=11\pt,fragment]{lilypond}
-\begin[11pt,fragment]{lilypond}
+%%\begin{lilypond}[staffsize=11\pt,fragment]
+\begin{lilypond}[11pt,fragment]
\context Voice <<c' e' g'>>
\end{lilypond}
and C minor
@@ -64,16 +64,16 @@ and C minor
As you see, the begin/end verbatim command inside
does not confuse lilypond-book:
-\verb|\begin[fragment]{lilypond}c d e\end{lilypond}|
+\verb|\begin{lilypond}[fragment]c d e\end{lilypond}|
Neither does a verbatim inside verb:
-\verb|\begin{verbatim}\begin[fragment]{lilypond}c d e\end{lilypond}\end{verbatim}|
+\verb|\begin{verbatim}\begin{lilypond}[fragment]c d e\end{lilypond}\end{verbatim}|
or verb inside verbatim:
\begin{verbatim}
-\verb|\begin[fragment]{lilypond}c d e\end{lilypond}|
+\verb|\begin{lilypond}[fragment]c d e\end{lilypond}|
\end{verbatim}
But this is just to stress \verb|lilypond-book|. What you need is:
@@ -90,7 +90,7 @@ c d e
\subsection{The 'verbatim' and 'intertext' option}
This shows the verbatim option:
-\begin[fragment,verbatim, intertext="gives this music:"]{lilypond}
+\begin{lilypond}[fragment,verbatim, intertext="gives this music:"]
c' d' e'
\end{lilypond}
@@ -104,14 +104,14 @@ this line, then lilypond-book is handling latex comments pretty well :-)
\subsection{To float or not to float}
This music
-\begin[fragment]{lilypond}
+\begin{lilypond}[fragment]
c' e'
\end{lilypond}
should be floating inside the text by using the \verb|eps| options.
This music
-\begin[fragment]{lilypond}
+\begin{lilypond}[fragment]
c' e'
\end{lilypond}
diff --git a/Documentation/usage/lilypond-book.itely b/Documentation/usage/lilypond-book.itely
index cf8517ec90..5bcd6668fc 100644
--- a/Documentation/usage/lilypond-book.itely
+++ b/Documentation/usage/lilypond-book.itely
@@ -90,7 +90,7 @@ For example,
Options are put in brackets.
-\begin[fragment,quote,staffsize=26,verbatim]{lilypond}
+\begin{lilypond}[fragment,quote,staffsize=26,verbatim]
c'4 f16
\end{lilypond}
@@ -188,7 +188,7 @@ to use @LaTeX{}.
Music is entered using
@example
-\begin[options,go,here]@{lilypond@}
+\begin@{lilypond@}[options,go,here]
YOUR LILYPOND CODE
\end@{lilypond@}
@end example
@@ -215,7 +215,7 @@ processed with @LaTeX{}.
We show some examples here. The @code{lilypond} environment
@example
-\begin[quote,fragment,staffsize=26]@{lilypond@}
+\begin@{lilypond@}[quote,fragment,staffsize=26]
c' d' e' f' g'2 g'2
\end@{lilypond@}
@end example
@@ -315,7 +315,7 @@ is trivial.
@example
\def\betweenLilyPondSystem#1@{\endinput@}
-\begin[fragment]@{lilypond@}
+\begin@{lilypond@}[fragment]
c'1\( e'( c'~ \break c' d) e f\)
\end@{lilypond@}
@end example
@@ -1017,7 +1017,7 @@ Normal LaTeX text.
More LaTeX text, and options in square brackets.
-\begin[fragment,relative=2,quote,staffsize=26,verbatim]@{lilypond@}
+\begin@{lilypond@}[fragment,relative=2,quote,staffsize=26,verbatim]
d4 c b a
\end@{lilypond@}
\end@{document@}
diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py
index b4bd319a69..5b9adede20 100644
--- a/scripts/lilypond-book.py
+++ b/scripts/lilypond-book.py
@@ -464,10 +464,10 @@ snippet_res = {
r'''(?smx)
^[^%\n]*?
(?P<match>
- \\begin\s*(
+ \\begin\s*(?P<env>{lilypond}\s*)?(
\[
\s*(?P<options>.*?)\s*
- \])?\s*{lilypond}
+ \])?(?(env)|\s*{lilypond})
(?P<code>.*?)
^[^%\n]*?
\\end\s*{lilypond})''',