Skip to content

Commit

Permalink
revert to newer version of byrne.sty
Browse files Browse the repository at this point in the history
  • Loading branch information
jemmybutton committed Sep 14, 2024
1 parent 18e6354 commit b6a2971
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions byrne.sty
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{byrne}[2022/01/06 Byrne]
\ProvidesPackage{byrne}[2023/04/22 Byrne]

\RequirePackage{xparse}
\RequirePackage{ifmtarg}
Expand All @@ -9,6 +9,8 @@
\mplibglobaltextext{enable}
\newcount\mpInst
\mpInst = 0
\newcount\mpLastInst
\mpLastInst = 0

\def\mpPre{}
\def\mpPost{}
Expand All @@ -22,6 +24,7 @@
\directlua{
function byFormatImageName(s)
local resultingName = s:gsub ("[,| |/|0-9]","")
resultingName = resultingName:gsub ("-","minus")
tex.print("instanceOffspringPicture"..resultingName)
end
}
Expand All @@ -38,6 +41,11 @@ end
\global\def\currentInstance{byInstance\the\mpInst}%
}

\def\UseLastPicture{%
\global\mpInst = \mpLastInst%
\global\def\currentInstance{byInstance\the\mpInst}%
}

\DeclareDocumentCommand{\defineNewPicture}{o o m}{%
\IfNoValueTF{#1}%
{\global\def\sfA{1/3}}%
Expand All @@ -46,8 +54,9 @@ end
{\global\def\sfB{defaultScaleFactor}}%
{\global\def\sfB{#2}}%
\ifCreateNewInstanceForPicture%
\global\advance \mpInst by 1%
\global\def\currentInstance{byInstance\the\mpInst}%
\global\advance \mpLastInst by 1%
\UseLastPicture
%\global\def\currentInstance{byInstance\the\mpLastInst}%
\fi%
\setbox0\vbox{%
\everymplib[\currentInstance]{beginfig(0);}%
Expand Down

0 comments on commit b6a2971

Please sign in to comment.