]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/notation/input.itely
New alist to replace special characters.
[lilypond.git] / Documentation / notation / input.itely
index 3f05fda34362ef422c306af7d5bc84ca1d39dbf5..e418d96fb4076221e79b344cd1962f2800fce41c 100644 (file)
@@ -1200,7 +1200,7 @@ Init files: @file{../ly/toc-init.ly}.
 @menu
 * Including LilyPond files::
 * Different editions from one source::
-* Text encoding::
+* Special characters::
 @end menu
 
 
@@ -1605,12 +1605,23 @@ Learning Manual:
 Notation Reference:
 @ref{Including LilyPond files}.
 
+@node Special characters
+@subsection Special characters
+
+@cindex special characters
+@cindex non-ASCII characters
+
+@menu
+* Text encoding::
+* Unicode::
+* ASCII aliases::
+@end menu
+
+
 @node Text encoding
-@subsection Text encoding
+@unnumberedsubsubsec Text encoding
 
-@cindex Unicode
 @cindex UTF-8
-@cindex non-ASCII characters
 
 LilyPond uses the character repertoire defined by the Unicode
 consortium and ISO/IEC 10646.  This defines a unique name and
@@ -1675,6 +1686,12 @@ portuguese = \lyricmode {
 \addlyrics { \portuguese }
 @end lilypond
 
+
+@node Unicode
+@unnumberedsubsubsec Unicode
+
+@cindex Unicode
+
 To enter a single character for which the Unicode code point is
 known but which is not available in the editor being used, use
 either @code{\char ##xhhhh} or @code{\char #dddd} within a
@@ -1724,6 +1741,58 @@ To enter the copyright sign in the copyright notice use:
 @end example
 
 
+@node ASCII aliases
+@unnumberedsubsubsec ASCII aliases
+
+A list of ASCII aliases for special characters can be included:
+
+@lilypond[quote,verbatim]
+\paper {
+  #(include-special-characters)
+}
+
+\markup "&flqq; – &OE;uvre incomplète… &frqq;"
+
+\score {
+  \new Staff { \repeat unfold 9 a'4 }
+  \addlyrics {
+    This is al -- so wor -- kin'~in ly -- rics: –_&OE;…
+  }
+}
+
+\markup \column {
+  "The replacement can be disabled:"
+  "– &OE; …"
+  \override #'(replacement-alist . ()) "– &OE; …"
+}
+@end lilypond
+
+You can also make your own aliases, either globally:
+
+@lilypond[quote,verbatim]
+\paper {
+  #(add-text-replacements!
+    '(("100" . "hundred")
+      ("dpi" . "dots per inch")))
+}
+\markup "A 100 dpi."
+@end lilypond
+
+or locally:
+
+@lilypond[quote,verbatim]
+\markup \replace #'(("100" . "hundred")
+                    ("dpi" . "dots per inch")) "A 100 dpi."
+@end lilypond
+
+@seealso
+Notation Reference:
+@ref{List of special characters}.
+
+Installed Files:
+@file{ly/text-replacements.ly}.
+
+
 
 @node Controlling output
 @section Controlling output