Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 1st, 2011  |  syntax: Latex  |  size: 5.84 KB  |  views: 480  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. \usepackage{algorithm}
  2. \usepackage{booktabs}
  3. \usepackage{calc}
  4. \usepackage{caption}
  5. \usepackage{datenumber}
  6. \usepackage{datetime}
  7. \usepackage{environ}
  8. \usepackage{float}
  9. \usepackage{flafter}
  10. \usepackage{graphicx}
  11. \usepackage{hyphenat}
  12. \usepackage{upquote,textcomp}
  13. \usepackage{tocloft}
  14. \usepackage[T1]{fontenc}
  15. \usepackage{mathptmx}
  16. \usepackage{parskip}
  17. \usepackage{pdfpages}
  18. \usepackage{refcount}
  19. \usepackage[automark,nouppercase]{scrpage2}
  20. \usepackage{url}
  21. \usepackage[dvipsnames,svgnames,x11names,table]{xcolor}
  22. \usepackage{tikz}
  23. \usepackage{titlesec}
  24. \usetikzlibrary{backgrounds,shadows,shapes,snakes}
  25. \usepackage{pst-grad}
  26. \usepackage{hyperref}
  27.  
  28. % Colour definitions.
  29. \input{colours.tex}
  30.  
  31. % Vertical spacing adjustments to the table of contents.
  32. \setlength{\cftbeforechapskip}{1.5ex}
  33. \setlength{\cftbeforesecskip}{0.5ex}
  34.  
  35. % Horizontal spacing adjustments to the table of contents.
  36. \makeatletter
  37. \renewcommand{\l@section}{\@dottedtocline{1}{1.5em}{2.6em}}
  38. \renewcommand{\l@subsection}{\@dottedtocline{2}{4.0em}{3.6em}}
  39. \renewcommand{\l@subsubsection}{\@dottedtocline{3}{7.4em}{4.5em}}
  40. \makeatother
  41.  
  42. % Table colours.
  43. \colorlet{tableheader}{zebrastripecolour!80}
  44. \colorlet{zebra}{zebrastripecolour!5}
  45.  
  46. % Apply a gradient to the sections.
  47. \input{sections.tex}
  48.  
  49. % Import the \corp macros.
  50. \input{companies.tex}
  51.  
  52. % Adjust the header and footer.
  53. \input{header-footer.tex}
  54.  
  55. \input{hypersetup-indispensable.tex}
  56. %\input{hypersetup-wordsplit.tex}
  57.  
  58. % Change algorithm to "Listing".
  59. \floatname{algorithm}{Listing}
  60. \newcommand{\algorithmname}{Listing}
  61.  
  62. % Define float style called "algorithm".
  63. \makeatletter
  64. \newcommand\fs@algorithm{%
  65.   \let\@fs@capt\floatc@algorithm
  66.   \def\@fs@pre{\hrule height.8pt depth0pt\relax}% \kern2pt removed
  67.   \def\@fs@mid{\hrule\kern2pt}%  \kern2pt removed
  68.   \def\@fs@post{\kern2pt\hrule\relax}%
  69.   \let\@fs@iftopcapt\iftrue}
  70. \makeatother
  71.  
  72. % Make the algorithm environment use the algorithm float style.
  73. \floatstyle{algorithm}
  74. \restylefloat{algorithm}
  75.  
  76. \DeclareCaptionFormat{algorithm}{%
  77.   \colorbox[HTML]{A6BFF2}{%
  78.     \parbox{\textwidth}{\hspace{0.25em}#1#2#3}%
  79.   }
  80. }
  81.  
  82. \captionsetup{hypcapspace=0.5\baselineskip}
  83. \captionsetup{labelfont=bf,labelsep=endash}
  84. \captionsetup[ruled]{labelfont=bf,labelsep=endash}
  85. \captionsetup[algorithm]{format=algorithm}
  86.  
  87. % Make sure "Figure" appears for sub-floats.
  88. \newcommand*{\subfigureautorefname}{\figureautorefname}
  89.  
  90. % Make the chapter include just the chapter, not the number.
  91. \renewcommand{\chaptermark}[1]{\markboth{#1}{}}
  92. \newcommand{\ChapterTitle}{\leftmark}
  93.  
  94. % Expose the chapter number when necessary (not before the main matter).
  95. \makeatletter
  96. \def\ChapterNumberIfNeededEven{%
  97.   \ifnum \value{chapter}>0 ~$ \star $ \chaptername{} \thechapter{} \fi
  98. }
  99. \def\ChapterNumberIfNeededOdd{%
  100.   \ifnum \value{chapter}>0 \chaptername{} \thechapter{} $ \star $ \fi
  101. }
  102. \makeatother
  103.  
  104. % Centre tables.
  105. \let\oldtable\table
  106. \let\endoldtable\endtable
  107. \renewenvironment{table}[1][ht]{%
  108.   \rowcolors{2}{zebra}{white}%
  109.   \oldtable[#1]
  110.   \centering}%
  111.   {\endoldtable}
  112.  
  113. % Prevent hyphens in uppercase words (such as programming constants).
  114. \let\temptt\texttt
  115. \renewcommand\texttt[1]{\mbox{\temptt{#1}}}
  116.  
  117. % Remove extra whitespace so that colour fills the table header.
  118. \renewcommand{\toprule}{\specialrule{\heavyrulewidth}{\abovetopsep}{0pt}}
  119. \renewcommand{\midrule}{\specialrule{\lightrulewidth}{0pt}{\belowrulesep}}
  120. \renewcommand{\bottomrule}{\specialrule{\lightrulewidth}{0pt}{\belowrulesep}}
  121.  
  122. % Set the current date?
  123. \date{}
  124.  
  125. % Allow figures to be placed near the top of the page.
  126. \renewcommand{\topfraction}{0.85}
  127. \renewcommand{\textfraction}{0.1}
  128. \renewcommand{\floatpagefraction}{0.75}
  129.  
  130. % Determine if the image is too wide for the page.
  131. \makeatletter
  132. \def\ScaleIfNeeded{%
  133.   \ifdim\Gin@nat@width>\linewidth
  134.     \linewidth
  135.   \else
  136.     \Gin@nat@width
  137.   \fi
  138. }
  139. \makeatother
  140.  
  141. % Resize figures that are too wide for the page.
  142. \let\oldincludegraphics\includegraphics
  143. \renewcommand\includegraphics[2][]{%
  144.   \graphicsformat{%
  145.     \oldincludegraphics[width=\ScaleIfNeeded]{#2}%
  146.   }%
  147. }
  148.  
  149. % Centre graphics within non-Algorithm floats.
  150. \let\graphicsformat\centering
  151.  
  152. % Change the background colour of algorithm boxes.
  153. \let\oldalgorithm\algorithm
  154. \let\endoldalgorithm\endalgorithm
  155. \renewenvironment{algorithm}[1][htbp]{
  156.  \let\graphicsformat\justifiedandcolored
  157.  \oldalgorithm[#1]
  158. }%
  159.   {\endoldalgorithm}
  160.  
  161. % Change the background colour of the algorithm floats.
  162. \def\justifiedandcolored#1{%
  163.   \setlength\fboxrule{0pt}%
  164.   \setlength\fboxsep{0pt}%
  165.   \kern-1.6pt
  166.   \tikz[background rectangle/.style={%
  167.           top color=sourcecolour!60,bottom color=white},
  168.   tight background,
  169.   show background rectangle]
  170.   \node [inner sep=0pt] (0,0) {#1};%
  171.   \par
  172.   \kern-1.6pt
  173. }
  174.  
  175. % Non-breaking words (IllegalArgumentException) should not be in
  176. % the margins.
  177. \tolerance 1414
  178. \hbadness 1414
  179. \emergencystretch 1.5em
  180. \hfuzz 0.3pt
  181. \widowpenalty=10000
  182. \vfuzz \hfuzz
  183.  
  184. % Prevent multiline footnotes from being split across pages.
  185. \interfootnotelinepenalty=10000
  186.  
  187. % Allow plenty of room at the bottom (this will prevent large
  188. % vertical gaps between enumerated items and bulleted lists).
  189. \raggedbottom
  190.  
  191. % Use the \path command for filenames.
  192. \newcommand*{\filename}[1]{\expandafter\path\expandafter{#1}}
  193.  
  194. % Text mark-up environments and miscellaneous macros.
  195. \input{epigraph.tex}
  196. \input{displayed.tex}
  197. \input{applications.tex}
  198. \input{filenames.tex}
  199. \input{dedication.tex}
  200.  
  201. % Use roman numerals for second-level enumerated items.
  202. \renewcommand{\theenumii}{\roman{enumii}}
  203.  
  204. % Flip the margins around. Even pages on the left, odd on the right,
  205. % and the margins set up so that the crease gets lots of space.
  206. \let\tmpmargin\oddsidemargin
  207. \let\oddsidemargin\evensidemargin
  208. \let\evensidemargin\tmpmargin
  209. \reversemarginpar
  210.  
  211. % Required by LyX...
  212. \makeatletter