Figuring out how to write books in LaTeX.
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.

104 lines
3.7 KiB

  1. \documentclass[12pt,reqno]{book} % Sets 12pt font, equation numbers on right
  2. \usepackage{amsmath,amssymb,amsfonts} % Typical maths resource packages
  3. \usepackage{graphics} % Packages to allow inclusion of graphics
  4. \usepackage{color} % For creating coloured text and background
  5. \usepackage[colorlinks,citecolor=blue,linkcolor=blue]{hyperref} % For creating hyperlinks in cross references. It should be after the color package. The option colorlinks produces colored entries without boxes. The option citecolor=blue changes the default green citations to blue.
  6. \DeclareGraphicsExtensions{.pdf}
  7. \parindent 1cm
  8. \parskip 0.2cm
  9. \topmargin 0.2cm
  10. \oddsidemargin 1cm
  11. \evensidemargin 0.5cm
  12. \textwidth 15cm
  13. \textheight 21cm
  14. \newtheorem{theorem}{Theorem}[section]
  15. \newtheorem{proposition}[theorem]{Proposition}
  16. \newtheorem{corollary}[theorem]{Corollary}
  17. \newtheorem{lemma}[theorem]{Lemma}
  18. \newtheorem{remark}[theorem]{Remark}
  19. \newtheorem{definition}[theorem]{Definition}
  20. \def\R{\mathbb{ R}}
  21. \def\S{\mathbb{ S}}
  22. \def\I{\mathbb{ I}}
  23. \makeindex
  24. \title{A \LaTeX \ Book Skeleton }
  25. \author{\htmladdnormallink % Puts a hyperlink on to the author's name
  26. {CTJ Dodson}{http://www.maths.manchester.ac.uk/~kd/homepage/}
  27. {\small\em \copyright 2015 }}
  28. \date{ }
  29. \usepackage{draftwatermark} %%% These four lines
  30. \SetWatermarkText{Draft not for circulation} %%% put a watermark
  31. \SetWatermarkScale{3} %%% on all pages. Just omit them if
  32. \SetWatermarkColor[rgb]{0.9,0,0} %%% it is not needed.
  33. \begin{document}
  34. \maketitle
  35. \addcontentsline{toc}{chapter}{Contents}
  36. \pagenumbering{roman}
  37. \tableofcontents
  38. \listoffigures
  39. \listoftables
  40. \chapter*{Preface}\normalsize
  41. \addcontentsline{toc}{chapter}{Preface}
  42. \pagestyle{plain}
  43. The book root file {\tt bookex.tex} gives a basic example of how to
  44. use \LaTeX \ for preparation of a book. Note that all
  45. \LaTeX \ commands begin with a
  46. backslash.
  47. Each
  48. Chapter, Appendix and the Index is made as a {\tt *.tex} file and is
  49. called in by the {\tt include} command---thus {\tt ch1.tex} is
  50. the name here of the file containing Chapter~1. The inclusion of any
  51. particular file can be suppressed by prefixing the line by a
  52. percent sign.
  53. Do not put an {\tt end{document}} command at the end of chapter files;
  54. just one such command is needed at the end of the book.
  55. Note the tag used to make an index entry. You may need to consult eg Lamport's
  56. book~\cite{lamport} % Gives link to reference
  57. for details of the procedure to make the index input
  58. file; \LaTeX \ will create a pre-index by listing all the tagged
  59. items in the file {\tt bookex.idx} then you edit this into
  60. a {\tt theindex} environment, as {\tt index.tex}.
  61. In the source file {\tt bookex.tex} the line:\\
  62. {\tt usepackage[colorlinks,citecolor=blue,linkcolor=blue]{hyperref} } \\
  63. includes hyperlinks and chooses colours for them.\\
  64. Also, the following lines just before
  65. {\tt begin\{document\}}
  66. will put a watermark on every page:
  67. \begin{verbatim}
  68. usepackage{draftwatermark} %%% These four lines
  69. SetWatermarkText{Draft not for circulation}%%% put a watermark on all
  70. SetWatermarkScale{3} %%% pages. Omit them if
  71. SetWatermarkColor[rgb]{0.9,0,0} %%% it is not needed.
  72. \end{verbatim}
  73. Just comment them out with \% if you do not want a watermark.
  74. \pagestyle{headings}
  75. \pagenumbering{arabic}
  76. \include{ch1}
  77. \include{ch2}
  78. \begin{thebibliography}{99}
  79. \addcontentsline{toc}{chapter}{Bibliography}
  80. \bibitem{lamport} L. Lamport. {\bf \LaTeX \ A Document Preparation System}
  81. Addison-Wesley, California 1986.
  82. \end{thebibliography}
  83. \include{index}
  84. \addcontentsline{toc}{chapter}{Index}
  85. \end{document}