Advertisement
Guest User

Untitled

a guest
May 30th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. newcommandmybook[1]{paragraph{B getcurrentref{subsection}-getcurrentref{paragraph}: #1}hfillparvspace{0.2baselineskip}}%
  2.  
  3. documentclass{scrreprt}
  4. usepackage{etoolbox}
  5.  
  6. % get currentref command
  7. newcommandgetcurrentref[1]{%
  8. ifnumequal{value{#1}}{0}
  9. {??}
  10. {thevalue{#1}}%
  11. }
  12.  
  13. % remove label from paragraph, even if numbered
  14. renewcommand*{paragraphformat}{}
  15.  
  16. % custom paragraph heading
  17. newcommandmybook[1]{paragraph{B getcurrentref{subsection}-getcurrentref{paragraph}: #1}hfillparvspace{0.2baselineskip}}%
  18.  
  19. setcounter{secnumdepth}{4} % how many sectioning levels to assign numbers to
  20. setcounter{tocdepth}{2} % how many sectioning levels to show in ToC
  21.  
  22. begin{document}
  23.  
  24. chapter{Books (chapter)}
  25. section{Fiction (section)}
  26. subsection{Dystopy (subsection)}
  27.  
  28. subsubsection*{George Orwell (subsubsection 1.1.1.1)}
  29.  
  30. mybook{Animal Farm (paragraph)}label{AnimalFarm}
  31.  
  32. Animal Farm is an allegorical and dystopian novella by George Orwell, first [...]
  33.  
  34. mybook{1984 (paragraph)}
  35.  
  36. Nineteen Eighty-Four, often published as 1984, is a dystopian novel [...]
  37. I'd like to reference Animal Farm (ref{AnimalFarm}) as B 1-1 [...]
  38.  
  39. subsubsection*{Aldous Huxley (subsubsection 1.1.1.2)}
  40.  
  41. mybook{Brave New World (paragraph)}
  42.  
  43. Brave New World is a novel written in 1931 by [...]
  44.  
  45. subsection{Historic Novel (subsection)}
  46.  
  47. subsubsection*{Ken Follet}
  48.  
  49. mybook{The Pillars of the Earth (paragraph)}
  50.  
  51. section{Non-Fiction}
  52. subsection{Cooking}
  53. subsubsection*{Baking}
  54. mybook{Baking without flour}
  55. subsubsection*{Cooking}
  56. mybook{Cooking without water}
  57.  
  58. end{document}
  59.  
  60. documentclass{scrreprt}
  61. usepackage{etoolbox}
  62.  
  63. % get currentref command
  64. newcommandgetcurrentref[1]{%
  65. ifnumequal{value{#1}}{0}
  66. {??}
  67. {thevalue{#1}}%
  68. }
  69.  
  70. % remove label from paragraph, even if numbered
  71. renewcommand*{paragraphformat}{}
  72.  
  73. % custom paragraph heading
  74. newcommandmybook[1]{paragraph{B getcurrentref{subsection}-getcurrentref{paragraph}: #1}hfillparvspace{0.2baselineskip}}%
  75.  
  76. renewcommand{theparagraph}{B arabic{subsection}-arabic{paragraph}}
  77.  
  78.  
  79. usepackage{cleveref}
  80.  
  81. crefname{paragraph}{paragraph}{paragraphs}
  82. Crefname{paragraph}{Paragraph}{Paragraphs}
  83.  
  84.  
  85. setcounter{secnumdepth}{4} % how many sectioning levels to assign numbers to
  86. setcounter{tocdepth}{2} % how many sectioning levels to show in ToC
  87.  
  88.  
  89.  
  90.  
  91. begin{document}
  92.  
  93.  
  94. chapter{Books}
  95. section{Fiction}
  96. subsection{Dystopy}
  97.  
  98. subsubsection*{George Orwell}
  99.  
  100. mybook{Animal Farm}label{AnimalFarm}
  101.  
  102. Animal Farm is an allegorical and dystopian novella by George Orwell, first [...]
  103.  
  104. mybook{1984}
  105.  
  106. Nineteen Eighty-Four, often published as 1984, is a dystopian novel [...]
  107.  
  108. subsubsection*{Aldous Huxley}
  109.  
  110. mybook{Brave New World}
  111.  
  112. Brave New World is a novel written in 1931 by [...]
  113.  
  114. section{Interpretation}
  115.  
  116. I'd like to Reference Animal Farm (ref{AnimalFarm}) as B 1-1 [...]
  117.  
  118. cref{AnimalFarm}
  119.  
  120. end{document}
  121.  
  122. documentclass[a4paper, 11pt]{article}
  123. usepackage[ngerman]{babel}
  124. usepackage[utf8x]{inputenc}
  125. usepackage{hyperref}
  126.  
  127.  
  128. newcounter{book}
  129. newcounter{subbook}[book]
  130.  
  131. defbookagraph#1{stepcounter{book}stepcounter{subbook} paragraph{B arabic{book} -arabic{subbook} #1}expandafterlabel{bookagraph_arabic{book}arabic{subbook}}}
  132.  
  133. begin{document}
  134.  
  135. arabic{book}
  136.  
  137. bookagraph{Heute}
  138.  
  139. As seen in nameref{bookagraph_11}
  140.  
  141. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement