]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/macros.itexi
modified: Documentation/user/tutorial.itely Removed the section on polyphonic music...
[lilypond.git] / Documentation / user / macros.itexi
index 5b36bd3a508aa8c5d940d77d7b5d446debce059a..9dbf8a8ff3fb2406a08b446ec1ade52799f17a87 100644 (file)
-@c -*- coding: latin-1; mode: texinfo; -*-
+@c -*- coding: us-ascii; mode: texinfo; -*-
+@ignore
+    Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
 
-@c **** all formats ****
+    When revising a translation, copy the HEAD committish of the
+    version that you are working on.  See TRANSLATION for details.
+@end ignore
 
-@macro refbugs
-@noindent
-@subsubheading Bugs
 
-@end macro
+@include version.itexi
 
-@macro moreinfo
-@subheading More information
 
-@end macro
+@c Don't replace quotes with directed quotes.
 
-@macro seealso
-@noindent
-@subsubheading See also
+@set txicodequoteundirected
+@set txicodequotebacktick
 
-@end macro
 
-@macro refcommands
-@noindent
-@subsubheading Predefined commands
 
-@end macro
+@c   ***** Displaying text *****
 
-@macro context{NAME}
-@vindex \NAME\
-@code{\NAME\}@c should use internalsref
-@end macro
+@c We need this since @q{\} doesn't work with makeinfo 4.11 --
+@c say @q{@bs{}} instead.
 
-@macro refcommand{WHAT}
-@vindex \WHAT\
-@code{\WHAT\}
+@macro bs
+\\
 @end macro
 
-@macro commonprop
-@noindent
-@subsubheading Commonly tweaked properties
 
+@c To get decent quotes in `foo' and ``foo''.
+
+@macro q{TEXT}
+@quoteleft{}\TEXT\@quoteright{}
 @end macro
 
-@macro funindex {WORD}
-@findex \WORD\
-@kindex \WORD\
+@macro qq{TEXT}
+@quotedblleft{}\TEXT\@quotedblright{}
 @end macro
 
 
+@ifhtml
 
-@c  *** Macros with variable output ***
+@macro warning{TEXT}
+@cartouche
+@b{Note:} \TEXT\
+@end cartouche
+@end macro
 
-@c usage: @lsr{ancient,custodes.ly}
-@macro lsr{DIR,NAME}
-@ifhtml
-  @uref{source/input/lsr/\DIR\/collated-files.html#\NAME\,@file{\DIR\/\NAME\}}
 @end ifhtml
+
 @ifnothtml
-  @file{\DIR\/\NAME\}
-@end ifnothtml
+
+@macro warning{TEXT}
+@quotation
+@quotation
+@cartouche
+@b{Note:} \TEXT\
+@end cartouche
+@end quotation
+@end quotation
 @end macro
 
-@macro lsrdir{DIR}
-@ifhtml
-  @uref{source/input/lsr/\DIR\/collated-files.html,@file{\DIR\}/}
-@end ifhtml
-@ifnothtml
-  @file{\DIR\}
 @end ifnothtml
-@end macro
 
 
+@ifnotinfo
 
+@macro notation{TEXT}
+@var{\TEXT\}
+@end macro
+
+@end ifnotinfo
 
-@macro arrow{}
-@iftex
-@tex $\\Rightarrow$ @end tex@c
-@end iftex
-@ifhtml
-@html
-→
-@end html
-@end ifhtml
 @ifinfo
--->
+
+@macro notation{TEXT}
+\TEXT\
+@end macro
+
 @end ifinfo
+
+
+@macro smallspace
+@sp 1
 @end macro
 
 
-@c we need this since @q{\} doesn't work with makeinfo 4.8 --
-@c say @q{@value{backslash}} instead
-@set backslash \
 
+@c   ***** Displaying images not generated by lilypond-book *****
 
-@ifhtml
-@c ***** HTML *****
+@c Current installation setup of Info docs requires that all images are
+@c expected to be found in the `lilypond/' subdirectory.  `lilypond-book'
+@c already generates proper @image commands for images of music; these
+@c macro definitions do the same for other images.
 
-@c makeinfo-4.7 encodes html names, which means that nodes that
-@c contain nonalphanum characters will be broken links on the website.
-@c @uref{../lilypond-internals/\NAME\.html,\NAME\}@c
-@c @inforef{} adds ``See'' to the sentence, which is annoying, but
-@c better than a broken link.
-@c @inforef{\NAME\,,lilypond-internals}@c
-@c using @ref without punctuation is OK without for formats other than info
+@ifnotinfo
 
-@ifset bigpage
+@macro sourceimage{FILENAME,WIDTH,HEIGHT,ALTTEXT}
+@image{\FILENAME\,\WIDTH\,\HEIGHT\,\ALTTEXT\}
+@end macro
+
+@end ifnotinfo
+
+@ifinfo
 
-@macro internalsref{NAME}
-@vindex \NAME\
-@ref{\NAME\,,,lilypond-internals-big-page}
+@macro sourceimage{FILENAME,WIDTH,HEIGHT,ALTTEXT}
+@image{lilypond/\FILENAME\,\WIDTH\,\HEIGHT\,\ALTTEXT\}
 @end macro
 
-@macro rglos{NAME}
-@vindex \NAME\
-@ref{\NAME\,,,music-glossary-big-page}
+@end ifinfo
+
+
+
+@c   ***** Headings in a doc subsection *****
+
+@c Don't insert an empty line after @predefined!  Right now
+@c it doesn't matter, but a future implementation will probably
+@c add some code which needs this restriction.
+
+@macro predefined
+@noindent
+@subsubheading Predefined commands
 @end macro
 
-@end ifset
+@c The next macro is a dummy currently since texinfo doesn't
+@c provide a real ragged-right environment yet.
+@c
+@c Due to a bug in texi2html (texi2html.pl CVS versions <= 1.245)
+@c the macro must not be empty.
 
+@macro endpredefined
+@c
+@end macro
 
-@ifclear bigpage
 
-@c annoying parentheses stripped by add-html-footer.py
-@macro internalsref{NAME}
-@vindex \NAME\
-@ref{\NAME\,,,lilypond-internals}
+@macro snippets
+@noindent
+@subsubheading Selected Snippets
 @end macro
 
-@c annoying parentheses stripped by add-html-footer.py
-@macro rglos{NAME}
-@vindex \NAME\
-@ref{\NAME\,,,music-glossary}
+
+@c Don't insert an empty line after @seealso!  Otherwise we get
+@c unwanted extra vertical space in the PDF output.
+
+@macro seealso
+@noindent
+@subsubheading See also
+@indent
 @end macro
 
-@end ifclear
+
+@macro knownissues
+@noindent
+@subsubheading Known issues and warnings
+@end macro
 
 
-@c  not used anymore
-@macro inputfileref{DIR,NAME}
-@uref{source/\DIR\/collated-files.html#\NAME\,@file{\DIR\/\NAME\}}@c
+@macro lydoctitle {TEXT}
+@emph{\TEXT\}
 @end macro
 
-@c to get decent quotes in `foo'
-@macro q{TEXT}
-@html
-&lsquo;\TEXT\&rsquo;
-@end html
+
+@c Don't remove the `@c' within the macro definition!  See section 19.3,
+@c `Macro Details and Caveats', in the texinfo info file for explanation.
+
+@macro funindex {TEXT}
+@findex \TEXT\
+@kindex \TEXT\
+@c
 @end macro
 
-@c to get decent quotes in ``foo''
-@macro qq{TEXT}
-@html
-&ldquo;\TEXT\&rdquo;
-@end html
+
+
+@c   ***** Links and references *****
+
+@c  Definitions for references:
+@c
+@c     @rglos
+@c     @rlearning
+@c     @ruser
+@c     @rprogram
+@c     @rlsr
+@c     @rinternals
+@c
+@c  All these also have a @...named version which allows to specify the
+@c  displayed text for the reference as second argument.
+@c
+@c ***** HTML + bigpage is a special case (other manual names); all other
+@c formats are treated similarly.
+
+
+@c *** not TeX ***
+
+@ifnottex
+
+@c ** bigpage **
+
+@ifset bigpage
+
+@macro rglos{TEXT}
+@vindex \TEXT\
+@ref{\TEXT\,,,music-glossary-big-page,Music Glossary}
 @end macro
 
-@end ifhtml
+@macro rglosnamed{TEXT,DISPLAY}
+@vindex \TEXT\
+@ref{\TEXT\,,\DISPLAY\,music-glossary-big-page,Music Glossary}
+@end macro
+
+@macro rlearning{TEXT}
+@vindex \TEXT\
+@ref{\TEXT\,,,lilypond-learning-big-page,Learning Manual}
+@end macro
 
+@macro rlearningnamed{TEXT,DISPLAY}
+@vindex \TEXT\
+@ref{\TEXT\,,\DISPLAY\,lilypond-learning-big-page,Learning Manual}
+@end macro
 
-@ifdocbook
-@c ***** DOCBOOK-XML *****
+@macro ruser{TEXT}
+@vindex \TEXT\
+@ref{\TEXT\,,,lilypond-big-page,Notation Reference}
+@end macro
 
-@macro internalsref{NAME}
-@vindex \NAME\
-@ref{\NAME\,,,lilypond-internals}
+@macro rusernamed{TEXT,DISPLAY}
+@vindex \TEXT\
+@ref{\TEXT\,,\DISPLAY\,lilypond-big-page,Notation Reference}
 @end macro
 
-@macro inputfileref{DIR,NAME}
-@uref{source/\DIR\/collated-files.html#\NAME\,@file{\DIR\/\NAME\}}
+@macro rprogram{TEXT}
+@vindex \TEXT\
+@ref{\TEXT\,,,lilypond-program-big-page,Application Usage}
 @end macro
 
-@macro rglos{NAME}
-@vindex \NAME\
-@ref{\NAME\,,,music-glossary}
+@macro rprogramnamed{TEXT,DISPLAY}
+@vindex \TEXT\
+@ref{\TEXT\,,\DISPLAY\,lilypond-program-big-page,Application Usage}
 @end macro
 
-@c to get decent quotes in `foo'
-@macro q{TEXT}
-@xml
-&lsquo;\TEXT\&rsquo;
-@end xml
+@macro rlsr{TEXT}
+@ref{\TEXT\,,,lilypond-snippets-big-page,Snippets}
 @end macro
 
-@c to get decent quotes in ``foo''
-@macro qq{TEXT}
-@xml
-&ldquo;\TEXT\&rdquo;
-@end xml
+@macro rlsrnamed{TEXT,DISPLAY}
+@ref{\TEXT\,,\DISPLAY\,lilypond-snippets-big-page,Snippets}
 @end macro
 
-@end ifdocbook
+@macro rinternals{TEXT}
+@vindex \TEXT\
+@ref{\TEXT\,,,lilypond-internals-big-page,Internals Reference}
+@end macro
 
+@macro rinternalsnamed{TEXT,DISPLAY}
+@vindex \TEXT\
+@ref{\TEXT\,,\DISPLAY\,lilypond-internals-big-page,Internals Reference}
+@end macro
 
-@ifinfo
-@c **** INFO ****
+@end ifset
+
+
+@c ** not bigpage **
+
+@ifclear bigpage
 
-@macro internalsref{NAME}
-@vindex \NAME\
-@inforef{\NAME\,,lilypond-internals}
+@macro rglos{TEXT}
+@vindex \TEXT\
+@ref{\TEXT\,,,music-glossary,Music Glossary}
 @end macro
 
-@macro inputfileref{DIR,NAME}
-@file{\DIR\/\NAME\}
+@macro rglosnamed{TEXT,DISPLAY}
+@vindex \TEXT\
+@ref{\TEXT\,,\DISPLAY\,music-glossary,Music Glossary}
 @end macro
 
-@macro rglos{NAME}@c
-@vindex \NAME\
-@inforef{\NAME\,,,music-glossary}
+@macro rlearning{TEXT}
+@vindex \TEXT\
+@ref{\TEXT\,,,lilypond-learning,Learning Manual}
 @end macro
 
-@macro usermanref{NAME}
-@inforef{\NAME\}
+@macro rlearningnamed{TEXT,DISPLAY}
+@vindex \TEXT\
+@ref{\TEXT\,,,lilypond-learning,Learning Manual}
 @end macro
 
-@c to get decent quotes in `foo'
-@macro q{TEXT}
-`\TEXT\'
+@macro ruser{TEXT}
+@vindex \TEXT\
+@ref{\TEXT\,,,lilypond,Notation Reference}
 @end macro
 
-@c to get decent quotes in ``foo''
-@macro qq{TEXT}
-``\TEXT\''
+@macro rusernamed{TEXT,DISPLAY}
+@vindex \TEXT\
+@ref{\TEXT\,,\DISPLAY\,lilypond,Notation Reference}
 @end macro
 
-@end ifinfo
+@macro rprogram{TEXT}
+@vindex \TEXT\
+@ref{\TEXT\,,,lilypond-program,Application Usage}
+@end macro
 
+@macro rprogramnamed{TEXT,DISPLAY}
+@vindex \TEXT\
+@ref{\TEXT\,,\DISPLAY\,lilypond-program,Application Usage}
+@end macro
 
-@c **** TEX ****
-@iftex
+@macro rlsr{TEXT}
+@ref{\TEXT\,,,lilypond-snippets,Snippets}
+@end macro
+
+@macro rlsrnamed{TEXT,DISPLAY}
+@ref{\TEXT\,,\DISPLAY\,lilypond-snippets,Snippets}
+@end macro
 
-@macro internalsref{NAME}
-@vindex \NAME\
-@code{\NAME\}
+@macro rinternals{TEXT}
+@vindex \TEXT\
+@ref{\TEXT\,,,lilypond-internals,Internals Reference}
 @end macro
 
-@macro inputfileref{DIR,NAME}
-@file{\DIR\/@/\NAME\}
+@macro rinternalsnamed{TEXT,DISPLAY}
+@vindex \TEXT\
+@ref{\TEXT\,,\DISPLAY\,lilypond-internals,Internals Reference}
 @end macro
 
-@macro rglos {NAME}
-@vindex \NAME\
-@code{\NAME\}
+@end ifclear
+
+@end ifnottex
+
+
+@c *** TeX ***
+
+@iftex
+
+@c All commands below should work in the middle of the line;
+@c we thus must not use @vindex directly since it works only if placed
+@c on a line of its own.  To overcome this problem, we define a
+@c replacement macro using the internal definition of @vindex which
+@c delimits arguments in the standard way (i.e., with braces).
+
+@tex
+\gdef\lilyvindex#1{\doind{vr}{\code #1}\ignorespaces}
+@end tex
+
+@macro rglos{TEXT}
+@lilyvindex{\TEXT\}
+@ref{\TEXT\,,,music-glossary,Music Glossary}
 @end macro
 
-@macro seeinternals{NAME}
-internals document, @internalsref{\NAME\}
+@macro rglosnamed{TEXT,DISPLAY}
+@lilyvindex{\TEXT\}
+@ref{\TEXT\,,\DISPLAY\,music-glossary,Music Glossary}
 @end macro
 
-@macro usermanref{NAME}
-user manual, @internalsref{\NAME\}
+@macro rlearning{TEXT}
+@lilyvindex{\TEXT\}
+@ref{\TEXT\,,,lilypond-learning,Learning Manual}
 @end macro
 
-@c to get decent quotes in `foo'
-@macro q{TEXT}
-`\TEXT\'
+@macro rlearningnamed{TEXT,DISPLAY}
+@lilyvindex{\TEXT\}
+@ref{\TEXT\,,\DISPLAY\,lilypond-learning,Learning Manual}
 @end macro
 
-@c to get decent quotes in ``foo''
-@macro qq{TEXT}
-``\TEXT\''
+@macro ruser{TEXT}
+@lilyvindex{\TEXT\}
+@ref{\TEXT\,,,lilypond,Notation Reference}
 @end macro
 
-@end iftex
+@macro rusernamed{TEXT,DISPLAY}
+@lilyvindex{\TEXT\}
+@ref{\TEXT\,,\DISPLAY\,lilypond,Notation Reference}
+@end macro
 
+@macro rprogram{TEXT}
+@lilyvindex{\TEXT\}
+@ref{\TEXT\,,,lilypond-program,Application Usage}
+@end macro
 
-@ifnottex
-@c **** not TEX ****
+@macro rprogramnamed{TEXT,DISPLAY}
+@lilyvindex{\TEXT\}
+@ref{\TEXT\,,\DISPLAY\,lilypond-program,Application Usage}
+@end macro
 
-@macro seeinternals{NAME}
-@internalsref{\NAME\}
+@macro rlsr{TEXT}
+@lilyvindex{\TEXT\}
+@ref{\TEXT\,,,lilypond-snippets,Snippets}
 @end macro
 
-@ifnotinfo
-@macro usermanref{NAME}
-@ref{\NAME\}
+@macro rlsrnamed{TEXT,DISPLAY}
+@lilyvindex{\TEXT\}
+@ref{\TEXT\,,\DISPLAY\,lilypond-snippets,Snippets}
 @end macro
-@end ifnotinfo
 
-@end ifnottex
+@macro rinternals{TEXT}
+@lilyvindex{\TEXT\}
+@ref{\TEXT\,,,lilypond-internals,Internals Reference}
+@end macro
 
+@macro rinternalsnamed{TEXT,DISPLAY}
+@lilyvindex{\TEXT\}
+@ref{\TEXT\,,\DISPLAY\,lilypond-internals,Internals Reference}
+@end macro
 
-@c EOF
+@end iftex