2016-12-30

Krei muziknotojn kun teksto kun la programaro Lateks kaj Lilipond

Mi ĵus provis krei muziknotojn kun tekston fare de computilo. Mi uzis la dokumento en
lilipond dokumeento/. 

Mia Linuks sistemo estas openSUSELeap 42.2

Ĉi tie estas malgranda Lateks ekzemplo:




####################################################


linux-du75:~/lilypond/test1_ # cat test1.tex
\documentclass[]{article}

\usepackage{graphics}
\begin{document}

Normaler LaTeX-Ttext.
Hallo Paty. Das ist ein normaler Text
Aber Jetzt kommen die Noten


{%
\parindent 0pt
\noindent
\ifx\preLilyPondExample \undefined
\else
  \expandafter\preLilyPondExample
\fi
\def\lilypondbook{}%
\input{83/lily-350868a0-systems.tex}
\ifx\postLilyPondExample \undefined
\else
  \expandafter\postLilyPondExample
\fi
}

Hier kommt wieder ein kleiner Textabschnitt
Weiterer LaTeX-Text.

{%
\parindent 0pt
\noindent
\ifx\preLilyPondExample \undefined
\else
  \expandafter\preLilyPondExample
\fi
\def\lilypondbook{}%
\input{5c/lily-e41c3bc9-systems.tex}
\ifx\postLilyPondExample \undefined
\else
  \expandafter\postLilyPondExample
\fi
}
\end{document}


######################################################

Mi kompilas la teksto kun programo  xelatex

linux-du75:~/lilypond/test1_ # xelatex test1.tex
This is XeTeX, Version 3.14159265-2.6-0.99992 (TeX Live 2015/TeX Live for SUSE Linux) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(./test1.tex
LaTeX2e <2015> patch level 2
Babel <3 .9m=""> and hyphenation patterns for 79 languages loaded.
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size10.clo))
(/usr/share/texmf/tex/latex/graphics/graphics.sty
(/usr/share/texmf/tex/latex/graphics/trig.sty)
(/usr/share/texmf/tex/latex/latexconfig/graphics.cfg)
(/usr/share/texmf/tex/xelatex/xetex-def/xetex.def)) (./test1.aux)
(./83/lily-350868a0-systems.tex <83 lily-350868a0-1.eps="">)
(./5c/lily-e41c3bc9-systems.tex <5c lily-e41c3bc9-1.eps="">) [1] (./test1.aux) )
Output written on test1.pdf (1 page).
Transcript written on test1.log.
linux-du75:~/lilypond/test1_ # 


Kaj nun mi povas rigardi la kreitan pdf-paĝon kun evince legilo

# evince test1.pdf


#########################################################

Dua ekzemplo kun test2.tex

\documentclass{article}
\usepackage{ifxetex}
\ifxetex
%xetex specific stuff
\usepackage{xunicode,fontspec,xltxtra}
\setmainfont[Numbers=OldStyle]{Times New Roman}
\setsansfont{Arial}
\else
%This can be empty if you are not going to use pdftex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{mathptmx}%Times
\usepackage{helvet}%Helvetica
\fi
%Here you can insert all packages that pdftex also understands
\usepackage[ngerman,finnish,english]{babel}
\usepackage{graphicx}

\begin{document}
\title{A short document with LilyPond and xelatex}
\maketitle

Normal \textbf{font} commands inside the \emph{text} work,
because they \textsf{are supported by \LaTeX{} and XeteX.}
If you want to use specific commands like \verb+\XeTeX+, you
should include them again in a \verb+\ifxetex+ environment.
You can use this to print the \ifxetex \XeTeX{} command \else
XeTeX command \fi which is not known to normal \LaTeX .

In normal text you can easily use LilyPond commands, like this:

\begin{lilypond}
{a2 b c'8 c' c' c'}
\end{lilypond}

\noindent
and so on.

The fonts of snippets set with LilyPond will have to be set from
inside 
of the snippet. For this you should read the AU on how to use
lilypond-book.

\selectlanguage{ngerman}
Auch Umlaute funktionieren ohne die \LaTeX -Befehle, wie auch alle
anderen
seltsamen Zeichen: ß,ł,ã,č,я,щ, wenn sie von der Schriftart
unterstützt werden.
\end{document}
 
# lilypond-book --output test2 test2.tex
lilypond-book (GNU LilyPond) 2.18.2
Reading test2.tex...
Running `latex' on file `/tmp/tmp7Sn7Cr.tex' to detect default page settings.

