You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
3.4 KiB

8 years ago
  1. \NeedsTeXFormat{LaTeX2e}
  2. \ProvidesPackage{technote}[2007/11/09]
  3. \typeout{Template for quick notes with some useful definitions}
  4. \RequirePackage{ifthen}
  5. \RequirePackage{calc}
  6. \RequirePackage{amsmath,amssymb,amsthm}
  7. \RequirePackage{epsfig}
  8. \RequirePackage{algorithm}
  9. \RequirePackage[noend]{algorithmicplus}
  10. \newboolean{technote@noedit}
  11. \setboolean{technote@noedit}{false}
  12. \DeclareOption{noedit}{\setboolean{technote@noedit}{true}}
  13. \newcounter{technote@lang}
  14. \setcounter{technote@lang}{0}
  15. \DeclareOption{german}{\setcounter{technote@lang}{1}}
  16. \DeclareOption{french}{\setcounter{technote@lang}{2}}
  17. \DeclareOption{fullpage}{
  18. \oddsidemargin -10mm % Margin on odd side pages (default=0mm)
  19. \evensidemargin -10mm % Margin on even side pages (default=0mm)
  20. \topmargin -10mm % Top margin space (default=16mm)
  21. \headheight \baselineskip % Height of headers (default=0mm)
  22. \headsep \baselineskip % Separation spc btw header and text (d=0mm)
  23. \footskip 30pt % Separation spc btw text and footer (d=30pt)
  24. \textheight 230mm % Total text height (default=200mm)
  25. \textwidth 180mm % Total text width (default=160mm)
  26. }
  27. \renewcommand{\algorithmiccomment}[1]{\hfill/* #1 */}
  28. \renewcommand{\algorithmiclnosize}{\scriptsize}
  29. \newboolean{technote@truenumbers}
  30. \setboolean{technote@truenumbers}{false}
  31. \DeclareOption{truenumbers}{\setboolean{technote@truenumbers}{true}}
  32. \ProcessOptions
  33. \newcommand{\N}{\ifthenelse{\boolean{technote@truenumbers}}%
  34. {\mbox{\rm I\hspace{-.5em}N}}%
  35. {\mathbb{N}}}
  36. \newcommand{\R}{\ifthenelse{\boolean{technote@truenumbers}}%
  37. {\mbox{\rm I\hspace{-.2em}R}}%
  38. {\mathbb{R}}}
  39. \newcommand{\Z}{\mathbb{Z}}
  40. \newcommand{\set}[1]{\left\{#1\right\}}
  41. \newcommand{\mathsc}[1]{\mbox{\sc #1}}
  42. \newcommand{\li}[1]{\langle#1\rangle}
  43. \newcommand{\st}{\;s.t.\;}
  44. \newcommand{\Real}{\R}
  45. \newcommand{\Natural}{\N}
  46. \newcommand{\Integer}{\Z}
  47. % edit commands
  48. \newcommand{\newedit}[2]{
  49. \newcommand{#1}[2][default]{%
  50. \ifthenelse{\boolean{technote@noedit}}{}{
  51. \par\vspace{2mm}
  52. \noindent
  53. \begin{tabular}{|l|}\hline
  54. \parbox{\linewidth-\tabcolsep*2}{{\bf #2:}\hfill\ifthenelse{\equal{##1}{default}}{}{##1}}\\\hline
  55. \parbox{\linewidth-\tabcolsep*2}{\rule{0pt}{5mm}##2\rule[-2mm]{0pt}{2mm}}\\\hline
  56. \end{tabular}
  57. \par\vspace{2mm}
  58. }
  59. }
  60. }
  61. \newedit{\note}{Note}
  62. \newedit{\comment}{Comment}
  63. \newedit{\question}{Question}
  64. \newedit{\content}{Content}
  65. \newedit{\problem}{Problem}
  66. \newcommand{\mnote}[1]{\marginpar{\scriptsize\it
  67. \begin{minipage}[t]{0.8 in}
  68. \raggedright #1
  69. \end{minipage}}}
  70. \newcommand{\Insert}[1]{\underline{#1}\marginpar{$|$}}
  71. \newcommand{\Delete}[1]{\marginpar{$|$}
  72. }
  73. % lemma, theorem, etc.
  74. \newtheorem{lemma}{Lemma}
  75. \newtheorem{proposition}{Proposition}
  76. \newtheorem{theorem}{Theorem}
  77. \newtheorem{corollary}{Corollary}
  78. \newtheorem{assumption}{Assumption}
  79. \newtheorem{definition}{Definition}
  80. \gdef\op|{\,|\;}
  81. \gdef\op:{\,:\;}
  82. \newcommand{\assign}{\leftarrow}
  83. \newcommand{\inc}[1]{#1 \assign #1 + 1}
  84. \newcommand{\isdef}{:=}
  85. \newcommand{\ident}[1]{\mathit{#1}}
  86. \def\newident#1{\expandafter\def\csname #1\endcsname{\ident{#1}}}
  87. \newcommand{\eg}{{\it e.g.}}
  88. \newcommand{\ie}{{\it i.e.}}
  89. \newcommand{\apriori}{{\it apriori}}
  90. \newcommand{\etal}{{\it et al.}}
  91. \newcommand\ps@technote{%
  92. \renewcommand\@oddhead{\theheader}%
  93. \let\@evenhead\@oddhead
  94. \renewcommand\@evenfoot
  95. {\hfil\normalfont\textrm{\thepage}\hfil}%
  96. \let\@oddfoot\@evenfoot
  97. }