Advertisement
Guest User

Preamble

a guest
Dec 8th, 2010
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 4.43 KB | None | 0 0
  1. \usepackage{hyperref}
  2. \usepackage{algorithm}
  3. \usepackage{booktabs}
  4. \usepackage{colortbl}
  5. \usepackage[dvipsnames,svgnames,x11names,hyperref,table]{xcolor}
  6. \usepackage{graphicx}
  7. \usepackage{upquote,textcomp}
  8.  
  9. \usepackage{caption}
  10. \captionsetup{hypcapspace=0.5\baselineskip}
  11. \captionsetup{labelfont=bf,labelsep=endash}
  12. \captionsetup[ruled]{labelfont=bf,labelsep=endash}
  13.  
  14. \usepackage{float}
  15. \floatname{algorithm}{Listing}
  16. \newcommand{\algorithmname}{Listing}
  17.  
  18. % Document colours
  19. \definecolor{externallinkcolour}{HTML}{1F3F81}
  20. \definecolor{internallinkcolour}{HTML}{BF910C}
  21. \definecolor{sectioncolour}{HTML}{1F3F81}
  22. \definecolor{sourcecolour}{HTML}{F0F0F0}
  23.  
  24. % Table colours
  25. \colorlet{tableheader}{LightGray!80}
  26. \colorlet{zebra}{LightGray!40}
  27.  
  28. \addtokomafont{sectioning}{\color{sectioncolour}}
  29.  
  30. \usepackage[automark,nouppercase]{scrpage2}
  31. \renewcommand{\chaptermark}[1]{\markboth{#1}{}}
  32. \newcommand{\ChapterTitle}{\leftmark}
  33.  
  34. \makeatletter
  35. \def\ChapterNumberIfNeededEven{%
  36.   \ifnum \value{chapter}>0 ~$ \star $ \chaptername{} \thechapter{} \fi
  37. }
  38. \def\ChapterNumberIfNeededOdd{%
  39.   \ifnum \value{chapter}>0 \chaptername{} \thechapter{} $ \star $ \fi
  40. }
  41. \makeatother
  42.  
  43. % Adjust the header and footer.
  44. \pagestyle{scrheadings}
  45. \clearscrheadfoot
  46. \setheadsepline{.5pt}
  47. \rehead{\textsc{\ChapterTitle \ChapterNumberIfNeededEven}}
  48. \lohead{\textsc{\ChapterNumberIfNeededOdd \ChapterTitle}}
  49. \lehead{\pagemark}
  50. \rohead{\pagemark}
  51. \cfoot{\small{\textnormal{Copyright \copyright~White Magic Software, Ltd.}}}
  52.  
  53. % Cast the fantastically ugly, ugly hyperlink border into the depth of Hades.
  54. \hypersetup{
  55.   % Show bookmarks bar?
  56.   bookmarks=true,
  57.   % Non-Latin characters in Acrobat's bookmarks
  58.   unicode=false,
  59.   % Show Acrobat's toolbar?
  60.   pdftoolbar=true,
  61.   % Show Acrobat's menu?
  62.   pdfmenubar=true,
  63.   % Window fit to page when opened
  64.   pdffitwindow=false,
  65.   % Fit the width of the page to the window
  66.   pdfstartview={FitH},
  67.   % Title
  68.   pdftitle={Indespensible JasperReports},
  69.   % author
  70.   pdfauthor={White Magic Software, Ltd.},
  71.   % subject of the document
  72.   pdfsubject={Reporting Software and Business Intelligence},
  73.   % Creator of the document
  74.   pdfcreator={Dave Jarvis},
  75.   % Producer of the document
  76.   pdfproducer={Producer},
  77.   % List of keywords
  78.   pdfkeywords={JasperReports} {Business Intelligence} {Reports},
  79.   % Links in new window
  80.   pdfnewwindow=true,
  81.   % false: boxed links; true: colored links
  82.   colorlinks=true,
  83.   % Color of internal links
  84.   linkcolor=internallinkcolour,
  85.   % Color of links to bibliography
  86.   citecolor=black,
  87.   % Color of file links
  88.   filecolor=black,
  89.   % Color of external links
  90.   urlcolor=externallinkcolour,
  91.   % No border around links
  92.   pdfborder={0 0 0}
  93. }
  94.  
  95. % Centre tables.
  96. \let\oldtable\table
  97. \let\endoldtable\endtable
  98. \renewenvironment{table}[1][ht]{%
  99.   \rowcolors{2}{zebra}{white}
  100.  \oldtable[#1]
  101.  \centering}%
  102.   {\endoldtable}
  103.  
  104. \date{}
  105.  
  106. % Allow figures to be placed near the top
  107. \renewcommand{\topfraction}{0.85}
  108. \renewcommand{\textfraction}{0.1}
  109. \renewcommand{\floatpagefraction}{0.75}
  110.  
  111. % Determine if the image is too wide for the page.
  112. \makeatletter
  113. \def\ScaleIfNeeded{%
  114.   \ifdim\Gin@nat@width>\linewidth
  115.     \linewidth
  116.   \else
  117.     \Gin@nat@width
  118.   \fi
  119. }
  120. \makeatother
  121.  
  122. % Resize figures that are too wide for the page.
  123. \let\oldincludegraphics\includegraphics
  124. \renewcommand\includegraphics[2][]{%
  125.   \graphicsformat{%
  126.     \oldincludegraphics[width=\ScaleIfNeeded]{#2}%
  127.   }%
  128. }
  129.  
  130. % Change the background colour of algorithm boxes
  131. \let\oldalgorithm\algorithm
  132. \let\endoldalgorithm\endalgorithm
  133. \renewenvironment{algorithm}[1][htbp]{
  134.  \let\graphicsformat\justifiedandcolored
  135.  \oldalgorithm[#1]
  136. }%
  137.   {\endoldalgorithm}
  138.  
  139. \def\justifiedandcolored#1{%
  140.   \setlength\fboxrule{0pt}%
  141.   \setlength\fboxsep{0pt}%
  142.   \kern-1.5pt
  143.   \colorbox{sourcecolour}{%
  144.     \hbox to\linewidth{#1}%
  145.   }%
  146.   \par
  147.   \kern-1.5pt
  148. }
  149.  
  150. % Centre graphics within non-Algorithm floats.
  151. \let\graphicsformat\centering
  152.  
  153. % Suggest that non-breaking words (IllegalArgumentException) do
  154. % not spill into the margins.
  155. \tolerance 1414
  156. \hbadness 1414
  157. \emergencystretch 1.5em
  158. \hfuzz 0.3pt
  159. \widowpenalty=10000
  160. \vfuzz \hfuzz
  161.  
  162. % Prevent multiline footnotes from being split across pages.
  163. \interfootnotelinepenalty=10000
  164.  
  165. % Allow plenty of room at the bottom (this will prevent large vertical
  166. % gaps between enumerated items and bulleted lists).
  167. \raggedbottom
  168.  
  169. % LyX requires this for some reason...
  170. \makeatletter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement