Advertisement
Guest User

Untitled

a guest
Nov 9th, 2021
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 3.97 KB | None | 0 0
  1. % Options for packages loaded elsewhere
  2. \PassOptionsToPackage{unicode}{hyperref}
  3. \PassOptionsToPackage{hyphens}{url}
  4. %
  5. \documentclass[
  6. ]{book}
  7. \usepackage{amsmath,amssymb}
  8. \usepackage{lmodern}
  9. \usepackage{ifxetex,ifluatex}
  10. \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  11.   \usepackage[T1]{fontenc}
  12.  \usepackage[utf8]{inputenc}
  13.  \usepackage{textcomp} % provide euro and other symbols
  14. \else % if luatex or xetex
  15.   \usepackage{unicode-math}
  16.  \defaultfontfeatures{Scale=MatchLowercase}
  17.  \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
  18. \fi
  19. % Use upquote if available, for straight quotes in verbatim environments
  20. \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
  21. \IfFileExists{microtype.sty}{% use microtype if available
  22.   \usepackage[]{microtype}
  23.  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
  24. }{}
  25. \makeatletter
  26. \@ifundefined{KOMAClassName}{% if non-KOMA class
  27.   \IfFileExists{parskip.sty}{%
  28.     \usepackage{parskip}
  29.  }{% else
  30.     \setlength{\parindent}{0pt}
  31.    \setlength{\parskip}{6pt plus 2pt minus 1pt}}
  32. }{% if KOMA class
  33.   \KOMAoptions{parskip=half}}
  34. \makeatother
  35. \usepackage{xcolor}
  36. \IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
  37. \IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
  38. \hypersetup{
  39.  pdftitle={A Minimal Book Example},
  40.  pdfauthor={John Doe},
  41.  hidelinks,
  42.  pdfcreator={LaTeX via pandoc}}
  43. \urlstyle{same} % disable monospaced font for URLs
  44. \usepackage{longtable,booktabs,array}
  45. \usepackage{calc} % for calculating minipage widths
  46. % Correct order of tables after \paragraph or \subparagraph
  47. \usepackage{etoolbox}
  48. \makeatletter
  49. \patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
  50. \makeatother
  51. % Allow footnotes in longtable head/foot
  52. \IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
  53. \makesavenoteenv{longtable}
  54. \usepackage{graphicx}
  55. \makeatletter
  56. \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
  57. \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
  58. \makeatother
  59. % Scale images if necessary, so that they will not overflow the page
  60. % margins by default, and it is still possible to overwrite the defaults
  61. % using explicit options in \includegraphics[width, height, ...]{}
  62. \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
  63. % Set default figure placement to htbp
  64. \makeatletter
  65. \def\fps@figure{htbp}
  66. \makeatother
  67. \setlength{\emergencystretch}{3em} % prevent overfull lines
  68. \providecommand{\tightlist}{%
  69.   \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
  70. \setcounter{secnumdepth}{-\maxdimen} % remove section numbering
  71. \ifluatex
  72.   \usepackage{selnolig}  % disable illegal ligatures
  73. \fi
  74. \usepackage[]{natbib}
  75. \bibliographystyle{plainnat}
  76.  
  77. \title{A Minimal Book Example}
  78. \author{John Doe}
  79. \date{2021-11-09}
  80.  
  81. \begin{document}
  82. \maketitle
  83.  
  84. {
  85. \setcounter{tocdepth}{1}
  86. \tableofcontents
  87. }
  88. \hypertarget{about}{%
  89. \chapter{About}\label{about}}
  90.  
  91. \hypertarget{hello-bookdown}{%
  92. \chapter{Hello bookdown}\label{hello-bookdown}}
  93.  
  94. All chapters start with a first-level heading followed by your chapter title, like the line above. There should be only one first-level heading (\texttt{\#}) per .Rmd file.
  95.  
  96. \begin{longtable}[]{@{}
  97.  >{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.22}}
  98.  >{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.22}}
  99.  >{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.29}}@{}}
  100. \toprule
  101. Fruit & Price & Advantages \\
  102. \midrule
  103. \endhead
  104. Bananas & \$1.34 & \begin{minipage}[t]{\linewidth}\raggedright
  105. \begin{itemize}
  106. \tightlist
  107. \item
  108.  built-in wrapper
  109. \item
  110.  bright color
  111. \end{itemize}
  112. \end{minipage} \\
  113. Oranges & \$2.10 & \begin{minipage}[t]{\linewidth}\raggedright
  114. \begin{itemize}
  115. \tightlist
  116. \item
  117.  cures scurvy
  118. \item
  119.  tasty
  120. \end{itemize}
  121. \end{minipage} \\
  122. \bottomrule
  123. \end{longtable}
  124.  
  125.  \bibliography{book.bib,packages.bib}
  126.  
  127. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement