Guest User

Untitled

a guest
Jun 21st, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.53 KB | None | 0 0
  1. documentclass{memoir}
  2. usepackage{csquotes}
  3. makeindex
  4. usepackage{xpatch}
  5. usepackage[indexing=true,authordate,backend=biber,language=auto,autolang=other]{biblatex-chicago}
  6. usepackage{filecontents}
  7.  
  8. renewbibmacro*{bibindex}{%
  9. ifbibindex
  10. {indexnames{author}%
  11. indexnames{editor}%
  12. indexnames{translator}%
  13. indexnames{commentator}%
  14. ifkeyword{pri}{indexfield{indextitle}}{}
  15. }
  16. {}}
  17.  
  18.  
  19. renewbibmacro*{citeindex}{%
  20. ifciteindex
  21. {indexnames{author}%
  22. indexnames{editor}%
  23. indexnames{translator}%
  24. indexnames{commentator}%
  25. ifkeyword{pri}{indexfield{indextitle}}{}
  26. }
  27. {}}
  28.  
  29. begin{filecontents}{pri.bib}
  30. @misc{Kuṭṭanīmata,
  31. entrysubtype = {classical},
  32. author = {Dāmodaragupta},
  33. title = {Kuṭṭanīmata},
  34. related = {DezsoGoodall2012},
  35. relatedoptions = {dataonly,useeditor=false,usetranslator=false}
  36. }
  37. end{filecontents}
  38. begin{filecontents}{sec.bib}
  39. @book{DezsoGoodall2012,
  40. title = {Dāmodaraguptaviracitaṃ Kuṭṭanīmatam},
  41. subtitle = {The Bawd’s Counsel, Being an Eighth-century Verse Novel in Sanskrit by Dāmodaragupta, Newly Edited and Translated into English},
  42. editor = {Csaba Dezső and Dominic Goodall},
  43. translator = {Csaba Dezső and Dominic Goodall},
  44. series = {Groningen Oriental Studies},
  45. number = {23},
  46. location = {Groningen},
  47. publisher = {Egbert Forsten},
  48. year = {2012}
  49. }
  50. end{filecontents}
  51. addbibresource{pri.bib}
  52. addbibresource{sec.bib}
  53. DeclareSourcemap{
  54. maps{
  55. map{
  56. perdatasource{pri.bib}
  57. step[fieldset=keywords, fieldvalue=pri]
  58. step[fieldsource=title, final]
  59. step[fieldset=sortkey, origfieldval]
  60. }
  61. }
  62. }
  63. DeclareFieldFormat[misc]{title}{mkbibemph{#1}isdot}
  64. newbibmacro*{pri:titleofauthor}{%
  65. ifentrytype{misc}
  66. {iffieldequalstr{entrysubtype}{classical}
  67. {ifbibliography
  68. {printfield{title}%
  69. ifnameundef{author}
  70. {}
  71. {setunit*{addspace}%
  72. bibstring{of}%
  73. setunit*{addspace}%
  74. printnames{author}%
  75. clearname{author}}%
  76. clearfield{title}}
  77. {printtext[bibhyperref]{printfield[citetitle]{title}}%
  78. ifnameundef{labelname}
  79. {}
  80. {setunit*{addspace}%
  81. bibstring{of}%
  82. setunit*{addspace}%
  83. printnames{labelname}}%
  84. clearfield{labeltitle}%
  85. clearname{labelname}}}
  86. {}}
  87. {}}
  88. xpretobibmacro{cite}
  89. {usebibmacro{pri:titleofauthor}}
  90. {}
  91. {}
  92. xpatchbibdriver{misc}
  93. {usebibmacro{bibindex}}
  94. {usebibmacro{bibindex}usebibmacro{pri:titleofauthor}}
  95. {}
  96. {}
  97. begin{document}
  98. Filler text autocite{Kuṭṭanīmata}.
  99.  
  100. Filler text autocite{DezsoGoodall2012}.
  101.  
  102. printbibliography[title=Primary Sources, keyword=pri,heading=subbibliography]
  103. printbibliography[title=Secondary Sources, notkeyword=pri,heading=subbibliography]
  104. printindex
  105. end{document}
  106.  
  107. renewbibmacro*{bibindex}{%
  108. ifbibindex
  109. {indexnames{author}%
  110. indexnames{editor}%
  111. indexnames{translator}%
  112. indexnames{commentator}%
  113. ifkeyword{pri}{indexfield{indextitle}}{}}
  114. {}}
  115.  
  116. renewbibmacro*{citeindex}{%
  117. ifciteindex
  118. {indexnames{author}%
  119. indexnames{editor}%
  120. indexnames{translator}%
  121. indexnames{commentator}%
  122. ifkeyword{pri}{indexfield{indextitle}}{}}
  123. {}}
  124.  
  125. newbibmacro*{bothindex}{%
  126. indexnames{author}%
  127. indexnames{editor}%
  128. indexnames{translator}%
  129. indexnames{commentator}%
  130. ifkeyword{pri}{indexfield{indextitle}}{}}
  131.  
  132. renewbibmacro*{bibindex}{%
  133. ifbibindex
  134. {usebibmacro{bothindex}}
  135. {}}
  136.  
  137. renewbibmacro*{citeindex}{%
  138. ifciteindex
  139. {usebibmacro{bothindex}}
  140. {}}
Add Comment
Please, Sign In to add comment