Ian Jauslin
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jauslin <jauslin@ias.edu>2017-05-04 19:16:34 +0000
committerIan Jauslin <jauslin@ias.edu>2017-05-04 21:11:59 +0000
commit1b13e14750d355b301dc3904702268687216608c (patch)
tree8169e8da7cb246c5d3fa47d13fdcaf5dcb199a12 /libs/point.sty
Initial commitv0.0
Diffstat (limited to 'libs/point.sty')
-rw-r--r--libs/point.sty98
1 files changed, 98 insertions, 0 deletions
diff --git a/libs/point.sty b/libs/point.sty
new file mode 100644
index 0000000..49e670f
--- /dev/null
+++ b/libs/point.sty
@@ -0,0 +1,98 @@
+%%
+%% Points package:
+%% \point commands
+%%
+
+%% TeX format
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+
+%% package name
+\ProvidesPackage{point}[2016/11/10]
+
+%% options
+\newif\ifresetatsection
+\DeclareOption{reset_at_section}{\resetatsectiontrue}
+\DeclareOption{no_reset_at_section}{\resetatsectionfalse}
+\newif\ifresetattheo
+\DeclareOption{reset_at_theo}{\resetattheotrue}
+\DeclareOption{no_reset_at_theo}{\resetattheofalse}
+
+\def\point@defaultoptions{
+ \ExecuteOptions{reset_at_section, no_reset_at_theo}
+ \ProcessOptions
+
+ %% reset at every new section
+ \ifresetatsection
+ \let\point@oldsection\section
+ \gdef\section{\resetpointcounter\point@oldsection}
+ \fi
+
+ %% reset at every new theorem
+ \ifresetattheo
+ \ifdefined\iantheotrue
+ \let\point@oldtheo\theo
+ \gdef\theo{\resetpointcounter\point@oldtheo}
+ \fi
+ \fi
+}
+
+
+%% point
+% counter
+\newcounter{pointcount}
+\def\point{
+ \stepcounter{pointcount}
+ \setcounter{subpointcount}{0}
+ % hyperref anchor (only if the class is 'ian')
+ \ifdefined\ifianclass
+ \hrefanchor
+ % define tag (for \label)
+ \xdef\tag{\thepointcount}
+ \fi
+ % header
+ \indent{\bf \thepointcount\ - }
+}
+
+%% subpoint
+% counter
+\newcounter{subpointcount}
+\def\subpoint{
+ \stepcounter{subpointcount}
+ \setcounter{subsubpointcount}0
+ % hyperref anchor (only if the class is 'ian')
+ \ifdefined\ifianclass
+ \hrefanchor
+ % define tag (for \label)
+ \xdef\tag{\thepointcount-\thesubpointcount}
+ \fi
+ % header
+ \indent\hskip.5cm{\bf \thepointcount-\thesubpointcount\ - }
+}
+
+%% subsubpoint
+% counter
+\newcounter{subsubpointcount}
+\def\subsubpoint{
+ \stepcounter{subsubpointcount}
+ % hyperref anchor (only if the class is 'ian')
+ \ifdefined\ifianclass
+ \hrefanchor
+ % define tag (for \label)
+ \xdef\tag{\thepointcount-\thesubpointcount-\thesubsubpointcount}
+ \fi
+ \indent\hskip1cm{\bf \thepointcount-\thesubpointcount-\thesubsubpointcount\ - }
+}
+
+
+%% reset point counters
+\def\resetpointcounter{
+ \setcounter{pointcount}{0}
+ \setcounter{subpointcount}{0}
+ \setcounter{subsubpointcount}{0}
+}
+
+
+
+%% end
+\point@defaultoptions
+\endinput