]> git.donarmstrong.com Git - lilypond.git/commitdiff
Lilypond-book: Some more test cases for latex
authorReinhold Kainhofer <reinhold@kainhofer.com>
Mon, 7 Jun 2010 15:09:53 +0000 (17:09 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Sat, 3 Jul 2010 11:26:52 +0000 (13:26 +0200)
24 files changed:
input/regression/lilypond-book/html-lilypond-block.html [new file with mode: 0644]
input/regression/lilypond-book/suffix-itely.itely [new file with mode: 0644]
input/regression/lilypond-book/suffix-lyxml.lyxml [new file with mode: 0644]
input/regression/lilypond-book/suffix-tely.tely [new file with mode: 0644]
input/regression/lilypond-book/suffix-texi.texi [new file with mode: 0644]
input/regression/lilypond-book/suffix-texinfo.texinfo [new file with mode: 0644]
input/regression/lilypond-book/tex-auto-linebreak.lytex [new file with mode: 0644]
input/regression/lilypond-book/tex-comment-firstline.lytex [new file with mode: 0644]
input/regression/lilypond-book/tex-comments.lytex [new file with mode: 0644]
input/regression/lilypond-book/tex-compatibility-mode.lytex [new file with mode: 0644]
input/regression/lilypond-book/tex-footnote.lytex [new file with mode: 0644]
input/regression/lilypond-book/tex-fragment.lytex [new file with mode: 0644]
input/regression/lilypond-book/tex-graphics-package-added.lytex [new file with mode: 0644]
input/regression/lilypond-book/tex-include-file-latex.lytex [deleted file]
input/regression/lilypond-book/tex-include-file.lytex [new file with mode: 0644]
input/regression/lilypond-book/tex-include-options.lytex [new file with mode: 0644]
input/regression/lilypond-book/tex-lilypond-block.lytex [new file with mode: 0644]
input/regression/lilypond-book/tex-lilypond-inside-itemize.lytex [new file with mode: 0644]
input/regression/lilypond-book/tex-lilypond-inside-table.lytex [new file with mode: 0644]
input/regression/lilypond-book/tex-lilypondversion.lytex [new file with mode: 0644]
input/regression/lilypond-book/tex-paragraphs.lytex [new file with mode: 0644]
input/regression/lilypond-book/tex-snippet-options.lytex [new file with mode: 0644]
input/regression/lilypond-book/tex-twocolumn.lytex [new file with mode: 0644]
input/regression/lilypond-book/tex-verbatim.lytex [new file with mode: 0644]

diff --git a/input/regression/lilypond-book/html-lilypond-block.html b/input/regression/lilypond-book/html-lilypond-block.html
new file mode 100644 (file)
index 0000000..dfaf1c1
--- /dev/null
@@ -0,0 +1,10 @@
+<html>
+
+A simple lilypond snippet as a stand-alone paragraph:
+
+<lilypond>
+\relative c' {\repeat unfold 20 c4}
+</lilypond>
+
+
+</html>
diff --git a/input/regression/lilypond-book/suffix-itely.itely b/input/regression/lilypond-book/suffix-itely.itely
new file mode 100644 (file)
index 0000000..8b89751
--- /dev/null
@@ -0,0 +1,14 @@
+\input texinfo @c -*- coding: utf-8; mode: texinfo; -*-
+@setfilename suffix-itely.info
+@settitle lilypond-book Suffix test for itely
+
+@node Top
+@top Suffix test for itely
+
+Testing lilypond-book texinfo mode with .itely file suffix.
+@lilypond[fragment,relative=2]
+\key c \minor c4 e d2
+@end lilypond
+
+
+@bye
diff --git a/input/regression/lilypond-book/suffix-lyxml.lyxml b/input/regression/lilypond-book/suffix-lyxml.lyxml
new file mode 100644 (file)
index 0000000..0e8c8ae
--- /dev/null
@@ -0,0 +1,14 @@
+<book id="lyxml_suffix_test">
+    <title></title>
+    <chapter id="lyxml_test">
+        <title>Suffix test for lyxml</title>
+        <para>Testing lilypond-book DocBook mode with .lyxml file suffix.</para>
+        <inlinemediaobject>
+          <textobject>
+            <programlisting language="lilypond" role="fragment verbatim staffsize=16 ragged-right relative=2">
+              \key c \minor c4 es g2
+            </programlisting>
+          </textobject>
+        </inlinemediaobject>
+    </chapter>
+</book>
\ No newline at end of file
diff --git a/input/regression/lilypond-book/suffix-tely.tely b/input/regression/lilypond-book/suffix-tely.tely
new file mode 100644 (file)
index 0000000..60a2eb0
--- /dev/null
@@ -0,0 +1,14 @@
+\input texinfo @c -*- coding: utf-8; mode: texinfo; -*-
+@setfilename suffix-tely.info
+@settitle lilypond-book Suffix test for tely
+
+@node Top
+@top Suffix test for tely
+
+Testing lilypond-book texinfo mode with .tely file suffix.
+@lilypond[fragment,relative=2]
+\key c \minor c4 e d2
+@end lilypond
+
+
+@bye
diff --git a/input/regression/lilypond-book/suffix-texi.texi b/input/regression/lilypond-book/suffix-texi.texi
new file mode 100644 (file)
index 0000000..0670343
--- /dev/null
@@ -0,0 +1,14 @@
+\input texinfo @c -*- coding: utf-8; mode: texinfo; -*-
+@setfilename suffix-texi.info
+@settitle lilypond-book Suffix test for texi
+
+@node Top
+@top Suffix test for texi
+
+Testing lilypond-book texinfo mode with .texi file suffix.
+@lilypond[fragment,relative=2]
+\key c \minor c4 e d2
+@end lilypond
+
+
+@bye
diff --git a/input/regression/lilypond-book/suffix-texinfo.texinfo b/input/regression/lilypond-book/suffix-texinfo.texinfo
new file mode 100644 (file)
index 0000000..11cea15
--- /dev/null
@@ -0,0 +1,14 @@
+\input texinfo @c -*- coding: utf-8; mode: texinfo; -*-
+@setfilename suffix-texinfo.info
+@settitle lilypond-book Suffix test for texinfo
+
+@node Top
+@top Suffix test for texinfo
+
+Testing lilypond-book texinfo mode with .texinfo file suffix.
+@lilypond[fragment,relative=2]
+\key c \minor c4 e d2
+@end lilypond
+
+
+@bye
diff --git a/input/regression/lilypond-book/tex-auto-linebreak.lytex b/input/regression/lilypond-book/tex-auto-linebreak.lytex
new file mode 100644 (file)
index 0000000..a76e9e1
--- /dev/null
@@ -0,0 +1,22 @@
+\documentclass[a4paper]{article}
+
+\begin{document}
+
+Documents for \verb+lilypond-book+ may freely mix music and text. The music
+snippets will be properly line-broken. For example,
+
+\begin{lilypond}
+\relative c' {
+  c2 g'2 \times 2/3 { f8 e d } c'2 g4
+  c,2 g'2 \times 2/3 { f8 e d } c'2 g4
+  c,2 g'2 \times 2/3 { f8 e d } c'2 g4
+  c,2 g'2 \times 2/3 { f8 e d } c'2 g4
+  c,2 g'2 \times 2/3 { f8 e d } c'2 g4
+  c,2 g'2 \times 2/3 { f8 e d } c'2 g4
+  c,2 g'2 \times 2/3 { f8 e d } c'2 g4
+  c,2 g'2 \times 2/3 { f8 e d } c'2 g4
+}
+\end{lilypond}
+
+
+\end{document}
\ No newline at end of file
diff --git a/input/regression/lilypond-book/tex-comment-firstline.lytex b/input/regression/lilypond-book/tex-comment-firstline.lytex
new file mode 100644 (file)
index 0000000..5d0ae0c
--- /dev/null
@@ -0,0 +1,17 @@
+% A comment on the first line should not confuse lilypond-book's format
+% detection
+\documentclass[a4paper, 12pt]{article}
+
+\begin{document}
+
+\section{A coment on the first line of the file}
+
+This should not confuse the auto-detection of lilypond-book...
+
+\begin{lilypond}
+\score{
+  \relative c'{c d e f g a b c}
+}
+\end{lilypond}
+
+\end{document}
diff --git a/input/regression/lilypond-book/tex-comments.lytex b/input/regression/lilypond-book/tex-comments.lytex
new file mode 100644 (file)
index 0000000..72bf7f2
--- /dev/null
@@ -0,0 +1,28 @@
+\documentclass[a4paper, 12pt]{article}
+
+\begin{document}
+
+
+\subsection{LaTeX comments}
+This is a line with lilypond code
+after the comment char % \lilypond{\context Voice <<c' e' g'>>}
+% \lilypond{\context Voice <<c' e' g'>>}
+
+If you do not see any music above
+this line, then lilypond-book is handling latex comments pretty well :-)
+
+The following snippet is preceded by a comment that would start a lilypond
+environment
+
+%%\begin{lilypond}
+\begin{lilypond}[11pt,fragment]
+\context Voice <<c' e' g'>>
+\end{lilypond}
+
+A single-line comment inside a fragment does not confuse lilypond-book:
+
+\begin{lilypond}[fragment]
+c d e %\score
+\end{lilypond}
+
+\end{document}
diff --git a/input/regression/lilypond-book/tex-compatibility-mode.lytex b/input/regression/lilypond-book/tex-compatibility-mode.lytex
new file mode 100644 (file)
index 0000000..aab288e
--- /dev/null
@@ -0,0 +1,10 @@
+\documentclass[a4paper, 12pt]{article}
+
+\begin{document}
+\section{LilyPond snippets with deprecated options}
+
+A snippet with a deprecated option, triggering compatibility mode:
+
+\lilypond[11pt,fragment]{c' e' g'}
+
+\end{document}
diff --git a/input/regression/lilypond-book/tex-footnote.lytex b/input/regression/lilypond-book/tex-footnote.lytex
new file mode 100644 (file)
index 0000000..cd7c930
--- /dev/null
@@ -0,0 +1,11 @@
+\documentclass[a4paper, 12pt]{article}
+
+\begin{document}
+\section{LilyPond snippets in a footnote}
+
+Test for snippets in a footnote\footnote{Here's the footnote:
+\lilypond[fragment]{c' e' g'} }:
+\marginpar{ Yes, even as marginpar
+\lilypond[fragment]{c' d' e'} }
+
+\end{document}
diff --git a/input/regression/lilypond-book/tex-fragment.lytex b/input/regression/lilypond-book/tex-fragment.lytex
new file mode 100644 (file)
index 0000000..4adc809
--- /dev/null
@@ -0,0 +1,19 @@
+\documentclass[a4paper, 12pt]{article}
+
+\begin{document}
+
+\section{Using lilypond-book's fragment option}
+
+If a snippet is not a fully valid LilyPond file, you have
+to use the \verb|fragment| option:
+
+\begin{lilypond}[fragment]
+c d e
+\end{lilypond}
+
+% TODO: \verb does not yet work!!!
+There is also a shorthand version %\verb|\lilypond[fragment]{c' e' g'}|:
+
+\lilypond[fragment]{c' e' g'}
+
+\end{document}
diff --git a/input/regression/lilypond-book/tex-graphics-package-added.lytex b/input/regression/lilypond-book/tex-graphics-package-added.lytex
new file mode 100644 (file)
index 0000000..d94360a
--- /dev/null
@@ -0,0 +1,10 @@
+\documentclass[a4paper]{article}
+
+\begin{document}
+
+\section{Lilypond-book should add the graphicx package}
+
+If a latex file does not yet include the graphicx package, it is added by
+lilypond-book.
+
+\end{document}
diff --git a/input/regression/lilypond-book/tex-include-file-latex.lytex b/input/regression/lilypond-book/tex-include-file-latex.lytex
deleted file mode 100644 (file)
index 6705a7f..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-\documentclass{article}
-\begin{document}
-Including Lilypond file:
-\lilypondfile{include2.ly}
-\end{document}
diff --git a/input/regression/lilypond-book/tex-include-file.lytex b/input/regression/lilypond-book/tex-include-file.lytex
new file mode 100644 (file)
index 0000000..6705a7f
--- /dev/null
@@ -0,0 +1,5 @@
+\documentclass{article}
+\begin{document}
+Including Lilypond file:
+\lilypondfile{include2.ly}
+\end{document}
diff --git a/input/regression/lilypond-book/tex-include-options.lytex b/input/regression/lilypond-book/tex-include-options.lytex
new file mode 100644 (file)
index 0000000..a53fb5d
--- /dev/null
@@ -0,0 +1,5 @@
+\documentclass{article}
+\begin{document}
+Including Lilypond file with options (quote and noindent):
+\lilypondfile[quote,noindent]{include2.ly}
+\end{document}
diff --git a/input/regression/lilypond-book/tex-lilypond-block.lytex b/input/regression/lilypond-book/tex-lilypond-block.lytex
new file mode 100644 (file)
index 0000000..ad76d3c
--- /dev/null
@@ -0,0 +1,15 @@
+\documentclass[a4paper, 12pt]{article}
+
+\begin{document}
+
+\section{Simple lilypond blocks}
+
+A simple scale:
+
+\begin{lilypond}
+\score{
+  \relative c' { c d e f g a b c }
+}
+\end{lilypond}
+
+\end{document}
diff --git a/input/regression/lilypond-book/tex-lilypond-inside-itemize.lytex b/input/regression/lilypond-book/tex-lilypond-inside-itemize.lytex
new file mode 100644 (file)
index 0000000..91d78bb
--- /dev/null
@@ -0,0 +1,21 @@
+\documentclass[a4paper, 12pt]{article}
+
+\begin{document}
+
+\section{Lilypond snippets inside lists:}
+
+Itemize environment:
+\begin{itemize}
+\item
+\lilypond[11pt,fragment]{ c'} do
+\item
+\lilypond[11pt,fragment]{d'} re
+\item
+\lilypond[11pt,fragment]{e'} mi
+\item
+\lilypond[11pt,fragment]{f'} fa
+\item
+\lilypond[11pt,fragment]{g'} sol
+\end{itemize}
+
+\end{document}
diff --git a/input/regression/lilypond-book/tex-lilypond-inside-table.lytex b/input/regression/lilypond-book/tex-lilypond-inside-table.lytex
new file mode 100644 (file)
index 0000000..a75c4df
--- /dev/null
@@ -0,0 +1,20 @@
+\documentclass[a4paper, 12pt]{article}
+
+\begin{document}
+
+\section{Lilypond snippets inside tables:}
+
+Tables:
+
+\begin{tabular}{|l|l|r|}
+\hline
+\em Notes & \em Name \\
+\hline
+\lilypond[11pt,fragment,filename="cdur"]{\context Voice <<c' e' g'>>} & major \\
+\lilypond[11pt,fragment]{\context Voice <<c' es' g'>>} & minor \\
+\lilypond[11pt,fragment]{\context Voice <<c' es' ges'>>} & diminished \\
+\lilypond[11pt,fragment]{\context Voice <<c' e' gis'>>} & augmented \\
+\hline
+\end{tabular}
+
+\end{document}
diff --git a/input/regression/lilypond-book/tex-lilypondversion.lytex b/input/regression/lilypond-book/tex-lilypondversion.lytex
new file mode 100644 (file)
index 0000000..d8102c7
--- /dev/null
@@ -0,0 +1,10 @@
+\documentclass[a4paper, 12pt]{article}
+
+\begin{document}
+
+Version: \lilypondversion
+
+A digit immediately after the version: \lilypondversion9
+A formula immediately after the version: \lilypondversion$x_k$
+
+\end{document}
diff --git a/input/regression/lilypond-book/tex-paragraphs.lytex b/input/regression/lilypond-book/tex-paragraphs.lytex
new file mode 100644 (file)
index 0000000..da24529
--- /dev/null
@@ -0,0 +1,30 @@
+\documentclass[a4paper, 12pt]{article}
+
+\begin{document}
+
+
+\section{Paragraphs and line spacing}
+
+Testing of spacing. The next music is surrounded by an empty line.
+text text text text text text text text text text text text
+text text text text text text text text text text text text
+
+\begin{lilypond}
+\score{ \relative c'{ c d e f g a b c} }
+\end{lilypond}
+
+text text text text text text text text text text text text
+text text text text text text text text text text text text
+text text text text text text text text text text text text
+
+Next has no empty lines.
+text text text text text text text text text text text text
+text text text text text text text text text text text text
+text text text text text text text text text text text text
+\begin{lilypond}
+\score{ \relative c'{ c d e f g a b c} }
+\end{lilypond}
+text text text text text text text text text text text text
+text text text text text text text text text text text text
+
+\end{document}
diff --git a/input/regression/lilypond-book/tex-snippet-options.lytex b/input/regression/lilypond-book/tex-snippet-options.lytex
new file mode 100644 (file)
index 0000000..1f175af
--- /dev/null
@@ -0,0 +1,38 @@
+\documentclass[a4paper, 12pt]{article}
+
+\begin{document}
+
+\section{Snippet options}
+
+Fragment:
+\begin{lilypond}[fragment]
+c d e %\score
+\end{lilypond}
+
+This shows the verbatim option:
+\begin{lilypond}[fragment,verbatim]
+c' d' e'
+\end{lilypond}
+
+printfilename:
+\lilypondfile[printfilename]{include.ly}
+
+staffsize:
+\begin{lilypond}[staffsize=7,fragment]
+\context Voice <<c' e' g'>>
+\end{lilypond}
+\lilypond[fragment,staffsize=7]{\context Voice <<c' es' g'>>}
+
+relative:
+\lilypond[relative=1]{ c4 f b e }
+
+quote:
+\lilypond[quote,fragment]{\relative c' c1 }
+
+fragment, quote, staffsize=26, verbatim:
+\begin{lilypond}[fragment,quote,staffsize=26,verbatim]
+  c'4 f16
+\end{lilypond}
+
+
+\end{document}
diff --git a/input/regression/lilypond-book/tex-twocolumn.lytex b/input/regression/lilypond-book/tex-twocolumn.lytex
new file mode 100644 (file)
index 0000000..69c10bb
--- /dev/null
@@ -0,0 +1,17 @@
+\documentclass[a4paper, 12pt]{article}
+
+\begin{document}
+\twocolumn
+
+\section{A latex file with two columns}
+
+In this example, the width auto-detection shall detect the two columns
+and produce snippets that have the smaller width for a column!
+
+\begin{lilypond}
+\score{
+  \relative c'{c d e f g a b c | c d e f g a b c | c d e f g a b c}
+}
+\end{lilypond}
+
+\end{document}
diff --git a/input/regression/lilypond-book/tex-verbatim.lytex b/input/regression/lilypond-book/tex-verbatim.lytex
new file mode 100644 (file)
index 0000000..363138d
--- /dev/null
@@ -0,0 +1,45 @@
+\documentclass[a4paper, 12pt]{article}
+
+\begin{document}
+
+\section{verb and verbatim}
+
+This file should not contain (and produce) any lilypond images!
+
+Snippets inside a verbatim environment or a comment are not run through
+lilypond, but left as is.
+
+% TODO: These do not yet work, as \verb is explicitly disabled in lilypond-book for now!
+% \verb|\lilypond[fragment]{c' d' e'}|
+%
+% and
+
+\begin{verbatim}
+\begin{lilypond}
+c d e
+\end{lilypond}
+\end{verbatim}
+
+
+As you can see, the begin/end lilypond commands inside
+do not confuse lilypond-book.
+
+% TODO: These do not yet work, as \verb is explicitly disabled in lilypond-book for now!
+% \verb|\begin{lilypond}[fragment]c d e\end{lilypond}|
+
+% \verb+\lilypondfile[quote,noindent]{screech-boink.ly}+
+
+Neither does a verbatim inside verb:
+
+\verb|\begin{verbatim}\begin{lilypond}[fragment]c d e\end{lilypond}\end{verbatim}|
+
+or verb inside verbatim:
+
+\begin{verbatim}
+\verb|\begin{lilypond}[fragment]c d e\end{lilypond}|
+\end{verbatim}
+
+But these are just to stress \verb|lilypond-book|.
+
+
+\end{document}