summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex/luatodonotes/luatodonotes.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-03-13 23:23:22 +0000
committerKarl Berry <karl@freefriends.org>2015-03-13 23:23:22 +0000
commit3e4facabd7e33e78ece63d391d6fc6c94842873d (patch)
tree6774944cbbd3246b1f8bf37f20927ad03355ada8 /Master/texmf-dist/tex/lualatex/luatodonotes/luatodonotes.sty
parent92c0eccd62a3eb57e56ee44400ebe63fec446bf6 (diff)
luatodonotes (13mar15)
git-svn-id: svn://tug.org/texlive/trunk@36505 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/luatodonotes/luatodonotes.sty')
-rw-r--r--Master/texmf-dist/tex/lualatex/luatodonotes/luatodonotes.sty101
1 files changed, 39 insertions, 62 deletions
diff --git a/Master/texmf-dist/tex/lualatex/luatodonotes/luatodonotes.sty b/Master/texmf-dist/tex/lualatex/luatodonotes/luatodonotes.sty
index 6f7a193ccce..d300a1ba5ad 100644
--- a/Master/texmf-dist/tex/lualatex/luatodonotes/luatodonotes.sty
+++ b/Master/texmf-dist/tex/lualatex/luatodonotes/luatodonotes.sty
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% Copyright (C) 2014 by Fabian Lipp <fabian.lipp@gmx.de>
+%% Copyright (C) 2014-2015 by Fabian Lipp <fabian.lipp@gmx.de>
%% based on the todonotes package by
%% Henrik Skov Midtiby <henrikmidtiby@gmail.com>
%%
@@ -24,9 +24,15 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{luatodonotes}
- [2014/08/07 v0.1 luatodonotes source and documentation.]
+ [2015/03/13 v0.2 luatodonotes source and documentation.]
-\ProvidesPackage{luatodonotes}[2014/06/08]
+\RequirePackage{ifluatex}
+\ifluatex\else
+ \PackageError{luatodonotes}{LuaTeX is required for this package. Aborting.}{%
+ This package can only be used with the LuaTeX engine\MessageBreak
+ (command `lualatex'). Package loading has been stopped\MessageBreak
+ to prevent additional errors.}
+\fi
\RequirePackage{ifthen}
\RequirePackage{xkeyval}
\RequirePackage{xcolor}
@@ -56,7 +62,7 @@
\newcommand{\@todonotes@interNoteSpace}{5pt}
\newcommand{\@todonotes@noteInnerSep}{5pt}
\newcommand{\@todonotes@routingAreaWidth}{0.4cm}
-\newcommand{\@todonotes@minNoteWidth}{2.0cm}
+\newcommand{\@todonotes@minNoteWidth}{1.0cm}
\newcommand{\@todonotes@distanceNotesPageBorder}{0.5cm}
\newcommand{\@todonotes@distanceNotesText}{0.2cm}
\newcommand{\@todonotes@rasterHeight}{1cm}
@@ -242,62 +248,29 @@
\newdimen\@todonotes@fontsize
\newdimen\@todonotes@currentsidemargin
\directlua{require("luatodonotes")}
-\directlua{noteInnerSep =
+\directlua{luatodonotes.noteInnerSep =
string.todimen("\luatexluaescapestring{\@todonotes@noteInnerSep}")}
-\directlua{noteInterSpace =
+\directlua{luatodonotes.noteInterSpace =
string.todimen("\luatexluaescapestring{\@todonotes@interNoteSpace}")}
-\directlua{routingAreaWidth =
+\directlua{luatodonotes.routingAreaWidth =
string.todimen("\luatexluaescapestring{\@todonotes@routingAreaWidth}")}
-\directlua{minNoteWidth =
+\directlua{luatodonotes.minNoteWidth =
string.todimen("\luatexluaescapestring{\@todonotes@minNoteWidth}")}
-\directlua{distanceNotesPageBorder =
+\directlua{luatodonotes.distanceNotesPageBorder =
string.todimen("\luatexluaescapestring{\@todonotes@distanceNotesPageBorder}")}
-\directlua{distanceNotesText =
+\directlua{luatodonotes.distanceNotesText =
string.todimen("\luatexluaescapestring{\@todonotes@distanceNotesText}")}
-\directlua{rasterHeight =
+\directlua{luatodonotes.rasterHeight =
string.todimen("\luatexluaescapestring{\@todonotes@rasterHeight}")}
-\IfStrEqCase{\@todonotes@positioning}{%
- {inText}{\directlua{positioning = positioningAlgos["inText"]}}%
- {inputOrder}{\directlua{positioning = positioningAlgos["inputOrder"]}}%
- {inputOrderStacks}{\directlua{positioning =
- positioningAlgos["inputOrderStacks"]}}%
- {sLeaderNorthEast}{\directlua{positioning =
- positioningAlgos["sLeaderNorthEast"]}}%
- {sLeaderNorthEastBelow}{\directlua{positioning =
- positioningAlgos["sLeaderNorthEastBelow"]}}%
- {sLeaderEast}{\directlua{positioning =
- positioningAlgos["sLeaderEast"]}}%
- {poLeaders}{\directlua{positioning = positioningAlgos["poLeaders"]}}%
- {poLeadersAvoidLines}{\directlua{positioning =
- positioningAlgos["poLeadersAvoidLines"]}}%
- {sLeaderNorthEastBelowStacks}{\directlua{positioning =
- positioningAlgos["sLeaderNorthEastBelowStacks"]}}}%
- [\directlua{positioning = positioningAlgos["inputOrderStacks"]}
- \PackageWarningNoLine{luatodonotes}
- {Invalid value for parameter positioning: \@todonotes@positioning}]
-\IfStrEqCase{\@todonotes@splitting}{%
- {none}{\directlua{splitting = splittingAlgos["none"]}}%
- {middle}{\directlua{splitting = splittingAlgos["middle"]}}%
- {median}{\directlua{splitting = splittingAlgos["median"]}}%
- {weightedMedian}{\directlua{splitting = splittingAlgos["weightedMedian"]}}}%
- [\directlua{splitting = splittingAlgos["none"]}
- \PackageWarningNoLine{luatodonotes}
- {Invalid value for parameter split: \@todonotes@splitting}]
-\IfStrEqCase{\@todonotes@leadertype}{%
- {s}{\directlua{leaderType = leaderTypes["s"]}}%
- {opo}{\directlua{leaderType = leaderTypes["opo"]}}%
- {po}{\directlua{leaderType = leaderTypes["po"]}}%
- {sBezier}{\directlua{leaderType = leaderTypes["sBezier"]}}%
- {os}{\directlua{leaderType = leaderTypes["os"]}}}%
- [\directlua{leaderType = leaderTypes["opo"]}
- \PackageWarningNoLine{luatodonotes}
- {Invalid value for parameter leadertype: \@todonotes@leadertype}]
+\directlua{luatodonotes.setPositioningAlgo("\luatexluaescapestring{\@todonotes@positioning}")}
+\directlua{luatodonotes.setSplittingAlgo("\luatexluaescapestring{\@todonotes@splitting}")}
+\directlua{luatodonotes.setLeaderType("\luatexluaescapestring{\@todonotes@leadertype}")}
\def\@todonotes@pdflastypos{\the\pdflastypos}
\newcommand{\@todonotes@lineposition}[3]{%
- \directlua{linePositionsAddLine(#1,#2,#3)}%
+ \directlua{luatodonotes.linePositionsAddLine(#1,#2,#3)}%
}
\newcommand{\@todonotes@nextpage}{%
- \directlua{linePositionsNextPage()}%
+ \directlua{luatodonotes.linePositionsNextPage()}%
}%
\newcommand{\@todonotes@writeNextpageToLpo}{%
\ifdefined\tf@lpo%
@@ -305,15 +278,15 @@
\fi
}
\if@todonotes@debugenabled
- \directlua{todonotesDebug = true}
+ \directlua{luatodonotes.todonotesDebug = true}
\newcommand{\@todonotes@AtBeginShipoutUpperLeft}
{\AtBeginShipoutUpperLeftForeground}
\else
- \directlua{todonotesDebug = false}
+ \directlua{luatodonotes.todonotesDebug = false}
\newcommand{\@todonotes@AtBeginShipoutUpperLeft}
{\AtBeginShipoutUpperLeft}
\fi
-\directlua{initTodonotes()}
+\directlua{luatodonotes.initTodonotes()}
\soulregister{\ }{0}
\newlength{\todonotes@textmark@width}
\newlength{\todonotes@textmark@fontsize}
@@ -336,7 +309,7 @@
{% last line of area
\def\todonotes@textmark@decoRight{}%
\addtolength\todonotes@textmark@width{2pt}%
- \directlua{processLastLineInTodoArea()}}%
+ \directlua{luatodonotes.processLastLineInTodoArea()}}%
{\def\todonotes@textmark@decoRight{@todonotes@todoarea}%
\addtolength\todonotes@textmark@width{4pt}}%
\newcommand{\@todonotes@nodeNamePrefix}%
@@ -543,7 +516,13 @@
\edef\@todonotes@tmp{\@todonotes@currentleaderwidth}%
\@todonotes@toks@currentleaderwidth=\expandafter{\@todonotes@tmp}%
\@todonotes@toks@sizecommand=\expandafter{\@todonotes@sizecommand}%
- \savebox\@todonotes@notetextbox{\@todonotes@sizecommand\@todonotes@text}%
+ \savebox\@todonotes@notetextbox{%
+ \@parboxrestore
+ \@marginparreset
+ \@todonotes@sizecommand\@todonotes@text%
+ \@minipagefalse
+ \outer@nobreak
+ }%
\if@todonotes@line%
\def\@todonotes@param@drawLeader{true}%
\else%
@@ -554,7 +533,7 @@
\else%
\def\@todonotes@param@noteType{}%
\fi%
- \directlua{addNoteToList(\arabic{@todonotes@numberoftodonotes},%
+ \directlua{luatodonotes.addNoteToList(\arabic{@todonotes@numberoftodonotes},%
\@todonotes@param@drawLeader,\luastringO{\@todonotes@param@noteType})}%
}%
\newcommand{\@todonotes@addElementToListOfTodos}{%
@@ -612,19 +591,17 @@
\checkoddpage%
\ifoddpageoroneside%
\@todonotes@currentsidemargin=\the\oddsidemargin%
- \directlua{currentPageOdd = true}%
\else%
\@todonotes@currentsidemargin=\the\evensidemargin%
- \directlua{currentPageOdd = false}%
\fi\relax%
\BeginCatcodeRegime\CatcodeTableLaTeX
- \directlua{calcLabelAreaDimensions()}%
- \directlua{calcHeightsForNotes()}% has to be outside of tikzpicture
+ \directlua{luatodonotes.calcLabelAreaDimensions()}%
+ \directlua{luatodonotes.calcHeightsForNotes()}% has to be outside of tikzpicture
\begin{tikzpicture}[remember picture,overlay]
- \directlua{getInputCoordinatesForNotes()}
- \directlua{printNotes()}
+ \directlua{luatodonotes.getInputCoordinatesForNotes()}
+ \directlua{luatodonotes.printNotes()}
\end{tikzpicture}%
- \directlua{clearNotes()}%
+ \directlua{luatodonotes.clearNotes()}%
\EndCatcodeRegime
}%
}