diff options
Diffstat (limited to 'support/lyluatex/lyluatex.sty')
-rw-r--r-- | support/lyluatex/lyluatex.sty | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/support/lyluatex/lyluatex.sty b/support/lyluatex/lyluatex.sty index f0d70d9878..e0108513d9 100644 --- a/support/lyluatex/lyluatex.sty +++ b/support/lyluatex/lyluatex.sty @@ -1,22 +1,20 @@ %Lyluatex LaTeX style. % -% Copyright (C) 2015-2019 jperon and others (see CONTRIBUTORS.md) +% Copyright (C) 2015-2022 jperon and others (see CONTRIBUTORS.md) % License: MIT % This file is part of lyluatex. \NeedsTeXFormat{LaTeX2e}% -\ProvidesPackage{lyluatex}[2019/05/27 v1.0f] %%LYLUATEX_DATE LYLUATEX_VERSION +\ProvidesPackage{lyluatex}[2022/10/30 v1.1] %%LYLUATEX_DATE LYLUATEX_VERSION % Dependencies -\RequirePackage{luatexbase} -\RequirePackage{luaotfload} -\RequirePackage{xkeyval} \RequirePackage{graphicx} \RequirePackage{minibox} \RequirePackage{environ} \RequirePackage{currfile} \RequirePackage{pdfpages} \IfFileExists{varwidth.sty}{\RequirePackage{varwidth}}{} +\RequirePackage{luaoptions} \RequirePackage{metalogo} \newcommand{\lyluatex}{\textit{ly}\LuaTeX} @@ -43,10 +41,8 @@ % Options \catcode`-=11 \directlua{ - local _opt = require( - kpse.find_file("lyluatex-options.lua") or "lyluatex-options.lua" - ) - ly_opts = _opt.Opts:new('ly_opts', { + local _opt = lua_options + lua_options.register('ly', { ['addversion'] = {'false', 'true', ''}, ['autoindent'] = {'true', 'false', ''}, ['cleantmp'] = {'false', 'true', ''}, @@ -133,7 +129,7 @@ \directlua{ ly = require(kpse.find_file("lyluatex.lua") or "lyluatex.lua") ly.make_list_file() - if ly_opts.cleantmp then + if lua_options.client('ly').cleantmp then luatexbase.add_to_callback('stop_run', ly.clean_tmp_dir, 'lyluatex cleantmp') luatexbase.add_to_callback('stop_run', ly.conclusion_text, 'lyluatex conclusion') end @@ -157,9 +153,6 @@ \setlength{\hfuzz}{\ly@old@hfuzz}% } -% Command to change options during the document -\newcommand{\lysetoption}[2]{\directlua{ly_opts:set_option([[#1]], [[#2]])}} - % How the filename of a score will look like (if printed) \newcommand{\lyFilename}[1]{\noindent #1\par\bigskip} @@ -174,7 +167,9 @@ % *current* font for optional use. \newcommand{\ly@currentfonts}{% \begingroup% - \directlua{ly_opts:set_option('current-font', ly.get_font_family(font.current()))}% + \setluaoption{ly}{current-font}{% + \directlua{ly.get_font_family(font.current())} + } \rmfamily \edef\rmfamilyid{\fontid\font}% \sffamily \edef\sffamilyid{\fontid\font}% \ttfamily \edef\ttfamilyid{\fontid\font}% @@ -188,9 +183,9 @@ % Score processing \newcommand*{\ly@compilescore}[1]{% \ly@setunits% + \setluaoption{ly}{currfiledir}{\currfiledir} + \setluaoption{ly}{twoside}{\ly@istwosided} \directlua{ - ly_opts:set_option('currfiledir', [[\currfiledir]]) - ly_opts:set_option('twoside', '\ly@istwosided') #1 ly.newpage_if_fullpage() }% |