Guest User

Untitled

a guest
Jul 20th, 2018
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. startbuffer[ref]
  2. @article{solo,
  3. author = {MyLast, MyFirst},
  4. title = {Solo work},
  5. journal = {Journal},
  6. year = {2000},
  7. month = {1},
  8. volume = {1}
  9. }
  10.  
  11. @article{co,
  12. author = {MyLast, MyFirst and CoLast, CoFirst},
  13. title = {Joint work},
  14. journal = {Journal},
  15. month = {1},
  16. year = {2000},
  17. volume = {1}
  18. }
  19. stopbuffer
  20.  
  21. usebtxdataset[ref][ref.buffer]
  22. setupbtx[dataset=ref]
  23.  
  24. definebtxrendering[ref][dataset=ref]
  25. setupbtx[default:cite]
  26. [alternative=authoryear,
  27. etallimit=1]
  28.  
  29. define[1]formatname{
  30. % Placeholder formatting
  31. ctxlua{tex.sprint('{\bf ' .. '#1' .. '}')}
  32. }
  33.  
  34. starttexdefinition btx:test
  35. formatname{btxflush{author}}
  36. stoptexdefinition
  37.  
  38. startsetups btx:default:list:article
  39. texdefinition{btx:test}
  40. texdefinition{btx:default:title}
  41. texdefinition{btx:default:journal}
  42. texdefinition{btx:default:year}
  43. removeunwantedspaces
  44. removepunctuation
  45. btxperiod
  46. stopsetups
  47.  
  48. starttext
  49.  
  50. Citations: cite[solo], cite[co]
  51.  
  52. startsubject[title=Bibliography]
  53. placelistofpublications[ref][method=dataset]
  54. stopsection
  55.  
  56. stoptext
  57.  
  58. startbuffer[ref]
  59. @article{solo,
  60. author = {MyLast, MyFirst},
  61. title = {Solo work},
  62. journal = {Journal},
  63. year = {2000},
  64. month = {1},
  65. volume = {1}
  66. }
  67.  
  68. @article{co,
  69. author = {MyLast, MyFirst and CoLast, CoFirst},
  70. title = {Joint work},
  71. journal = {Journal},
  72. month = {1},
  73. year = {2000},
  74. volume = {1}
  75. }
  76. stopbuffer
  77.  
  78. usebtxdataset[ref][ref.buffer]
  79. setupbtx[dataset=ref]
  80.  
  81. definebtxrendering[ref][dataset=ref]
  82. setupbtx[default:cite]
  83. [alternative=authoryear,
  84. etallimit=1]
  85.  
  86. startluacode
  87. local dataset = publications.datasets.ref
  88. for tag, entry in pairs(dataset.luadata) do
  89. -- Do complex formatting in lua... the following is a placeholder
  90. dataset.luadata[tag].myauthor = '{\bf ' .. entry.author ..' }'
  91. end
  92. stopluacode
  93.  
  94. starttexdefinition btx:test
  95. btxdirect{myauthor}
  96. stoptexdefinition
  97.  
  98. startsetups btx:default:list:article
  99. texdefinition{btx:test}
  100. texdefinition{btx:default:title}
  101. texdefinition{btx:default:journal}
  102. texdefinition{btx:default:year}
  103. removeunwantedspaces
  104. removepunctuation
  105. btxperiod
  106. stopsetups
  107.  
  108. starttext
  109.  
  110. Citations: cite[solo], cite[co]
  111.  
  112. startsubject[title=Bibliography]
  113. placelistofpublications[ref][method=dataset]
  114. stopsection
  115.  
  116. stoptext
Add Comment
Please, Sign In to add comment