Dissecting...
Writing snippets...
Processing...
Running lilypond...
GNU LilyPond 2.18.2
Processing `snippet-map--8164214707711813030.ly'
Parsing...
Processing `test2.tex'
Parsing...
Interpreting music...
Preprocessing graphical objects...
Calculating line breaks... 
Drawing systems... 
Layout output to `94/lily-7bcf92ca.eps'...
Layout output to `94/lily-7bcf92ca-1.eps'...
Writing 94/lily-7bcf92ca-systems.texi...
Writing 94/lily-7bcf92ca-systems.tex...
Writing 94/lily-7bcf92ca-systems.count...
Success: compilation successfully completed
Linking files...
Compiling /root/lilypond/test2/test2.tex...
Writing `/root/lilypond/test2/test2.tex'...
linux-du75:~/lilypond # 

linux-du75:~/lilypond # cd test2/
linux-du75:~/lilypond/test2 # latex test2.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/TeX Live for SUSE Linux) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
(./test2.tex
LaTeX2e <2015> patch level 2
Babel <3 .9m=""> and hyphenation patterns for 79 languages loaded.
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size10.clo))
(/usr/share/texmf/tex/generic/ifxetex/ifxetex.sty)
(/usr/share/texmf/tex/latex/base/fontenc.sty
(/usr/share/texmf/tex/latex/base/t1enc.def))
(/usr/share/texmf/tex/latex/base/inputenc.sty
(/usr/share/texmf/tex/latex/base/utf8.def
(/usr/share/texmf/tex/latex/base/t1enc.dfu)
(/usr/share/texmf/tex/latex/base/ot1enc.dfu)
(/usr/share/texmf/tex/latex/base/omsenc.dfu)))
(/usr/share/texmf/tex/latex/psnfss/mathptmx.sty)
(/usr/share/texmf/tex/latex/psnfss/helvet.sty
(/usr/share/texmf/tex/latex/graphics/keyval.sty))
(/usr/share/texmf/tex/generic/babel/babel.sty
(/usr/share/texmf/tex/generic/babel-german/ngerman.ldf
(/usr/share/texmf/tex/generic/babel-german/ngermanb.ldf
(/usr/share/texmf/tex/generic/babel/babel.def)))
(/usr/share/texmf/tex/generic/babel-finnish/finnish.ldf)
(/usr/share/texmf/tex/generic/babel-english/english.ldf))
(/usr/share/texmf/tex/latex/graphics/graphicx.sty
(/usr/share/texmf/tex/latex/graphics/graphics.sty
(/usr/share/texmf/tex/latex/graphics/trig.sty)
(/usr/share/texmf/tex/latex/latexconfig/graphics.cfg)
(/usr/share/texmf/tex/latex/graphics/dvips.def)))
No file test2.aux.
(/usr/share/texmf/tex/latex/psnfss/t1ptm.fd)
(/usr/share/texmf/tex/latex/psnfss/ot1ztmcm.fd)
(/usr/share/texmf/tex/latex/psnfss/omlztmcm.fd)
(/usr/share/texmf/tex/latex/psnfss/omsztmcm.fd)
(/usr/share/texmf/tex/latex/psnfss/omxztmcm.fd)
(/usr/share/texmf/tex/latex/psnfss/ot1ptm.fd)

LaTeX Warning: No \author given.

(/usr/share/texmf/tex/latex/psnfss/t1phv.fd)
(/usr/share/texmf/tex/latex/base/t1cmtt.fd) (./94/lily-7bcf92ca-systems.tex
<94 lily-7bcf92ca-1.eps="">)

! Package inputenc Error: Unicode char \u8:я not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H   for immediate help.
 ...                                              
                                                  
l.58 seltsamen Zeichen: ß,ł,ã,č,я
                                      ,щ, wenn sie von der Schriftart
? 

! Package inputenc Error: Unicode char \u8:щ not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H   for immediate help.
 ...                                              
                                                  
l.58 seltsamen Zeichen: ß,ł,ã,č,я,щ
                                         , wenn sie von der Schriftart
? 
[1] (./test2.aux) )
Output written on test2.dvi (1 page, 1700 bytes).
Transcript written on test2.log.
linux-du75:~/lilypond/test2 # dvipdf test2.dvi 
linux-du75:~/lilypond/test2 # evince test2.pdf




 




Keine Kommentare: