summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lwarp/lwarp-lyluatex.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-09-02 20:57:55 +0000
committerKarl Berry <karl@freefriends.org>2019-09-02 20:57:55 +0000
commit1bcbcdf719a79c5b851d5506608fd117288f90cc (patch)
tree68aa7a4043fbc9c087fb8499ad1fe4b96a565b62 /Master/texmf-dist/tex/latex/lwarp/lwarp-lyluatex.sty
parentdc3d664b996915ebf8a1409711fb346af9f6247a (diff)
lwarp (2sep19)
git-svn-id: svn://tug.org/texlive/trunk@52016 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/lwarp/lwarp-lyluatex.sty')
-rw-r--r--Master/texmf-dist/tex/latex/lwarp/lwarp-lyluatex.sty62
1 files changed, 42 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/latex/lwarp/lwarp-lyluatex.sty b/Master/texmf-dist/tex/latex/lwarp/lwarp-lyluatex.sty
index d77574e1597..72772a2edba 100644
--- a/Master/texmf-dist/tex/latex/lwarp/lwarp-lyluatex.sty
+++ b/Master/texmf-dist/tex/latex/lwarp/lwarp-lyluatex.sty
@@ -15,31 +15,53 @@
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
+\LWR@origRequirePackage{luacode}
+
\LWR@ProvidesPackagePass{lyluatex}[2019/05/27]
-\newcommand*{\lyluateximagename}{(-lilypond-~\packagediagramname)}
+\newcommand*{\LyluatexImageAltText}{-lilypond-~\PackageDiagramAltText}
\LetLtxMacro\LWR@orig@ly@compilescore\ly@compilescore
\renewcommand*{\ly@compilescore}[1]{%
- \begin{lateximage}[\lyluateximagename]%
- \LWR@orig@ly@compilescore{#1}%
- \end{lateximage}%
-}
-
-\AtBeginDocument{
- \lysetoption{paperwidth}{6in}
- \lysetoption{paperheight}{9in}
- \lysetoption{line-width}{5.5in}
- \lysetoption{twoside}{false}
- \lysetoption{fullpagestyle}{empty}
- \lysetoption{fullpagealign}{crop}
- \lysetoption{print-page-number}{false}
- \lysetoption{insert}{systems}
- \lysetoption{extra-top-margin}{0}
- \lysetoption{extra-bottom-margin}{0}
- \lysetoption{valign}{center}
- \lysetoption{staffsize}{20}
- \lysetoption{inline-staffsize}{14}
+ \begingroup%
+ \LWR@orignewpage%
+ \LWR@origloadgeometry{LWR@usergeometry}%
+ \LWR@print@normalsize%
+ \renewcommand{\includegraphics}[2][]{%
+ \InlineClass{lyluatex}{%
+ \begin{lateximage}[\LyluatexImageAltText]%
+ \LWR@addbaselinemarker%
+ \LWR@origincludegraphics{##2}%
+ \end{lateximage}%
+ }%
+ }%
+ \ly@setunits%
+ \directlua{
+ ly_opts:set_option('currfiledir', [[\currfiledir]])
+ ly_opts:set_option('twoside', '\ly@istwosided')
+ #1
+ }%
+ \ly@resetunits%
+ \ly@currentfonts%
+ \directlua{
+ if (ly.score.insert == 'fullpage') then
+ tex.print{[[\string\begin{BlockClass}{lyluatex}]]}
+ end
+ }%
+ \directlua{ly.score:process()}%
+ \directlua{
+ if (ly.score.insert == 'fullpage') then
+ tex.print{[[\string\end{BlockClass}]]}
+ end
+ }%
+ \LWR@orignewpage%
+ \LWR@origrestoregeometry%
+ \endgroup%
}
+\xpatchcmd{\endly@bufferenv}
+ {\hspace{0pt}\\}
+ {}
+ {}
+ {\LWR@patcherror{lyluatex}{endly@bufferenv}}
\endinput
%%
%% End of file `lwarp-lyluatex.sty'.