Skip to content

Commit 86f0c30

Browse files
authored
make label below option work for \annotate (#16)
1 parent 64e66a2 commit 86f0c30

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

annotate-equations.pdf

-179 Bytes
Binary file not shown.

annotate-equations.sty

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
%
66
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
77
\ProvidesPackage{annotate-equations}
8-
[2023/05/05 v0.2.1 easily annotate equations using TikZ]
8+
[2023/05/06 v0.2.2 easily annotate equations using TikZ]
99

1010
%%% lualatex compatibility, from https://tex.stackexchange.com/a/351520/171664
1111
\RequirePackage{ifluatex}
@@ -170,6 +170,9 @@
170170
\colorlet{currentcolor}{.}
171171
\def\myEAcolor{\usevalue{\myEAmark}}%
172172
%
173+
\def\EAspace{ } % workaround: did not find any other way of getting a space into \myEAlabelanchor without upsetting LaTeX/PGF/... somehow
174+
\edef\myEAlabelanchor{\EAlabelanchor\EAspace\EAwesteast}%
175+
%
173176
%
174177
\def\myEAxshift{\EAxshift{\EAwesteast}}%
175178
\begin{tikzpicture}[overlay,remember picture,>=stealth,nodes={align=left,inner ysep=1pt},<-]
@@ -182,7 +185,7 @@
182185
\foreach \EAmark in \myEAmarks
183186
\draw [color=\myEAcolor, annotate equations/arrow] (\EAmark.\EAmarkanchor) % arrow from the equation
184187
% \EAmarkanchor north: above the equation, south: below
185-
|- ([xshift=\myEAxshift,yshift=0.1ex] \eqnannotateCurrentNode.south \EAwesteast);
188+
|- ([xshift=\myEAxshift,yshift=0.1ex] \eqnannotateCurrentNode.\myEAlabelanchor);
186189
% - south east: we want line to end at bottom right of annotation text;
187190
% - negative xshift makes it a little bit shorter;
188191
% - yshift for aesthetics (\strut is ever so slightly too tall).

annotate-equations.tex

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
text above listing,
2727
#1}
2828

29-
\title{\texttt{annotate-equations.sty}, v.0.2.1}
29+
\title{\texttt{annotate-equations.sty}, v.0.2.2}
3030
\author{ST John}
3131
\date{\url{https://github.com/st--/annotate-equations}}
3232

@@ -131,7 +131,7 @@ \subsection{Annotation options}
131131
\end{equation*}
132132
\annotate[yshift=1em]{left}{node1}{my}
133133
\annotate[yshift=-0.5em]{below,left}{node2}{annotation}
134-
\annotate[yshift=-1em]{below}{node3}{text}
134+
\annotate[yshift=-1em]{below, label below}{node3}{text}
135135
\end{LTXexample}
136136
\noindent
137137
%
@@ -362,8 +362,6 @@ \subsection{Extra spacing between \texttt{\textbackslash{}tikzmarknode} and arro
362362
\section{Known issues}
363363

364364
\begin{itemize}
365-
\item \texttt{label above}/\texttt{label below} is not implemented for \verb|\annotate|.
366-
367365
\item Annotations of mathematical relations require some manual patching to get the correct surrounding spacing (see \cref{sec:mathrel}).
368366

369367
\end{itemize}

0 commit comments

Comments
 (0)