]> git.donarmstrong.com Git - lilypond.git/commitdiff
Change lilypond-book's LaTeX environment option placement
authorDavid A. Kastrup <dak@gnu.org>
Sun, 25 Apr 2010 16:26:07 +0000 (17:26 +0100)
committerGraham Percival <graham@percival-music.ca>
Sun, 25 Apr 2010 16:26:07 +0000 (17:26 +0100)
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.

Documentation/changes.tely
Documentation/de/usage/lilypond-book.itely
Documentation/es/usage/lilypond-book.itely
Documentation/ja/usage/lilypond-book.itely
Documentation/usage/latex-example.latex
Documentation/usage/latex-lilypond-example.latex
Documentation/usage/lilypond-book.itely
scripts/lilypond-book.py

index 3bc51314cc934072bb3d83a0f6cbfe9c0ad674f5..da4b0f2fa447ac4a82cb9aa056a62d0e20fb52bd 100644 (file)
@@ -64,6 +64,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.
index bc7380773b88cb9d4be80ecaa282db6be8cb894b..de73af87464547245b8e06d4f85eabc5736d45e0 100644 (file)
@@ -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
index ee8556998842ff2a05dea2635d75b880274a217d..2eb1a365c737de8243332374d120a7c7bcb5e635 100644 (file)
@@ -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@}
index 074c73dcf574a29632bb558519a2869f12fea056..04449579e4fe5799d9a8d387270ed16d11df2633 100644 (file)
@@ -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
index bbc3bbacabb7e5a262b7f1559806dc22e8809a8a..a622c305e4a0bdd92d9de65c4e433717eba3482d 100644 (file)
@@ -11,7 +11,7 @@
 \end{lilypond}
 
 
-\begin[fragment]{lilypond}
+\begin{lilypond}[fragment]
 c d e
 \end{lilypond}
 
index a8b799badba8691393a5148c438b244ae4eca53c..dbb057dfeb7f4c682abad73a3565f8a3e1fdbeca 100644 (file)
@@ -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}
 
index cf8517ec900c6b7eaed30d341fe31f88fceeabd0..5bcd6668fc369e62679868963e4653f6d1d1bdc8 100644 (file)
@@ -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@}
index b4bd319a690d3b35aa27b969a7d0b4edd2d0435a..5b9adede20ab5c287f8a4aca7141a243fa5141ef 100644 (file)
@@ -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})''',