summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-contrib/biblatex-historian/historian.cbx
blob: f181801d76f5e4e14dcc6e098ebe6ec500ad322e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% historian.cbx, v0.4, 2010/08/22
% A citation style for use with biblatex
% Developed and maintained by Sander Gliboff, 
% based on guidelines from the Turabian Manual for Writers, 7th ed.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ProvidesFile{historian.cbx}[2010/08/22 v0.4 historian citation style]

   \@ifpackagelater{biblatex}{2010/08/04}
     {}
     {\PackageError{biblatex}
	{Outdated 'biblatex' package
	The 'historian' style requires biblatex v0.9b or later.\MessageBreak
	 You are using: '\csuse{ver@biblatex.sty}'.\MessageBreak
	 This is a fatal error.}%
      \endinput}


%Redefine \blockcquote command of the csquotes package to generate a footnote
\SetCiteCommand{\footcite}


\ExecuteBibliographyOptions{citetracker=context,ibidtracker=constrict,singletitle,pagetracker,autocite=footnote}%
\DeclareLanguageMapping{american}{historian}%Added
\ExecuteBibliographyOptions{abbreviate=false,dateabbrev=false}%Added

%Option to suppress the crossreferences to first citation of a source (new in v. 0.2)
\newtoggle{noterefsflag}
\toggletrue{noterefsflag}
\DeclareBibliographyOption{printnoterefs}[true]
	{\ifstrequal{#1}{true}
		{\toggletrue{noterefsflag}}%
		{\togglefalse{noterefsflag}}}%
\DeclareEntryOption{printnoterefs}[true]
	{\ifstrequal{#1}{true}
		{\toggletrue{noterefsflag}}%
		{\togglefalse{noterefsflag}}}%
		
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%This style builds on Lehman's original verbose-inote style,
%from which the following macros are copied:


\DeclareFieldFormat{bibhyperlink}{%
  \bibhyperlink{\thefield{entrykey}:\csuse{cbx@\iffootnote{f}{t}@\thefield{entrykey}}}{#1}}
  
\DeclareFieldFormat{bibhypertarget}{%
  \bibhypertarget{\thefield{entrykey}:\the\value{instcount}}{#1}}
  
\providecommand*{\mkibid}[1]{#1}

\newtoggle{cbx:loccit}
\newtoggle{cbx:pageref}

%The following are changed from verbose-inote to initialize the citepages option as `omit'
\newcommand\citepagesseparator{\bibpagespunct}
\newbibmacro*{cite:citepages}{}
\newbibmacro*{cite:full:citepages}{\ifboolexpr{
      test {\ifnumequal{\value{citecount}}{\value{citetotal}}}
      and
      test {\iffieldpages{postnote}}
    }
      {\togglefalse{printpagerange}}
      {}}
\newbibmacro*{cite:postnote}{\usebibmacro{cite:postnote:ibidpage}}

\DeclareBibliographyOption{ibidpage}[true]{%
  \ifstrequal{#1}{true}
    {\ExecuteBibliographyOptions{loccittracker=constrict}}
    {\ExecuteBibliographyOptions{loccittracker=false}}}
\DeclareBibliographyOption{pageref}[true]{%
  \settoggle{cbx:pageref}{#1}}

\DeclareBibliographyOption{citepages}[permit]{%
  \ifcsdef{cbx@opt@citepages@#1}
    {\csuse{cbx@opt@citepages@#1}}
    {\PackageError{biblatex}
       {Invalid option 'citepages=#1'}
       {Valid values are 'permit', 'suppress', 'omit', 'separate'.}}}

\def\cbx@opt@citepages@permit{%
  \renewcommand\citepagesseparator{\addcomma\addspace}%Changed: no colon in this case
  \renewbibmacro*{cite:citepages}{}%
  \renewbibmacro*{cite:full:citepages}{}%
  \renewbibmacro*{cite:postnote}{%
    \usebibmacro{cite:postnote:ibidpage}}}

\def\cbx@opt@citepages@suppress{%
  \renewbibmacro*{cite:citepages}{}%
  \renewbibmacro*{cite:full:citepages}{%
    \togglefalse{printpagerange}}%
  \renewbibmacro*{cite:postnote}{%
    \usebibmacro{cite:postnote:ibidpage}}}

\def\cbx@opt@citepages@omit{%
\relax}%Changed--macros initialized for the omit option

\def\cbx@opt@citepages@separate{%
  \renewcommand\citepagesseparator{\addcomma\addspace}%Changed: no colon in this case
  \providetoggle{cbx:fullcite}%
  \renewbibmacro*{cite:citepages}{%
    \global\togglefalse{cbx:fullcite}}%
  \renewbibmacro*{cite:full:citepages}{%
    \global\toggletrue{cbx:fullcite}}%
  \renewbibmacro*{cite:postnote}{%
    \ifboolexpr{
      togl {cbx:fullcite}
      and
      test {\iffieldpages{postnote}}
      and
      test {\ifnumequal{\value{citecount}}{\value{citetotal}}}
      and
      (
	not test {\iffieldundef{pages}}
	or
	not test {\iffieldundef{pagetotal}}
      )
    }
      {\usebibmacro{cite:postnote:pages}}
      {\usebibmacro{cite:postnote:ibidpage}}}
  \providebibmacro*{cite:postnote:pages}{%
    \setunit{\postnotedelim}%
    \bibstring{thiscite}%
    \setunit{\addspace}%
    \printfield{postnote}}}

\newbibmacro*{cite}{%
  \usebibmacro{cite:citepages}%
  \global\togglefalse{cbx:loccit}%
  \ifciteseen
    {\iffieldundef{shorthand}
       {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
          {\usebibmacro{cite:ibid}}
          {\usebibmacro{cite:short}}}
       {\usebibmacro{cite:shorthand}}}
    {\usebibmacro{cite:full}%
     \usebibmacro{cite:save}}}

\newbibmacro*{cite:save}{%
  \csxdef{cbx@t@\thefield{entrykey}}{\the\value{instcount}}}

\newbibmacro*{cite:full}{%
  \usebibmacro{cite:full:citepages}%
  \printtext[bibhypertarget]{%
    \usedriver
      {\DeclareNameAlias{sortname}{default}}
      {\thefield{entrytype}}}%
  \usebibmacro{shorthandintro}}

\newbibmacro*{cite:short}{%
  \printnames{labelname}%
  \setunit*{\nametitledelim}%
  \printtext[bibhyperlink]{%
    \printfield[citetitle]{labeltitle}}}

\newbibmacro*{cite:shorthand}{%
  \printtext[bibhyperlink]{\printfield{shorthand}}}

\newbibmacro*{cite:ibid}{%
  \printtext[bibhyperlink]{\bibstring[\mkibid]{ibidem}}%
  \ifloccit
    {\global\toggletrue{cbx:loccit}}
    {}}

\newbibmacro*{cite:postnote:ibidpage}{%
  \iftoggle{cbx:loccit}
    {}
    {\usebibmacro{postnote}}}

%\newbibmacro*{footcite}{%
%  \usebibmacro{cite:citepages}%
%  \global\togglefalse{cbx:loccit}%
%  \ifciteseen
%    {\iffieldundef{shorthand}
%       {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
%          {\usebibmacro{footcite:ibid}}
%          {\usebibmacro{footcite:note}}}
%       {\usebibmacro{footcite:shorthand}}}
%    {\usebibmacro{footcite:full}%
%     \usebibmacro{footcite:save}}}

\newbibmacro*{footcite:save}{%
  \csxdef{cbx@f@\thefield{entrykey}}{\the\value{instcount}}%
  \label{cbx@\the\value{instcount}}}

%\newbibmacro*{footcite:full}{%
%  \usebibmacro{cite:full:citepages}%
%  \printtext[bibhypertarget]{%
%    \usedriver
%      {\DeclareNameAlias{sortname}{default}}
%      {\thefield{entrytype}}}%
%  \usebibmacro{shorthandintro}}

%\newbibmacro*{footcite:note}{%
%  \ifnameundef{labelname}
%    {\printfield{label}}
%    {\printnames{labelname}}%
%  \ifsingletitle
%    {}
%    {\setunit*{\nametitledelim}%
%     \printfield[title]{labeltitle}}%
%  \setunit*{\addcomma\space}%
%  \printtext{%
%    \bibstring{seenote}\addnbspace
%    \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}%
%    \iftoggle{cbx:pageref}
%      {\ifsamepage{\the\value{instcount}}
%                  {\csuse{cbx@f@\thefield{entrykey}}}
%         {}
%	 {\addcomma\space\bibstring{page}\addnbspace
%	  \pageref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}}
%      {}}}

\newbibmacro*{footcite:shorthand}{%
  \printtext[bibhyperlink]{\printfield{shorthand}}}

\newbibmacro*{footcite:ibid}{%
  \printtext[bibhyperlink]{\bibstring[\mkibid]{ibidem}}%
  \ifloccit
    {\global\toggletrue{cbx:loccit}}
    {}}

%\DeclareCiteCommand{\cite}
%  {\usebibmacro{prenote}}
%  {\usebibmacro{citeindex}%
%   \iffootnote
%     {\usebibmacro{footcite}}
%     {\usebibmacro{cite}}}
%  {\multicitedelim}
%  {\usebibmacro{cite:postnote}}

%\DeclareCiteCommand{\parencite}[\mkbibparens]
%  {\usebibmacro{prenote}}
%  {\usebibmacro{citeindex}%
%   \iffootnote
%     {\usebibmacro{footcite}}
%     {\usebibmacro{cite}}}
%  {\multicitedelim}
%  {\usebibmacro{cite:postnote}}

%\DeclareCiteCommand{\footcite}[\mkbibfootnote]
%  {\usebibmacro{prenote}}
%  {\usebibmacro{citeindex}%
%   \usebibmacro{footcite}}
%  {\multicitedelim}
%  {\usebibmacro{cite:postnote}}

\DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{footcite}}
  {\multicitedelim}
  {\usebibmacro{cite:postnote}}
  
%End of inherited routines from verbose-inote 

%%%%%%%%%%		MODIFIED CITE AND FOOTCITE CITECOMMANDS		%%%%%%%%%%%%%%%%%%%%%%%%%%

\newtoggle{repeatedcitationflag}%Needed for punctuating postnote

\DeclareCiteCommand{\cite}
	{\usebibmacro{prenote}}
	{\usebibmacro{citeindex}%
%Test for repeated citation before the new key gets saved
	\ifciteseen
		{\toggletrue{repeatedcitationflag}}%
		{\togglefalse{repeatedcitationflag}}%
		\iffootnote
			{%then call footcite macro
				\usebibmacro{footcite}}%
			{%else cite macro instead of footcite
				\usebibmacro{cite}}}%
	{\multicitedelim}
	{\ifthenelse{\equal{\thefield{entrytype}}{\entrytypearticle}}
		{%Then special case for articles with page ranges in postnote
			\ifboolexpr{test {\ifnumequal{\value{citecount}}{\value{citetotal}}}
     					 and test {\iffieldpages{postnote}}}
				{%Page range was suppressed; need colon instead of comma before postnote
					\iftoggle{repeatedcitationflag}
						{%then exception after short forms in repeated citations
							\relax}%
						{%else insert the colon
							\citepagesseparator}%
					}%
				{%else no page range recognized in postnote
					\relax}%
			}%
		{%Else not an article
			\relax
			}%
		\usebibmacro{cite:postnote}
	}%End postcode


\DeclareCiteCommand{\footcite}[\mkbibfootnote]
	{\usebibmacro{prenote}}
	{\usebibmacro{citeindex}%
%Test for repeated citation before the new key gets saved
	\ifciteseen
		{\toggletrue{repeatedcitationflag}}%
		{\togglefalse{repeatedcitationflag}}%
	\usebibmacro{footcite}}
	{\multicitedelim}
{\ifthenelse{\equal{\thefield{entrytype}}{\entrytypearticle}}
		{%Then special case for articles with page ranges in postnote
			\ifboolexpr{test {\ifnumequal{\value{citecount}}{\value{citetotal}}}
     					 and test {\iffieldpages{postnote}}}
				{%Pages field was suppressed; need colon instead of comma before postnote
					\iftoggle{repeatedcitationflag}
						{%then exception after short forms in repeated citations
							\relax}%
						{%else insert the colon
							\citepagesseparator}%
					}%
				{%else no page range recognized in postnote
					\relax}%
			}%
		{%Else not an article
			\relax
			}%
		\usebibmacro{cite:postnote}
	}%End postcode
  

%%%%%%%%%%		MODIFIED FOOTCITE MACRO		%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%Loopcode of footcite command modified from verbose-inote to include special short forms
\newbibmacro*{footcite}{%
\usebibmacro{cite:citepages}%
\global\togglefalse{cbx:loccit}%
\ifciteseen
	{%then1 repeated citation
		\iffieldundef{shorthand}%
       		{%Then2 no shorthand
				\ifthenelse{\equal{\thefield{entrysubtype}}{\subtypeclassic}%
       			\OR\equal{\thefield{entrysubtype}}{\subtypebiblical}}%
       				{%Then3 use special short form for classics, instead of ibid. or note
						\usebibmacro{footcite:shortclassic}}%
					{%Else3
						\ifthenelse{\equal{\thefield{entrysubtype}}{\subtypepublicdocument}%
						\OR\equal{\thefield{entrytype}}{legal}%
						\OR\equal{\thefield{entrytype}}{legislation}%
						\OR\equal{\thefield{entrytype}}{jurisdiction}}%
							{%Then4 different short form for government documents
								\usebibmacro{footcite:shortgov}}%
							{%Else4 default routines
								\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
									{\usebibmacro{footcite:ibid}}%
          							{\usebibmacro{footcite:note}}%
							}%Endif, end else4
					}%Endif, end else3
			}%End then2
			{%Else2 use shorthand
				\usebibmacro{footcite:shorthand}%
			}%Endif, end else2
	}%End then1
    {%Else1 not a repeated citation: cite in full
    	\usebibmacro{footcite:full}%
     	\usebibmacro{footcite:save}%
	}%Endif, end else1
}%End footcite macro

     
%Like the Verbose styles, historian.cbx uses the drivers from the bbx file
\newbibmacro*{footcite:full}{%
%Bbx file defines periods as unit punctuation; here we change to commas
\renewcommand\newunitpunct{\addcomma\addspace}%
\usebibmacro{cite:full:citepages}%
\printtext[bibhypertarget]{%
	\usedriver
      {\DeclareNameAlias{sortname}{default}}
      {\thefield{entrytype}}}%
  \usebibmacro{shorthandintro}}%


\newbibmacro*{footcite:shorthand}{%
  \printtext[bibhyperlink]{\printfield{shorthand}}}

\newbibmacro*{footcite:ibid}{%
  \printtext[bibhyperlink]{\bibstring[\mkibid]{ibidem}}%
  \ifloccit
    {\global\toggletrue{cbx:loccit}}
    {}}


\DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{footcite}}
  {\multicitedelim}
  {\usebibmacro{cite:postnote}}

%Modified from verbose-inote.cbx to include special short forms for letters, archives, documents, and some non-print sources
\newbibmacro*{footcite:note}{%
\ifnameundef{labelname}
    {\printfield{label}}%
    {\ifthenelse{\equal{\thefield{entrytype}}{performance}}%
		{%Titles only
			\printfield[title]{labeltitle}}%
		{\printnames{labelname}%
    		\ifthenelse{\equal{\thefield{entrytype}}{letter}}%
    			{\setunit*{\addspace\bibstring{letterto}\addspace}%
			\printnames[labelname]{namec}%
			\setunit{\addcomma\addspace}%
			\usebibmacro{date}}%
			{\ifthenelse{\equal{\thefield{entrytype}}{customa}}
				{\setunit*{\addspace}%
				\printfield[noformat]{nameaddon}}%
				{\relax}}}%
    }%
\ifsingletitle
    {\relax}%
    {\ifthenelse{\equal{\thefield{entrytype}}{performance}}
    		{%Title label already printed
			\relax}%
		{\setunit*{\nametitledelim}%
		\printfield[title]{labeltitle}%
		\ifthenelse{\equal{\thefield{entrytype}}{customd}}%
			{\setunit*{\addcomma\addspace}%
			\printfield[noformat]{titleaddon}%
			\setunit*{\addspace}%
			\printnames[labelname]{namec}}%
		{\relax}%
     	}%
	}%
\iftoggle{noterefsflag}%
	{%Then option set for note references
		\iftoggle{xrefflag}
  			{%Then suppress note function in crossreferences in any case
				\relax}%
			{%Else print note number
				\setunit{\addcomma\space}%
				\printtext {%
				    \bibstring{seenote}\addnbspace
				    \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}%
				    \iftoggle{cbx:pageref}
				      {\ifsamepage{\the\value{instcount}}
				                  {\csuse{cbx@f@\thefield{entrykey}}}
				         {}
					 {\addcomma\space\bibstring{page}\addnbspace
					  \pageref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}}
				      {}}%end printtext
      			}%endelse, endiftoggle
		}%Endthen
    {%Else option set to suppress note references
    		\relax}%Endiftoggle
}
     
\newbibmacro{footcite:shortclassic}{%
\iffieldundef{label}%
	{\ifnameundef{shortauthor}
		{\printnames{author}}%
		{\printnames{shortauthor}}%
	\unspace
	\setunit{\addspace}%
	\iffieldundef{shorttitle}
		{\ifthenelse{\equal{\thefield{entrysubtype}}{\subtypebiblical}}
			{\printfield[noformat]{title}}%
			{\printfield{title}}}%
		{\ifthenelse{\equal{\thefield{entrysubtype}}{\subtypebiblical}}
			{\printfield[noformat]{shorttitle}\isdot}%
			{\printfield[title]{shorttitle}\isdot}}}%
	{\printfield{label}}%
}%

     
\newbibmacro{footcite:shortgov}{%
\iffieldundef{label}%
	{\ifnameundef{shortauthor}%
		{\ifthenelse{\equal{\thefield{authortype}}{\authortyperedundant}}%
			{\relax}%
			{\printnames{author}\setunit*{\addcomma\addspace}}}%
		{\printnames{shortauthor}\setunit*{\addcomma\addspace}}%
	\iffieldundef{shorttitle}%
		{\iffieldundef{title}%
			{\iffieldundef{shortjournal}%
				{\printfield[title]{journaltitle}}%
				{\printfield[title]{shortjournal}\isdot}%
			\setunit{\addcomma\addspace}%
			\printfield{note}\isdot\setunit{\addcomma\addspace}%
			\printfield[noformat]{volume}%
			\printfield{part}%
			}%
			{\printfield{title}}%
			}%
		{\printfield[title]{shorttitle}\isdot}}%
	{\printfield{label}}%
}%

%%%%%%%%%%	CITE-COMMAND VARIATIONS WITH ALTERNATE PUNCTUATION		%%%%%%%%

%Special foocite command with a period before the postnote
\DeclareCiteCommand{\footcitedot}[\mkbibfootnote]
  {\bibsentence
   \usebibmacro{prenote}}%
  {\usebibmacro{citeindex}%
   \usebibmacro{footcite}}%
  {\multicitedelim}%
  {\iftoggle{cbx:loccit}
    {}
    {\iffieldundef{postnote}
    		{}
    		{\addperiod\addspace
     	\printfield{postnote}}}}%
 
%Special footcite command without punctuation or spacing before the postnote    
\DeclareCiteCommand{\footcitenodot}[\mkbibfootnote]
  {\bibsentence
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{footcite}}%
  {\multicitedelim}%
  {\iftoggle{cbx:loccit}%
    {}%
    {\iffieldundef{postnote}%
    		{}%
    		{\setunit{\unspace}%
		\printfield{postnote}}}}%
		
 
%Special footcite command with a colon before the postnote    
\DeclareCiteCommand{\footcitecolon}[\mkbibfootnote]
{\bibsentence
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%   		
%Set flag to have article driver print pages field only when there's no postnote
\iffieldundef{postnote}
	{\toggletrue{printpagerange}}%
	{\togglefalse{printpagerange}}%
\usebibmacro{footcite}}%
{\multicitedelim}%
{\iftoggle{cbx:loccit}%
	{}
    {\iffieldundef{postnote}%
    		{\relax}%
    		{\bibpagespunct
		\printfield{postnote}}}}%
		

%Special cite command with a period before the postnote (new in v. 0.2)
\DeclareCiteCommand{\citedot}[]
  {\bibsentence
   \usebibmacro{prenote}}%
  {\usebibmacro{citeindex}%
   \usebibmacro{footcite}}% [Sic. The \cite macro doesn't have all the short forms]
  {\multicitedelim}%
  {\iftoggle{cbx:loccit}
    {}
    {\iffieldundef{postnote}
    		{}
    		{\addperiod\addspace
     	\printfield{postnote}}}}%
 
%Special cite command without punctuation before the postnote (new in v. 0.2)
\DeclareCiteCommand{\citenodot}[]
  {\bibsentence
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \usebibmacro{footcite}}% [Sic. The \cite macro doesn't have all the short forms]
  {\multicitedelim}%
  {\iftoggle{cbx:loccit}%
    {}%
    {\iffieldundef{postnote}%
    		{}%
    		{%\addspace
		\printfield{postnote}}}}%
		
%Special cite command with a colon before the postnote (new in v. 0.2)
\DeclareCiteCommand{\citecolon}[]%
{\bibsentence
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%   		
%Set flag to have article driver print pages only when there's no postnote
\iffieldundef{postnote}
	{\toggletrue{printpagerange}}%
	{\togglefalse{printpagerange}}%
\usebibmacro{footcite}}% [Sic. The \cite macro doesn't have all the short forms]
{\multicitedelim}%
{\iftoggle{cbx:loccit}%
	{}
    {\iffieldundef{postnote}%
    		{\relax}%
    		{\bibpagespunct
		\printfield{postnote}}}}%
		
%Multicite versions with modified punctuation between citations

\DeclareMultiCiteCommand{\footcitedots}[\mkbibfootnote]{\footcite}{\addperiod\addspace}%
\DeclareMultiCiteCommand{\footcitenodots}[\mkbibfootnote]{\footcite}{\space}

%%%%%%%%%		MODIFIED PARENCITE	%%%%%%%%%%%%%%%%%%%%%%%%%

%Special author-title form for parenthetical notes
\DeclareCiteCommand{\parencite}[\mkbibparens]
  {\usebibmacro{prenote}}%
  {\usebibmacro{citeindex}%
    \iffieldundef{shorthand}%
    {\usebibmacro{parenauthor}%
    \setunit*{\addcomma\addspace}%
    \iffieldundef{shorttitle}%
    {\printfield[citetitle]{title}}%
    {\printfield[citetitle]{shorttitle}}}%
    {\printfield{shorthand}}}%
  {\multicitedelim}%
  {\usebibmacro{cite:postnote}}%
\newbibmacro{parenauthor}{%
\ifnameundef{author}
    {%Then Author not in use; try editor, translator
    		\ifnameundef{editor}%
       		{\ifnameundef{translator}%
					{}
    				{\printnames[lastname]{translator}%
    				 \addcomma\space
    				 \usebibmacro{translatorstrg}}%
				}%
       		{\printnames[lastname]{editor}%
    			 \addcomma\space
				\iffieldundef{editortype}
				    {\ifthenelse{\value{editor}>1\OR\ifandothers{editor}}
				       {eds.\isdot}%
				       {ed.\isdot}%
				       }%
				    {\ifthenelse{\value{editor}>1\OR\ifandothers{editor}}
				       {\bibstring{type\thefield{editortype}s}}%
				       {\bibstring{type\thefield{editortype}}}%
				       }%
				}%
	}%
	{%Else check for anonymous, but known, authorship
		\ifthenelse{\equal{\thefield{authortype}}{\authortypeanon}}%
			{%then anonymous author goes in brackets; usual punctuation outside brackets
					\mkbibbrackets{\printnames[lastname]{author}}%
			}%
			{%else check for uncertain authorship
				\ifthenelse{\equal{\thefield{authortype}}{\authortypeunsure}}%
					{%then question mark in brackets; usual punctuation outside brackets
						\mkbibbrackets{\printnames[lastname]{author}\addquestion}%
					}%
					{%else no brackets; check for redundant author
						\ifthenelse {\equal{\thefield{authortype}}{\authortyperedundant}}%
							{\relax}%
							{%else authortype not redundant, just print as usual
								\printnames[lastname]{author}}%
					}%
			}%endif
	\iffieldundef{nameaddon}%
		{\relax}%
		{\setunit*{\addspace}%
		\printfield{nameaddon}\ifpunctmark{.}{\isdot}{\relax}}%
		\setunit*{\labelnamepunct\addspace}%
	}%
}%end of macro

%%%%%%%%%	CITE COMMAND FOR ANNOTATIONS---new in v. 0.2  %%%%%%%%%%%%%
%For printing both abstract and annotation after main citation (new in v. 0.2)
\DeclareCiteCommand{\citeannote}[]
{%
\bibsentence%
\usebibmacro{prenote}%
}%
{\usebibmacro{citeindex}%
\usebibmacro{footcite}%
\setunit{\addperiod}%
\printtext{\unspace}%Just to force unit punctuation before indentannote environment
    \begin{indentannote}
    		\usebibmacro{annotation}%
		\finentry
	\end{indentannote}
}%
{}%
{\iftoggle{cbx:loccit}
	{}
	{\iffieldundef{postnote}
		{}%
		{\addcomma\addspace
     	\printfield{postnote}}%
	}%
}%

%%%%%%%%%%		MODIFIED CITE AND FOOTCITE WITH URL AFTER POSTNOTE		%%%%%%%%%%%%%%%%%%%%%%%%%%

\DeclareCiteCommand{\citeurllast}
	{\usebibmacro{prenote}}
	{\usebibmacro{citeindex}%
	\toggletrue{urllastflag}%
	\iffootnote
		{\usebibmacro{footcite}}%
		{\usebibmacro{cite}}}%
	{\multicitedelim}
	{\relax}% Postnote already printed by onlinelocation macro in bbx


\DeclareCiteCommand{\footciteurllast}[\mkbibfootnote]
	{\usebibmacro{prenote}}%
	{\usebibmacro{citeindex}%
	\toggletrue{urllastflag}%
	\usebibmacro{footcite}}%
	{\multicitedelim}%
	{\relax}% Postnote already printed by onlinelocation macro in bbx	
%%%%%%%%%%	CITE COMMANDS FOR CROSSREFERENCING  %%%%%%%%%%%%%%%%%%%%%%
  
% Cross-referencing to collection in footnotes
%(The corresponding routine for bibliography cross-referencing is in the bbx file)
\DeclareCiteCommand{\cbx@crosstocoll}[]{}{%
\toggletrue{xrefflag}%
\global\togglefalse{cbx:loccit}%
\ifciteseen
	{\iffieldundef{shorthand}%
		{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}%
			{\usebibmacro{footcite:ibid}}%
			{\usebibmacro{footcite:note}}%
		}%
		{\usebibmacro{footcite:shorthand}%
		}%
	}%
	{\printtext{\bibhypertarget{\thefield{entrykey}:\the\value{instcount}}{%
			\usebibmacro{getbookinfo}}%
			\usebibmacro{shorthandintro}}%	
			\usebibmacro{footcite:save}%
	}%
}{}{}%

  
% Cross-referencing to periodical in footnotes
%(The corresponding routine for bibliography cross-referencing is in the bbx file)
\DeclareCiteCommand{\cbx@crosstoper}[]{}{%
\toggletrue{xrefflag}%
\global\togglefalse{cbx:loccit}%
\ifciteseen
	{\iffieldundef{shorthand}%
		{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}%
			{\usebibmacro{footcite:ibid}}%
			{\usebibmacro{footcite:note}}%
		}%
		{\usebibmacro{footcite:shorthand}%
		}%
	}%
	{\printtext{\bibhypertarget{\thefield{entrykey}:\the\value{instcount}}{%
			\usebibmacro{journal+issuetitle}}%
			\usebibmacro{shorthandintro}}%	
			\usebibmacro{footcite:save}%
	}%
}{}{}%
  
% Cross-referencing to customa in footnotes
%(The corresponding routine for bibliography cross-referencing is in the bbx file)
\DeclareCiteCommand{\cbx@crosstoarch}[]{}{%
\toggletrue{xrefflag}%
\global\togglefalse{cbx:loccit}%
\usebibmacro{in:}%
\ifciteseen%
	{\iffieldundef{shorthand}%
		{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}%
			{\usebibmacro{footcite:ibid}}%
			{\usebibmacro{footcite:note}}%
		}%
		{\usebibmacro{footcite:shorthand}%
		}%
	}%
	{\printtext{\bibhypertarget{\thefield{entrykey}:\the\value{instcount}}{%
			\usebibmacro{getarchiveinfo}}%
			\usebibmacro{shorthandintro}}%	
			\usebibmacro{footcite:save}%
	}%
}{}{}%

  
% Cross-referencing to reference in footnotes
%(The corresponding routine for bibliography cross-referencing is in the bbx file)
\DeclareCiteCommand{\cbx@crosstoref}[]{}{%
\toggletrue{xrefflag}%
\global\togglefalse{cbx:loccit}%
\ifciteseen
	{\iffieldundef{shorthand}%
		{\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}%
			{\usebibmacro{footcite:ibid}}%
			{\usebibmacro{footcite:note}}%
		}%
		{\usebibmacro{footcite:shorthand}%
		}%
	}%
	{\printtext{\bibhypertarget{\thefield{entrykey}:\the\value{instcount}}{%
				\usebibmacro{getbooktitle}%
				\newunit\newblock
				\printfield{edition}%
				\newunit\newblock
				\printfield{note}%
				}%
			\usebibmacro{shorthandintro}}%	
			\usebibmacro{footcite:save}%
	}%
}{}{}%

\endinput