Guest User

Untitled

a guest
Nov 16th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.18 KB | None | 0 0
  1. documentclass[11pt]{book}
  2. usepackage{lmodern}
  3. usepackage[T1]{fontenc}
  4. usepackage{xcolor}
  5.  
  6. usepackage{amsmath}
  7. usepackage{amsbsy}
  8. usepackage{amssymb}
  9. usepackage{bm}
  10. usepackage{fixmath}
  11.  
  12. usepackage{titlesec}
  13. titleformat{subsection}[runin]{normalfontbfseries}{hspace{10mm}arabic{subsection}.}{1mm}{}{}
  14. % titleformat*{chapter}{bfseriesboldmath}%<<==BERNARD This causes an error
  15. titleformat*{section}{bfseriesboldmath}%<<==BERNARD This shrinks titles
  16. usepackage[detect-all]{siunitx}%<<<<<<<=======BERNARD
  17. usepackage[dotinlabels]{titletoc}
  18. titlecontents{chapter}[6pc]{addvspace{1pc}bfseriesfilright}{contentslabel[chaptername thecontentslabel]{6pc}}{}{hfillcontentspage}[addvspace{2pt}]%
  19. newcommandxquad{hspace*{0.4em plus .2em minus .2em}}%
  20. titlecontents*{p-section}[0pt]{filrightsmall}{}{}{, thecontentspage}[xquadtextbulletxquad][.]%
  21. newcommand{ChapterToc}{startcontents[chapters]printcontents[chapters]{p-}{1}{}vspace{10mm}}%
  22. setcounter{tocdepth}{1}% <- only parts, chapters and sections in tocs hspace{10mm}
  23.  
  24. usepackage{tcolorbox}%
  25. tcbuselibrary{%Begin load libraries for tcolorbox
  26. xparse,%
  27. }%End load libraries for tcolorbox
  28. usepackage{makeidx} %The imakeindex does not work
  29. makeindex
  30.  
  31. usepackage[hyperfootnotes=false]{hyperref}
  32. %=============== Begin the Heiko Oberdiek ``quick and dirty hack'' which loads showidx
  33. makeatletter
  34. ifHy@hyperindex
  35. defHyInd@ParenLeft{(}%
  36. % Hook in HyInd@@wrindex
  37. letHyInd@showidx@empty
  38. % Hook in HyInd@@wrindex for package showidx
  39. defHyInd@showidx#1{%
  40. @showidx{#1}%
  41. if@nobreak
  42. ifvmode
  43. nobrak
  44. fi
  45. fi
  46. }%
  47. % Load package showidx
  48. letsiOrg@makeindexmakeindex
  49. letsiOrg@@index@index
  50. letsiOrg@@wrindex@wrindex
  51. letsiOrg@indexindex
  52. RequirePackage{showidx}
  53. letmakeindexsiOrg@makeindex
  54. let@indexsiOrg@@index
  55. let@wrindexsiOrg@@wrindex
  56. letindexsiOrg@index
  57. % rest of hyperref part
  58. @ifpackageloaded{multind}{%
  59. letHyInd@org@wrindex@wrindex
  60. def@wrindex#1#2{HyInd@@wrindex{#1}#2||\}%
  61. defHyInd@@wrindex#1#2|#3|#4\{%
  62. ifx\#3\%
  63. HyInd@org@wrindex{#1}{#2|hyperpage}%
  64. else
  65. defHy@temp@A{#3}%
  66. ifxHy@temp@AHyInd@ParenLeft
  67. HyInd@org@wrindex{#1}{#2|#3hyperpage}%
  68. else
  69. HyInd@org@wrindex{#1}{#2|#3}%
  70. fi
  71. fi
  72. }%
  73. }{%
  74. def@wrindex#1{@@wrindex#1||\}
  75. def@@wrindex#1|#2|#3\{%
  76. ifx\#2\%
  77. protected@write@indexfile{}{%
  78. stringindexentry{#1|hyperpage}{thepage}%
  79. }%
  80. else
  81. defHy@temp@A{#2}%
  82. ifxHy@temp@AHyInd@ParenLeft
  83. protected@write@indexfile{}{%
  84. stringindexentry{#1|#2hyperpage}{thepage}%
  85. }%
  86. else
  87. protected@write@indexfile{}{%
  88. stringindexentry{#1|#2}{thepage}%
  89. }%
  90. fi
  91. fi
  92. endgroup
  93. HyInd@showidx{#1}%
  94. @esphack
  95. }%
  96. }%
  97. fi
  98. makeatother
  99. %=============== End the Heiko Oberdiek ``quick and dirty hack'' which loads showidx
  100. hypersetup{%begin colors
  101. colorlinks,
  102. linkcolor={red!50!black},
  103. }%end colors
  104.  
  105. usepackage{cleveref}% should be the last package
  106. Crefname{subsection}{Subsection}{Subsections}
  107. newcommand{titleref}{nameref}%displays TITLE of refered item
  108. setcounter{tocdepth}{1}% <- only parts, chapters and sections in tocs
  109.  
  110. %========================== Begin math in Showindex
  111. letoldopenparen(
  112. letoldcloseparen)
  113. def({protectoldopenparen}
  114. def){protectoldcloseparen}
  115. %========================== End math in Showindex
  116. %========================== Begin Andrew code for ref to indexed words as edited Oct 27 at 17:24
  117. newcommand{INDEX}[2][]{phantomsection%
  118. ifrelaxdetokenize{#1}relaxindex{#2}label{ind:#2}%
  119. elseindex{#2}label{ind:#1}fi%
  120. }%
  121. %========================== End Andrew code for ref to indexed words as edited Oct 27 at 17:24
  122. %===Begin DEX original
  123. newcommand{DEX}[2][]{%
  124. ifrelaxdetokenize{#1}relaxhyperref[ind:#2]{#2}%
  125. % (Cpageref{ind:#2})%
  126. elsehyperref[ind:#1]{#2}%
  127. %(Cpageref{ind:#1})%
  128. fi%
  129. }%
  130. %%===End DEX original
  131. %============== Begin To make Cpageref work with INDEX
  132. newcommand{PGX}[2][]{%
  133. ifrelaxdetokenize{#1}%
  134. relax%
  135. % hyperref[ind:#2]{#2}%
  136. Cpageref{ind:#2}%
  137. else%
  138. % hyperref[ind:#1]{#2}%
  139. Cpageref{ind:#1}%
  140. fi%
  141. }%
  142. %============== End To make Cpageref work with INDEX.
  143. begin{document}
  144. tableofcontents
  145. chapter{Chapter Title emboldens %
  146. 0 and $infty$ but not $0$ nor $x_{0}$ nor $MathText$%
  147. }%
  148. label{1-0-0}
  149. ChapterToc
  150. Some text
  151. with an indexed textbf{word}INDEX[]{word} and indexed math $boldsymbol{x_{0}}$INDEX[x0]{$x_{0}$}:
  152.  
  153. section{Section Title emboldens %
  154. 0 and $infty$ as well as $0$ and $x_{0}$ and $MathText$%
  155. }%
  156. label{1-1-0}
  157. A bit more text and finally:
  158.  
  159.  
  160. subsection{%
  161. Subsection Title emboldens %
  162. 0 and $infty$ %
  163. but not $0$ nor $x_{0}$ nor $MathText$. %
  164. However %
  165. $boldsymbol{MathText}$, %
  166. $boldsymbol{x_{0}}$ and %
  167. $bm{0}$ all work.%
  168. }%
  169. label{1-2-1}
  170. Plus just a tiny little bit of text%
  171. with a referenced DEX[word]{word} %
  172. which was indexed in Cref{1-0-0} nameref{1-0-0} on Cpageref{1-0-0}
  173.  
  174. phantomsection%otherwise, clicking on index in toc gets to GNU
  175. addcontentsline{toc}{chapter}{Index}
  176. printindex
  177. end{document}
Add Comment
Please, Sign In to add comment