summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/bidi/todonotes-xetex-bidi.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/bidi/todonotes-xetex-bidi.def')
-rw-r--r--Master/texmf-dist/tex/xelatex/bidi/todonotes-xetex-bidi.def45
1 files changed, 36 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/xelatex/bidi/todonotes-xetex-bidi.def b/Master/texmf-dist/tex/xelatex/bidi/todonotes-xetex-bidi.def
index acdbd608388..8570324538d 100644
--- a/Master/texmf-dist/tex/xelatex/bidi/todonotes-xetex-bidi.def
+++ b/Master/texmf-dist/tex/xelatex/bidi/todonotes-xetex-bidi.def
@@ -17,7 +17,7 @@
%% by Vafa Khalighi.
%%
%%
-%% \CheckSum{42904}
+%% \CheckSum{42937}
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -34,16 +34,26 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
%%
-\ProvidesFile{todonotes-xetex-bidi.def}[2014/11/21 v0.1 bidi adaptations for todonotes package for XeTeX engine]
+\ProvidesFile{todonotes-xetex-bidi.def}[2014/11/23 v0.2 bidi adaptations for todonotes package for XeTeX engine]
+\newif\if@bidi@todonotes@textdirection@RTL
+\newif\if@bidi@todonotes@figposition@right
\newcommand{\@bidi@todonotes@align}{}%
\define@key{todonotes}{align}{\renewcommand{\@bidi@todonotes@align}{#1}}%
\newcommand{\@bidi@todonotes@textdirection}{}%
\define@choicekey{todonotes}{textdirection}[\bidi@todonotes@tempa\bidi@todonotes@tempb]{righttoleft,lefttoright}{%
\ifcase\bidi@todonotes@tempb\relax
+ \@bidi@todonotes@textdirection@RTLtrue
\let\@bidi@todonotes@textdirection\RLE
\or
+ \@bidi@todonotes@textdirection@RTLfalse
\let\@bidi@todonotes@textdirection\LRE
\fi}
+\define@choicekey{todonotes}{figposition}[\bidi@todonotes@tempa\bidi@todonotes@tempb]{right,left}{%
+ \ifcase\bidi@todonotes@tempb\relax
+ \@bidi@todonotes@figposition@righttrue
+ \or
+ \@bidi@todonotes@figposition@rightfalse
+ \fi}
\if@todonotes@disabled%
\else % \if@todonotes@disabled
\renewcommand{\@todonotes@drawMarginNoteWithLine}{%
@@ -77,18 +87,19 @@
\let\originalHbadness\hbadness%
\hbadness 100000%
\begin{tikzpicture}[remember picture,baseline=(X.base)]%
+ \if@bidi@todonotes@textdirection@RTL\setRTL\fi%
\node(X){\vphantom{X}};%
\draw node[notestyle,font=\@todonotes@sizecommand,anchor=north,align=\@bidi@todonotes@align] (inNote) at (X.north)%
- {\@bidi@todonotes@textdirection{\@todonotes@text}};%
+ {\@todonotes@text};%
\if@todonotes@authorgiven%
\draw node[notestyle,font=\@todonotes@sizecommand,anchor=north,align=\@bidi@todonotes@align] (inNote) at (X.north)%
- {\@bidi@todonotes@textdirection{\@todonotes@sizecommand\@todonotes@author}};%
+ {\@todonotes@sizecommand\@todonotes@author};%
\node(Y)[below=of X]{};%
\draw node[notestyle,font=\@todonotes@sizecommand,anchor=north,align=\@bidi@todonotes@align] (inNote) at (X.south)%
- {\@bidi@todonotes@textdirection{\@todonotes@text}};%
+ {\@todonotes@text};%
\else%
\draw node[notestyle,font=\@todonotes@sizecommand,anchor=north,align=\@bidi@todonotes@align] (inNote) at (X.north)%
- {\@bidi@todonotes@textdirection{\@todonotes@text}};%
+ {\@todonotes@text};%
\fi%
\end{tikzpicture}%
\hbadness \originalHbadness%
@@ -101,19 +112,35 @@
\begin{tikzpicture}
\draw[fill=\@todonotes@currentfigcolor, draw = black!40, line width=2pt]
(-2, -2.5) rectangle +(\@todonotes@currentfigwidth, \@todonotes@currentfigheight);
-\draw (2, -0.3) node[right, text
- width=\@todonotes@currentfigwidth-4.5cm,align=\@bidi@todonotes@align] {\@bidi@todonotes@textdirection{#2}};
+\if@bidi@todonotes@figposition@right%
+\begin{scope}[xshift=\@todonotes@currentfigwidth-4cm]
+\fi%
\draw[red, fill=white, rounded corners = 5pt, line width=10pt]
(30:2cm) -- (150:2cm) -- (270:2cm) -- cycle;
+\if@bidi@todonotes@figposition@right%
+\end{scope}
+\begin{scope}[xshift=-3.8cm]
+\fi%
+\if@bidi@todonotes@textdirection@RTL\setRTL\fi%
+\draw (2, -0.3) node[right, text
+ width=\@todonotes@currentfigwidth-4.5cm,align=\@bidi@todonotes@align] {#2};
+\if@bidi@todonotes@figposition@right%
+\end{scope}
+\begin{scope}[xshift=\@todonotes@currentfigwidth-4cm]
+\fi%
\draw (0, 0.3) node[align=\@bidi@todonotes@align] {\@bidi@todonotes@textdirection{\@todonotes@MissingFigureUp}};
\draw (0, -0.3) node[align=\@bidi@todonotes@align] {\@bidi@todonotes@textdirection{\@todonotes@MissingFigureDown}};
+\if@bidi@todonotes@figposition@right%
+\end{scope}
+\fi%
\end{tikzpicture}\hfill
}% Ending \missingfigure command
\fi % Ending \@todonotes@ifdisabled
\presetkeys%
{todonotes}%
{align=left,%
- textdirection=lefttoright}{}%
+ textdirection=lefttoright,%
+ figposition=left}{}%
\endinput
%%
%% End of file `todonotes-xetex-bidi.def'.