summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/curve2e/curve2e.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/curve2e/curve2e.sty')
-rw-r--r--Master/texmf-dist/tex/latex/curve2e/curve2e.sty23
1 files changed, 16 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/latex/curve2e/curve2e.sty b/Master/texmf-dist/tex/latex/curve2e/curve2e.sty
index e1178ec444f..a242d865723 100644
--- a/Master/texmf-dist/tex/latex/curve2e/curve2e.sty
+++ b/Master/texmf-dist/tex/latex/curve2e/curve2e.sty
@@ -11,7 +11,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[2019/01/01]
\ProvidesPackage{curve2e}%
- [2020-01-29 v.2.2.1 Extension package for pict2e]
+ [2020-02-24 v.2.2.2 Extension package for pict2e]
\IfFileExists{xfp.sty}{%
\RequirePackage{color}
\RequirePackageWithOptions{pict2e}[2014/01/01]
@@ -277,6 +277,14 @@
\endgroup
\ignorespaces}}
+\def\@picture(#1,#2)(#3,#4){%
+ \edef\pict@urcorner{#1,#2}% New statement
+ \edef\pict@llcorner{#3,#4}% New statement
+ \@picht#2\unitlength
+ \setbox\@picbox\hb@xt@#1\unitlength\bgroup
+ \hskip -#3\unitlength
+ \lower #4\unitlength\hbox\bgroup
+ \ignorespaces}
\def\Gr@phGrid(#1,#2){\bgroup\textcolor{red}{\linethickness{.1\p@}%
\RoundUp#1modulo10to\@GridWd \RoundUp#2modulo10to\@GridHt
\@tempcnta=\@GridWd \divide\@tempcnta10\relax \advance\@tempcnta\@ne
@@ -284,16 +292,17 @@
\@tempcnta=\@GridHt \divide\@tempcnta10\advance\@tempcnta\@ne
\multiput(0,0)(0,10){\@tempcnta}{\line(1,0){\@GridWd}}\thinlines}%
\egroup\ignorespaces}
+
+\NewDocumentCommand\AutoGrid{d() d()}{\bgroup%
+\put(\pict@llcorner){\expandafter\Gr@phGrid\expandafter(\pict@urcorner)}%
+\egroup\ignorespaces}
+
\NewDocumentCommand\GraphGrid{r() d()}{%
\IfValueTF{#2}{\put(#1){\Gr@phGrid(#2)}}%
{\put(0,0){\Gr@phGrid(#1)}}}
-\def\RoundUp#1modulo#2to#3{\expandafter\@tempcnta\Integer#1.??%
-\count254\@tempcnta\divide\count254by#2\relax
-\multiply\count254by#2\relax
-\count252\@tempcnta\advance\count252-\count254
-\ifnum\count252>0\advance\count252-#2\relax
-\advance\@tempcnta-\count252\fi\edef#3{\number\@tempcnta}\ignorespaces}%
+\def\RoundUp#1modulo#2to#3{
+\edef#3{\fpeval{(ceil(#1/#2,0))*#2}}}%
\def\Integer#1.#2??{#1}%
\def\DividE#1by#2to#3{\edef#3{\fpeval{#1 / #2}}}