From c6a2b9ffb580c4f50f416fe4c673322875dd6ded Mon Sep 17 00:00:00 2001
From: Ian Jauslin <ian.jauslin@roma1.infn.it>
Date: Mon, 26 Oct 2015 13:53:12 +0000
Subject: Typos, misformats, update style files, add DOIs in bibliography

---
 iansecs.sty | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 90 insertions(+), 10 deletions(-)

(limited to 'iansecs.sty')

diff --git a/iansecs.sty b/iansecs.sty
index e5e4b00..0eaff3f 100644
--- a/iansecs.sty
+++ b/iansecs.sty
@@ -76,13 +76,19 @@
 \AtBeginDocument{
   \def\label#1{\expandafter\outdef{label@#1}{\safe\tag}}
 
+%% make a custom link at any given location in the document
+\def\makelink#1#2{
+  \hrefanchor
+  \outdef{label@#1}{#2}
+}
+
 \def\ref#1{%
 % check whether the label is defined (hyperlink runs into errors if this check is ommitted)
 \ifcsname label@#1@hl\endcsname%
-\hyperlink{ln.\csname label@#1@hl\endcsname}{\safe\csname label@#1\endcsname}%
+\hyperlink{ln.\csname label@#1@hl\endcsname}{{\color{blue}\safe\csname label@#1\endcsname}}%
 \else%
 \ifcsname label@#1\endcsname%
-\csname label@#1\endcsname%
+{\color{blue}\csname #1\endcsname}%
 \else%
 {\bf ??}%
 \fi%
@@ -216,10 +222,24 @@
 \newcounter{enumerate@count}
 \def\enumerate{
   \setcounter{enumerate@count}0
-  \let\olditemizept\itemizept%
-  \def\itemizept{\stepcounter{enumerate@count}\theenumerate@count.}
+  \let\olditem\item
+  \let\olditemizept\itemizept
+  \def\item{
+    % counter
+    \stepcounter{enumerate@count}
+    % set header
+    \def\itemizept{\theenumerate@count.}
+    % hyperref anchor
+    \hrefanchor
+    % define tag (for \label)
+    \xdef\tag{\theenumerate@count}
+    \olditem
+  }
+  \itemize
 }
 \def\endenumerate{
+  \enditemize
+  \let\item\olditem
   \let\itemizept\olditemizept
 }
 
@@ -297,7 +317,7 @@
 \setlength\figwidth\textwidth
 \addtolength\figwidth{-2.5cm}
 
-\def\figcount#1{%
+\def\caption#1{%
 \stepcounter{figcount}%
 % hyperref anchor
 \hrefanchor%
@@ -314,6 +334,24 @@
 \hfil fig \figformat: \parbox[t]{\figwidth}{\leavevmode\small#1}%
 \par\bigskip%
 }
+%% short caption: centered
+\def\captionshort#1{%
+\stepcounter{figcount}%
+% hyperref anchor
+\hrefanchor%
+% the number of the figure
+\edef\figformat{\thefigcount}%
+% add section number
+\ifsections%
+\let\tmp\figformat%
+\edef\figformat{\sectionprefix\thesectioncount.\tmp}%
+\fi%
+% define tag (for \label)
+\xdef\tag{\figformat}%
+% write
+\hfil fig \figformat: {\small#1}%
+\par\bigskip%
+}
 
 %% environment
 \def\figure{
@@ -322,10 +360,48 @@
 \def\endfigure{
   \par\penalty-1000
 }
-\let\caption\figcount
 
 %% delimiters
-\def\delimtitle#1{\par \leavevmode\raise.3em\hbox to\hsize{\lower0.3em\hbox{\vrule height0.3em}\hrulefill\ \lower.3em\hbox{#1}\ \hrulefill\lower0.3em\hbox{\vrule height0.3em}}\par\penalty10000}
+\def\delimtitle#1{\par%
+\leavevmode%
+\raise.3em\hbox to\hsize{%
+\lower0.3em\hbox{\vrule height0.3em}%
+\hrulefill%
+\ \lower.3em\hbox{#1}\ %
+\hrulefill%
+\lower0.3em\hbox{\vrule height0.3em}%
+}\par\penalty10000}
+
+%% callable by ref
+\def\delimtitleref#1{\par%
+% hyperref anchor
+\hrefanchor%
+% define tag (for \label)
+\xdef\tag{#1}%
+\leavevmode%
+\raise.3em\hbox to\hsize{%
+\lower0.3em\hbox{\vrule height0.3em}%
+\hrulefill%
+\ \lower.3em\hbox{\bf #1}\ %
+\hrulefill%
+\lower0.3em\hbox{\vrule height0.3em}%
+}\par\penalty10000}
+
+%% no title
+\def\delim{\par%
+\leavevmode\raise.3em\hbox to\hsize{%
+\lower0.3em\hbox{\vrule height0.3em}%
+\hrulefill%
+\lower0.3em\hbox{\vrule height0.3em}%
+}\par\penalty10000}
+
+%% end delim
+\def\enddelim{\par\penalty10000%
+\leavevmode%
+\raise.3em\hbox to\hsize{%
+\vrule height0.3em\hrulefill\vrule height0.3em%
+}\par}
+
 \def\delim{\par\leavevmode\raise.3em\hbox to\hsize{\vrule height0.3em\hrulefill\vrule height0.3em}\par\penalty10000}
 \def\enddelim{\par\penalty10000\leavevmode\raise.3em\hbox to\hsize{\vrule height0.3em\hrulefill\vrule height0.3em}\par}
 
@@ -349,6 +425,10 @@
   \delimtitle{\bf #1 \formattheo}
 }
 \let\endtheo\enddelim
+%% theorem headers with name
+\def\theoname#1#2{
+  \theo{#1}\hfil({\it #2})\par\penalty10000\medskip%
+}
 
 %% start appendices
 \def\appendix{%
@@ -413,12 +493,12 @@
   \stepcounter{tocsectioncount}
   \setcounter{tocsubsectioncount}{0}
   % write
-  \smallskip\hyperlink{ln.\csname toc@sec.\thetocsectioncount\endcsname}{{\bf \tocsectionprefix\thetocsectioncount}.\hskip5pt #1\leaderfill#2}\par
+  \smallskip\hyperlink{ln.\csname toc@sec.\thetocsectioncount\endcsname}{{\bf \tocsectionprefix\thetocsectioncount}.\hskip5pt {\color{blue}#1}\leaderfill#2}\par
 }
 \def\tocsubsection #1#2{
   \stepcounter{tocsubsectioncount}
   % write
-  {\hskip10pt\hyperlink{ln.\csname toc@subsec.\thetocsectioncount.\thetocsubsectioncount\endcsname}{{\bf \thetocsubsectioncount}.\hskip5pt {\small #1}\leaderfill#2}}\par
+  {\hskip10pt\hyperlink{ln.\csname toc@subsec.\thetocsectioncount.\thetocsubsectioncount\endcsname}{{\bf \thetocsubsectioncount}.\hskip5pt {\color{blue}\small #1}\leaderfill#2}}\par
 }
 \def\tocappendices{
   \medskip
@@ -429,6 +509,6 @@
 }
 \def\tocreferences#1{
   \medskip
-  {\hyperlink{ln.\csname toc@references\endcsname}{{\bf References}\leaderfill#1}}\par
+  {\hyperlink{ln.\csname toc@references\endcsname}{{\color{blue}\bf References}\leaderfill#1}}\par
   \smallskip
 }
-- 
cgit v1.2.3-54-g00ecf

