From 5dc3418fd91c83782dce77f0b65549e14f118f51 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 8 May 2015 22:36:52 +0000 Subject: context git-svn-id: svn://tug.org/texlive/trunk@37284 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/metapost/context/base/mp-page.mpiv | 29 ++++++++++++++-------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'Master/texmf-dist/metapost/context/base') diff --git a/Master/texmf-dist/metapost/context/base/mp-page.mpiv b/Master/texmf-dist/metapost/context/base/mp-page.mpiv index 7a6e576bd98..a6fa3fba366 100644 --- a/Master/texmf-dist/metapost/context/base/mp-page.mpiv +++ b/Master/texmf-dist/metapost/context/base/mp-page.mpiv @@ -267,29 +267,38 @@ vardef PaperBleed = lua.mp.PaperBleed () enddef ; boolean mfun_swapped ; def SwapPageState = - mfun_swapped := true ; + mfun_swapped := true ; % eventually this will go ! enddef ; extra_beginfig := extra_beginfig & "mfun_swapped := false ;" ; -vardef BackSpace = if (mfun_swapped and not OnRightPage) : PaperWidth - MakeupWidth - fi lua.mp.BackSpace() enddef ; -vardef CutSpace = if (mfun_swapped and not OnRightPage) : PaperWidth - MakeupWidth - fi lua.mp.CutSpace () enddef ; - vardef LeftMarginWidth = if mfun_swapped and not OnRightPage : lua.mp.RightMarginWidth () else : lua.mp.LeftMarginWidth () fi enddef ; vardef RightMarginWidth = if mfun_swapped and not OnRightPage : lua.mp.LeftMarginWidth () else : lua.mp.RightMarginWidth () fi enddef ; vardef LeftMarginDistance = if mfun_swapped and not OnRightPage : lua.mp.RightMarginDistance() else : lua.mp.LeftMarginDistance () fi enddef ; vardef RightMarginDistance = if mfun_swapped and not OnRightPage : lua.mp.LeftMarginDistance () else : lua.mp.RightMarginDistance() fi enddef ; + vardef LeftEdgeWidth = if mfun_swapped and not OnRightPage : lua.mp.RightEdgeWidth () else : lua.mp.LeftEdgeWidth () fi enddef ; vardef RightEdgeWidth = if mfun_swapped and not OnRightPage : lua.mp.LeftEdgeWidth () else : lua.mp.RightEdgeWidth () fi enddef ; vardef LeftEdgeDistance = if mfun_swapped and not OnRightPage : lua.mp.RightEdgeDistance () else : lua.mp.LeftEdgeDistance () fi enddef ; vardef RightEdgeDistance = if mfun_swapped and not OnRightPage : lua.mp.LeftEdgeDistance () else : lua.mp.RightEdgeDistance () fi enddef ; -% vardef Margin = if OnRightPage : lua.mp.RightMarginWidth else : lua.mp.LeftMarginWidth fi enddef ; -% vardef Edge = if OnRightPage : lua.mp.RightEdgeWidth else : lua.mp.LeftEdgeWidth fi enddef ; -% vardef InnerMargin = if OnRightPage : lua.mp.LeftMarginWidth else : lua.mp.RightMarginWidth fi enddef ; -% vardef InnerEdge = if OnRightPage : lua.mp.LeftEdgeWidth else : lua.mp.RightEdgeWidth fi enddef ; -% vardef OuterMargin = if OnRightPage : lua.mp.RightMarginWidth else : lua.mp.LeftMarginWidth fi enddef ; -% vardef OuterEdge = if OnRightPage : lua.mp.RightEdgeWidth else : lua.mp.LeftEdgeWidth fi enddef ; +vardef BackSpace = if mfun_swapped and not OnRightPage : PaperWidth - MakeupWidth - fi lua.mp.BackSpace() enddef ; +vardef CutSpace = if mfun_swapped and not OnRightPage : PaperWidth - MakeupWidth - fi lua.mp.CutSpace () enddef ; + +% better use: + +vardef OuterMarginWidth = if not OnRightPage : lua.mp.LeftMarginWidth () else : lua.mp.RightMarginWidth () fi enddef ; +vardef InnerMarginWidth = if not OnRightPage : lua.mp.RightMarginWidth () else : lua.mp.LeftMarginWidth () fi enddef ; +vardef OuterMarginDistance = if not OnRightPage : lua.mp.LeftMarginDistance () else : lua.mp.RightMarginDistance() fi enddef ; +vardef InnerMarginDistance = if not OnRightPage : lua.mp.RightMarginDistance() else : lua.mp.leftMarginDistance () fi enddef ; + +vardef OuterEdgeWidth = if not OnRightPage : lua.mp.LeftEdgeWidth () else : lua.mp.RightEdgeWidth () fi enddef ; +vardef InnerEdgeWidth = if not OnRightPage : lua.mp.RightEdgeWidth () else : lua.mp.LeftEdgeWidth () fi enddef ; +vardef OuterEdgeDistance = if not OnRightPage : lua.mp.LeftEdgeDistance () else : lua.mp.RightEdgeDistance () fi enddef ; +vardef InnerEdgeDistance = if not OnRightPage : lua.mp.RightEdgeDistance () else : lua.mp.leftEdgeDistance () fi enddef ; + +vardef OuterSpaceWidth = if not OnRightPage : lua.mp.BackSpace () else : lua.mp.CutSpace () fi enddef ; +vardef InnerSpaceWidth = if not OnRightPage : lua.mp.CutSpace () else : lua.mp.BackSpace () fi enddef ; % vardef CurrentLayout = lua.mp.CurrentLayout () enddef ; -- cgit v1.2.3