lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Automatically insert a space before and after a lilypond environment


From: Tommaso Gordini
Subject: Automatically insert a space before and after a lilypond environment
Date: Fri, 6 Sep 2013 15:57:50 +0200

Hello to all. I quote from the file usage.pdf in the section about lilypond-book:

"Each snippet will call the Following macros if they have been defined by the user:
\preLilyPondExample [...]
\postLilyPondExample [...]
\betweenLilyPondSystem [...]
»

A few pages after this point, there is a concrete example of use of the
\betweenLilyPondSystem command:

\newcommand {\betweenLilyPondSystem}[1]{\vspace{<length>}\linebreak}

This command inserts a vertical space equal to <length> between a system of staves and the next one. And it works well in my document

I tried to use in the same way also the commands \pre- and \postLilyPondSystem, but I did not see any results after compilation of my document. What should these two commands exactly? Maybe insert space before and after the example of music? How they must be used?

I'm writing a .tex document compiled with XeLaTeX tex in which use lilypond-book for musical snippets. Before and after

\begin {lilypond[<options>]
...
\end {lilypond}

I use explicit spacing commands such as \smallskip\medskip and \bigskip, but I know that this is not the correct way. Looking at the name '\preLilyPondExample' I thought that this command automatically put a space before each lilypond environment. An alternative is to put in turn lilypond environments inside a centerenvironmen:

\begin{center}
   \begin{lilypond}[<options>]
   ...
   \end{lilypond}
\end{center}

What would you do in this situation?

Here is my preamble (I work on Mac OS X 10.6.8):

% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = LilyPond-Book
% !LILYPOND tex = xelatex

\documentclass[%
   documentstructure=book,%
   style=elements,%
   captionstyle=italic,%
   tocstyle=ragged,
   crop=false%
   ]{suftesi}
% pacchetti specifici di xetex
\usepackage{ifxetex}
\ifxetex
\usepackage[T1]{fontenc}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX,Numbers=OldStyle]{Garamond Premier Pro}
\setsansfont[Scale=MatchLowercase]{Iwona}
\usepackage{polyglossia}
\setmainlanguage{italian}
\setotherlanguages{english,french,german}
\usepackage{lilyglyphs}
\else
\fi
% pacchetti comuni a xetex e pdftex
\usepackage{graphicx}
\graphicspath{{immagini/}}
\captionsetup{font={rm,it,small},justification=centering}
\usepackage{subfig}
\usepackage[italian]{varioref}
\usepackage[output-decimal-marker={,},detect-all]{siunitx}
\usepackage[hidelinks]{hyperref}

% nuovi comandi
\newcommand{\bemolle}{\ifxetex\,\lilyGlyph[scale=1.3,raise=0.5]{accidentals.flat}\else\fi}
\newcommand{\diesis}{\ifxetex\,\lilyGlyph[scale=1.1,raise=0.6]{accidentals.sharp}\else\fi}
\newcommand{\naturale}{\ifxetex\,\lilyGlyph[scale=1.2,raise=0.6]{accidentals.natural}\else\fi}
\newcommand{\ditoi}[1]{\ifxetex\lilyText[scale=1,raise=-0.05]{#1}\else\fi}
\newcommand{\ditoii}[2]{\ifxetex\lilyText[scale=1,raise=-0.05]{#1}-\lilyText[scale=1,raise=-0.05]{#2}\else\fi}
\newcommand{\ditoiii}[3]{\ifxetex\lilyText[scale=1,raise=-0.05]{#1}-\lilyText[scale=1,raise=-0.05]{#2}-\lilyText[scale=1,raise=-0.05]{#3}\else\fi}
\newcommand{\betweenLilyPondSystem}[1]{\vspace{5mm}\linebreak}

% comincia il documento
\begin{document}

Ciao e grazie

reply via email to

[Prev in Thread] Current Thread [Next in Thread]