-
Notifications
You must be signed in to change notification settings - Fork 4
/
gost.dtx
5915 lines (5639 loc) · 162 KB
/
gost.dtx
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
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% \iffalse meta-comment
% !TEX program = pdfLaTeX
% !Mode:: "DTX:UNIX:UTF-8"
%
% This is the source file for the GOST bundle used with BibTeX.
%
% Current version is 1.3, 2017.02.25.
%
% It contains set of bibliographic style that
% attempt to format the bibliography according to
% GOST R 7.0.5-2008 with some conventional modifications.
%
% For a bibliographic entry in Russian you need
% to add the field
% language = {russian}.
% Ukrainian, German, French, Italian languages are
% also partially supported. Default language is English.
%
% Book entry should have the pagetotal field
% showing total number of pages. Optional field
% url will format URL (using hyperref, if loaded).
%
% See examples in gost*.pdf.
%
% Requires 8-bit bibtex with switch -B and csf file supporting cyrillic.
% bibtex8 -B -c <encoding>.csf <your_document>
%
% Download from
% http://ctan.org/pkg/gost
%
% To unpack run
% tex gost.dtx
%
% To produce the documentation run
% pdflatex gost.dtx
% makeindex -r -s gind.ist gost
% makeindex -r -s gglo.ist -o gost.gls gost.glo
% pdflatex gost.dtx
% pdflatex gost.dtx
%
%<*internal>
\iffalse
%</internal>
%<*readmemd|readme>
-------------------------------------------------------------------
GOST is a bundle of BibTEX styles to format references according to
the State Standards on information, librarianship and publishing
(GOST) issued by The Russian Federation and Interstate Committee
of former USSR States.
Current version is 1.3, 2017.02.25.
Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
E-mail: [email protected]
-------------------------------------------------------------------
%</readmemd|readme>
%<*readmemd>
The System of State Standards includes:
```
GOST 7.80 -2000 Bibliographic record.
Heading. General requirements and rules.
GOST 7.83 -2001 Electronic editions. Basic types and imprint.
GOST 7.1 -2003 Bibliographic record.
Bibliographic description.
General requirements and rules.
GOST 7.11 -2004 Bibliographic description and references.
Rules for the abbreviation of words and word
combinations in foreign European languages.
GOST 7.0.5-2008 Bibliographic reference.
General requirements and rules of making.
```
Etc.
Currently, GOST contains 16 BibTeX styles to format bibliography in English,
Russian and Ukrainian according to GOST 7.0.5-2008 and GOST 7.1-2003. Both
8-bit and Unicode (UTF-8) versions of each BibTeX style, in each case
offering a choice of sorted and unsorted.
All styles in the GOST bundle are derived from single master file
`gost.dtx` by applying different set of options as shown in the table below.
Style | utf8 | strict | eprint | long | sort | natbib
:--------------|:----:|:------:|:------:|:----:|:----:|:------:
gost2003 | | + | + | | |
gost2003s | | + | + | | + |
gost2008 | | | + | | |
gost2008n | | | + | | | +
gost2008l | | | + | + | |
gost2008s | | | + | | + |
gost2008ns | | | + | | + | +
gost2008ls | | | + | + | + |
ugost2003 | + | + | + | | |
ugost2003s | + | + | + | | + |
ugost2008 | + | | + | | |
ugost2008n | + | | + | | | +
ugost2008l | + | | + | + | |
ugost2008s | + | | + | | + |
ugost2008ns | + | | + | | + | +
ugost2008ls | + | | + | + | + |
**Style** |**utf8**|**strict**|**eprint**|**long**|**sort**|**natbib**
`Gost2008` style is recommended for most applications. It corresponds to the
currently effective Standard 7.0.5-2008. Librarians should use the style
`gost2003` instead of `gost2008` to compile a library catalog to meet the
Standard 7.1-2003. Use of other styles is best explained through
the meaning of options used to compile those styles from the master source.
The `strict` option provides conformance to the Standard 7.1-2003. The
bibstyles compiled with that option bear the name `gost2003` with possible
suffixes `s`, `l`, `n` as explained below. These styles are intended
primarily for the librarians who compose a library catalog.
The bibstyles compiled without `strict` option meets the Standard 7.0.5-2008
which can be thought off as a relaxed version of the Standards 7.1-2003. These
bibstyles bear the name `gost2008` with possible suffixes `s`, `l`, `n`.
If the number of authors exceeds 4, modern styles cut the list of authors
to at most 4 persons as prescibed by the Standards. Option
`long` overrides this rule to provide backward compatibility with the
package disser by Stanislab Kruchinin. Two styles, `gost2008l` and
`gost2008ls`, compiled with the option `long` mimic behavior of the styles
`gost705` and `gost705s` from the disser package. Major
effect of the `long` option is that the list of authors always
precedes book or article title no matter how long is it.
Modern styles compiled without `long` place long list of authors behind
the title. The names of styles compiled with the option `long` has the
suffix `l`. Recall that those styles do not conform effective Standards and
their use is discouraged.
The `eprint` option enables formatting electronic publications. In particular,
it enables `eprint`, `eprinttype`, `eprintclass`, and `doi` fields for a
bibliographic entry. The styles generated without the `eprint` option,
ignore the these fields. Starting from the
version 1.2 of the GOST package, all modern styles are compiled with this
option included, and the suffix `e` which designated
this option in earlier versions is not appended to the name of style
any more.
The `natbib` option provides compatibility with the `natbib` package. The names
of styles compiled with the option `natbib` bear the suffix `n`. Currently
4 styles with that option are available for beta testing.
The `sort` option enables sorting bibliographic references by author names
and references titles. The names of styles compiled with the option `sort`
bear the suffix `s`.
Finally, the `utf8` option produces bibliographic styles in unicode rather
that in 8-bit encoding. Names of those styles bear the prefix `u`.
Beyond bibliographic style, GOST bundle contains CS files (codepage and
sorting order).
Encoding | CSF |Sorting order
-----------------|----------------------|-----------------------
cp866 | ruscii.csf |Cyrillic first, Latin
cp1251 | cp1251.csf |Cyrillic first, Latin
koi8-u | koi8u.csf |Cyrillic first, Latin
utf8 | utf8cyrillic.csf |Cyrillic first, Latin
In addition, BibTeX8 distribution comes with few more CSFs.
Encoding | CSF |Sorting order
-----------------|----------------------|-----------------------
cp866 | cp866rus.csf |Latin first, Cyrillic
## How to use
1. Select bibliography style by adding appropriate `\bibliographystyle`
declaration to your source file \file{<filename>.tex}, e.g.
```tex
\bibliographystyle{gost2008}
\bibliography{database}
```
2. Add the field `language="ukrainian"` or `language="russian"` to the
bibliographic entries in Ukrainian or Russian languages in your
database; English is the default language. German, Italian and
French are partially supported.
3. To compile list of references from your database use `bibtex8.exe`
rather than `bibtex.exe`. Depending on the codepage of your
bibliographic database, indicate one of the CS files
listed above as option to `bibtex8.exe`. Run LaTeX, then run
`bibTeX8` and LaTeX again:
```console
latex <filename>.tex
bibtex8 -B -c <csf_file>.csf <filename>.aux
latex <filename>.tex
```
4. For details on preparing bibliographic database see examples in
`gost*.pdf` and `ugost*.pdf`.
5. `ugost*` styles are primarily intended for use
with unicode compilers (`xelatex` and `lualatex`). They
should be preferred as well when using 8bit compilers
(`latex` and `pdflatex`) if source file is in `utf8` encoding.
6. Neither `bibtex.exe` nor `bibtex8.exe` provides
correct sorting order of unicode text. It means that using
`ugost2008s` or `ugost2008ns` may produce unexpected result
for documents in `utf8` encoding.
7. `Bibtex8` fails to change case of a string if it contains Cyrillic
letter in unicode. Therefore `ugost2008*` styles do not change case of
titles and other parts of bibliographic record while 8-bit styles
do the case change where appropriate.
8. Either `bibtex.exe` or `bibtex8.exe` fail to cut Cyrillic names to
initials. Therefore `ugost2008*` styles do not modify name of
authors.
9. Package `natbib` is required when choosing styles with
suffix `n` in their names.
## Customization
Every GOST style defines few commands to format some parts of a
reference. You can redefine these commands prior to
the `\bibliography{<bibtex_style>}` command. Initial
definitions are listed below.
```tex
\providecommand*{\url}[1]{{\small #1}}
\providecommand*{\BibUrl}[1]{\url{#1}}
\providecommand{\BibAnnote}[1]{}
\providecommand*{\BibEmph}[1]{#1}
```
By default, gost styles separate logical parts of a bibliography
record by a period and cyrdash (`. "---`). It is legitimate to drop
that dash by overriding the command `\BibDash` as follows
```tex
\providecommand*{\BibDash}{}
```
By default, `\BibDash` is equivalent to the shorthand `"---`
defined by the babel package with the option `russian`.
It prints a so called Cyrillic dash (`\cyrdash`),
which is 20 % shorter then ordinary LaTeX dash (`---`), and puts
unbreakable space before `\cyrdash` so that dash never appears
in the beginning of a line.
## Where to get
1. [http://ctan.org/pkg/gost](http://ctan.org/pkg/gost).
2. [http://github.com/kia999/gost](http://github.com/kia999/gost)
Run
```tex.exe gost.dtx```
to produce .bst styles.
Run
```pdllatex.exe gost.dtx
makeindex -r -s gind.ist gost
makeindex -r -s gglo.ist -o gost.gls gost.glo
pdflatex gost.dtx
pdflatex gost.dtx
```
to produce .bst styles and documentation.
%</readmemd>
%<*readmemd|readme>
## Version history
### Version 1.3 (2017.02.25)
1. All stuff is now generated from `gost.dtx`.
2. Limited support of the `date` field added.
3. Formatting of `doi` field updated: `http://dx.doi.org` changed
to `https://doi.org`.
4. Restricted support of `date` field added.
5. Documentation and examples update (thanks to Leonid Sinev).
%</readmemd|readme>
%<*readmemd>
### Version 1.2i (2017.01.12)
1. Documentation and examples update (thanks to Leonid Sinev).
2. Restored `@MastersThesis` instead of `@MasterThesis` (thanks to Leonid Sinev).
3. `media="eresource"` is introduced in addition to `media="online"` and
`media="text"`; if present, the `media` field is not ignored any more in
modern bst-styles compiled without the `strict` option.
4. `location` field is introduced as an alias of `address` field.
5. `@DSCISTHESIS` entry renamed to `@DOCTHESIS`.
6. `school` field in `@THESIS` and similar entries is replaced by
`institution` to comply with `biblatex-gost` style.
### Older versions
See `gost.pdf`.
---------------------------------------------------------
Please, send feature requests and bug reports via e-mail:
`[email protected]` <Igor Kotelnikov>,
`[email protected]` <Maksym Polyakov>,
or submit an issue on
[https://github.com/kia999/GOST/issues](https://github.com/kia999/GOST/issues).
Happy BibTeXing!
%</readmemd>
%<*internal>
\fi
\def\nameofplainTeX{plain}
\ifx\fmtname\nameofplainTeX\else
\expandafter\begingroup
\fi
\input docstrip.tex
\keepsilent
\askforoverwritefalse
\preamble
-------------------------------------------------------------------
This file is a part of GOST package, which is a bundle of BibTEX
styles to format bibliographic references according to the State
Standards on information, librarianship and publishing (GOST)
issued by The Russian Federation and Interstate Committee of former
USSR States.
Current version is 1.3, 2017.02.25.
Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
E-mail: [email protected]
-------------------------------------------------------------------
\endpreamble
\postamble
-------------------------------------------------------------------
Copyright 2012-2017 Igor A. Kotelnikov.
Copyright 2017 Leonid Sinev.
Version 1.3*
Copyright 1996-2005 Maksym Polyakov.
Version 2005.08.12
Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
This work is "maintained" (as per LPPL maintenance status) by
Igor A. Kotelnikov.
Current version is 1.3, 2017.02.25.
Please, send bug report via e-mail: [email protected] <Igor Kotelnikov>
-------------------------------------------------------------------
This work consists of the file gost.dtx
and the derived files gost.ins,
gost.pdf,
gost*.bst (8 files),
ugost*.bst (8 files),
README.md.
It also contains a lot of examples (*.tex, *.pdf, *.bib files).
-------------------------------------------------------------------
\endpostamble
%</internal>
%<*install>
\usedir{source/bibtex/gost}
\askonceonly
\ProvidesFile{gost.ins}[2017/02/25 1.3 Russian support for the Babel system]
\generate{%
%%
%% BST styles that mimics GOST 7.1-2003 for bibliographic *catalogs*.
\file{gost2003.bst} {\from{gost.dtx} {bst,strict,eprint}}
%%
%% BST styles that mimics GOST 7.0.5-2008 for bibliographic *references*
\file{gost2008.bst} {\from{gost.dtx} {bst,eprint}}
\file{gost2008l.bst} {\from{gost.dtx} {bst,eprint,long}}
%%
%% Same styles with sorting
\file{gost2003s.bst} {\from{gost.dtx} {bst,strict,eprint,sort}}
%%
\file{gost2008s.bst} {\from{gost.dtx} {bst,eprint,sort}}
\file{gost2008ls.bst} {\from{gost.dtx} {bst,eprint,long,sort}}
%% `
%% --------------------------------------------------------------------------
%% Unicode BST styles that mimics GOST 7.1-2003 for bibliographic *catalogs*.
\file{ugost2003.bst} {\from{gost.dtx} {bst,utf8,strict,eprint}}
%%
%% Unicode BST styles that mimics GOST 7.0.5-2008 for bibliographic *references*
\file{ugost2008.bst} {\from{gost.dtx} {bst,utf8,eprint}}
\file{ugost2008l.bst} {\from{gost.dtx} {bst,utf8,eprint,long}}
%%
%% Same styles with sorting
\file{ugost2003s.bst} {\from{gost.dtx} {bst,utf8,strict,eprint,sort}}
%%
\file{ugost2008s.bst} {\from{gost.dtx} {bst,utf8,eprint,sort}}
\file{ugost2008ls.bst} {\from{gost.dtx} {bst,utf8,eprint,long,sort}}
%%
%% --------------------------------------------------------------------------
%% Experimental styles compatible with natbib package.
%%
\file{gost2008n.bst} {\from{gost.dtx} {bst,natbib,eprint}}
\file{gost2008ns.bst} {\from{gost.dtx} {bst,natbib,eprint,sort}}
%%
\file{ugost2008n.bst} {\from{gost.dtx} {bst,utf8,natbib,eprint}}
\file{ugost2008ns.bst} {\from{gost.dtx} {bst,utf8,natbib,eprint,sort}}
}
%</install>
%<install>\endbatchfile
%<*internal>
\usedir{source/bibtex/gost}
\generate{
\file{\jobname.ins}{\from{\jobname.dtx}{install}}
}
\nopreamble\nopostamble
\usedir{source/doc/gost}
\generate{
\file{README.}{\from{\jobname.dtx}{readme}}
\file{README.md}{\from{\jobname.dtx}{readmemd}}
}
\ifx\fmtname\nameofplainTeX
\expandafter\endbatchfile
\else
\expandafter\endgroup
\fi
%</internal>
%<*driver>
\ProvidesFile{gost.dtx}[2017/02/23 v.1.3 BibTEX support for GOST bibliographies]
\NeedsTeXFormat{LaTeX2e}
\documentclass{ltxdoc}
\usepackage{geometry}
\usepackage{ifluatex,ifxetex}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi>0
\usepackage{fontspec}
\defaultfontfeatures{Ligatures={TeX},Renderer=Basic}
\setmainfont{CMU Serif}
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}
\else
\usepackage[utf8]{inputenc} % UTF-8: PDFLaTeX
\usepackage[T2A]{fontenc}
\usepackage{cmap}
\fi
\usepackage[russian,english]{babel}
\usepackage{makeidx}\makeindex
%\usepackage{xcolor}
%\definecolor{darkblue}{rgb}{0,0,.6}
\usepackage[
unicode
,pdfusetitle
,colorlinks = true
%,linkcolor = darkblue
%,citecolor = darkblue, filecolor = darkblue
%,menucolor = darkblue, urlcolor = darkblue
,bookmarksnumbered = true,
,pdfdisplaydoctitle = true% display document title instead of file
,pdfpagemode = UseOutlines% (show bookmarks)
]{hyperref}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\def\file#1{\texttt{#1}}
\def\pkg#1{\textsf{#1}}
\def\cmd#1{\texttt{#1}}
\newcommand{\note}[2][N$\!\!$B: ]{\textcolor{red}{\ensuremath{\langle}#1#2\ensuremath{\rangle}}}
%
\newcommand\DescribeEntry[1]{%
\DescribeMacro{#1}\index{Entry!\texttt{#1}}%
}
\newcommand\DescribeFunction[1]{%
\DescribeMacro{#1}\index{\texttt{#1}}%
}
\newcommand\DescribeField[1]{%
\DescribeMacro{#1}\index{Field!\texttt{#1}}%
}
%
%\OnlyDescription % uncomment to hide the Implementation section
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
%</driver>
% \fi
%
% \DoNotIndex{\cyra,\cyrb,\cyrv,\cyrg,\cyrd,\cyre}
% \DoNotIndex{\CYRP,\cyrii,\cyrr,\cyre,\cyro,\CYRU,\cyrk,\cyrl,\CYRS,\cyrs|}
% \DoNotIndex{\cyrt,\cyri,\cyrz,\CYRT,\cyrm}
% \DoNotIndex{\cyr,\cyrc,\CYRD,\cyrery,\cyrh,\CYRK,\CYRM,\CYRN,\cyrn}
% \DoNotIndex{\cyrp,\cyrs,\cyrshch,\cyru,\CYRV,\cyrya}
% \DoNotIndex{\CYRA,\CYRB,\cyrch,\CYRE,\CYREREV,\CYRF,\cyrf,\CYRI,\cyrishrt}
% \DoNotIndex{\CYRO,\CYRR,\cyrsftsn,\CYRYA,\cyryu,\cyrzh}
% \DoNotIndex{\CYRCH, \CYRG, \CYRL, \CYRZH}
% \DoNotIndex{\z@skip,\z@}
% \DoNotIndex{\|,\~,\ ,\,}
%
% \begingroup
% \makeatletter
% \lccode`9=32\relax
% \lowercase{%^^A
% \edef\x{\noexpand\DoNotIndex{\@backslashchar9}}%^^A
% }%^^A
% \expandafter\endgroup\x
% \expandafter\DoNotIndex\expandafter{\string\&}
%
% \DoNotIndex{\',\(,\),\`,\\,\/,\.}
% \DoNotIndex{\begin,\DeclareUTFcharacter}
% \DoNotIndex{\csname,\def}
% \DoNotIndex{\else,\endcsname,\end}
% \DoNotIndex{\expandafter,\fi}
% \DoNotIndex{\hbox,\hss}
% \DoNotIndex{\iffalse,\ifx,\ignorespaces,\iflanguage}
% \DoNotIndex{\language,\lastskip,\ldots,\let,\natexlab,\newblock,\nobreak}
% \DoNotIndex{\providecommand,\ProvideTextCommandDefault,\relax,\renewcommand}
% \DoNotIndex{\selectlanguage,\selectlanguageifdefined,\small,\textemdash}
% \DoNotIndex{\textnumero,\unskip,\url,\UTFencname}
% \DoNotIndex{\catcode,\cite,\citeauthor,\citet,\citeyear,\href,\hskip,\ifdim}
%
%\GetFileInfo{\jobname.ins}
%
%\title{The GOST package}
%\author{
% Igor Kotelnikov\thanks{E-mail: [email protected]},
% Leonid Sinev
%}
%\date{Version \fileversion\ released \filedate}
%\maketitle
%
% \begin{abstract}
%
% GOST is a bundle of BibTeX styles designed to meet State Standards (GOST)
% on information, librarianship and publishing issued by The Russian Federation
% and Interstate Committee of former USSR States.
%
% It comprises 16 BibTeX styles to format bibliography in English, Russian
% and Ukrainian according to GOST 7.0.5-2008 and GOST 7.1-2003. Both 8-bit
% and Unicode (UTF-8) versions of each BibTeX style, in each case offering
% a choice of sorted and unsorted.
%
% \end{abstract}
%
% \section{Introduction}\label{s1}
%
% The package was initially developed by Maksym Polyakov. It was later
% updated by Igor Kotelnikov to the present status and some code was borrowed
% from \pkg{disser} package developed by Stanislav Kruchinin and unpublished
% work by Artem Petrenkov.
%
% Nowdays, GOST is a bundle of BibTeX styles designed to meet State Standards
% (GOST) on information, librarianship and publishing issued by
% Russian Federation and interstate committee of former USSR States.
%
% The System of Standards includes:
% \begin{description}
% \item[GOST 7.80 -2000]
% Bibliographic record.
% Heading. General requirements and rules.
% \item[GOST 7.83 -2001]
% Electronic editions. Basic types and imprint.
% \item[GOST 7.1 -2003]
% Bibliographic record.
% Bibliographic description.
% General requirements and rules.
% \item[GOST 7.11 -2004]
% Bibliographic description and references.
% Rules for the abbreviation of words and word combinations
% in foreign European languages.
% \item[GOST 7.0.5-2008]
% Bibliographic reference.
% General requirements and rules of making.
% \end{description}
% Etc.
%
% Currently, GOST contains 16 BibTeX styles to format bibliography in English,
% Russian and Ukrainian according to GOST 7.0.5-2008 and GOST 7.1-2003. Both
% 8-bit and Unicode (UTF-8) versions of each BibTeX style, in each case
% offering a choice of sorted and unsorted.
%
% All styles in the GOST bundle are derived from single master file
% \file{gost.dtx} by applying different set of options as shown in the table
% below.
%
% \begin{verbatim}
%---------------------------------------------------------------
% Style | utf8 | strict | eprint | long | sort | natbib
%---------------------------------------------------------------
% gost2003 | | + | + | | |
% gost2003s | | + | + | | + |
% gost2008 | | | + | | |
% gost2008n | | | + | | | +
% gost2008l | | | + | + | |
% gost2008s | | | + | | + |
% gost2008ns | | | + | | + | +
% gost2008ls | | | + | + | + |
%---------------------------------------------------------------
% ugost2003 | + | + | + | | |
% ugost2003s | + | + | + | | + |
% ugost2008 | + | | + | | |
% ugost2008n | + | | + | | | +
% ugost2008l | + | | + | + | |
% ugost2008s | + | | + | | + |
% ugost2008ns | + | | + | | + | +
% ugost2008ls | + | | + | + | + |
%---------------------------------------------------------------
% Style | utf8 | strict | eprint | long | sort | natbib
%---------------------------------------------------------------
% \end{verbatim}
%
% |Gost2008| style is recommended for most applications. It corresponds to the
% currently effective Standard 7.0.5-2008. Librarians should use the style
% |gost2003| instead of |gost2008| to compile a library catalog to meet the
% Standard 7.1-2003. Use of other styles is best explained through
% the meaning of options used to compile those styles from the master source.
%
% The |strict| option provides conformance to the Standard 7.1-2003. The
% bibstyles compiled with that option bear the name |gost2003| with possible
% suffixes |s|, |l|, |n| as explained below. These styles are intended
% primarily for the librarians who compose a library catalog.
%
% The bibstyles compiled without |strict| option meets the Standard 7.0.5-2008
% which can be thought off as a relaxed version of the Standards 7.1-2003. These
% bibstyles bear the name |gost2008| with possible suffixes |s|, |l|, |n|.
%
% If the number of authors exceeds 4, modern styles cut the list of authors
% to at most 4 persons as prescibed by the Standards. Option
% |long| overrides this rule to provide backward compatibility with the
% package disser by Stanislab Kruchinin. Two styles, |gost2008l| and
% |gost2008ls|, compiled with the option |long| mimic behavior of the styles
% |gost705| and |gost705s| from the disser package. Major
% effect of the |long| option is that the list of authors always
% precedes book or article title no matter how long is it.
% Modern styles compiled without |long| place long list of authors behind
% the title. The names of styles compiled with the option |long| has the
% suffix |l|. Recall that those styles do not conform effective Standards and
% their use is discouraged.
%
% The |eprint| option enables formatting electronic publications. In particular,
% it enables |eprint|, |eprinttype|, |eprintclass|, and |doi| fields for a
% bibliographic entry. The styles generated without the |eprint| option,
% ignore the these fields. Starting from the
% version 1.2 of the GOST package, all modern styles are compiled with this
% option included, and the suffix |e| which designated
% this option in earlier versions is not appended to the name of style
% any more.
%
% The |natbib| option provides compatibility with the |natbib| package. The names
% of styles compiled with the option |natbib| bear the suffix |n|. Currently
% 4 styles with that option are available for beta testing.
%
% The |sort| option enables sorting bibliographic references by author names
% and references titles. The names of styles compiled with the option |sort|
% bear the suffix |s|.
%
% Finally, the |utf8| option produces bibliographic styles in unicode rather
% that in 8-bit encoding. Names of those styles bear the prefix |u|.
%
%
% Beyond bibliographic style, GOST bundle contains CS files (codepage and
% sorting order).
% \begin{verbatim}
% ----------------------------------------------------------------
% Encoding | CSF | Sorting order
% ----------------------------------------------------------------
% cp866 | ruscii.csf | Cyrillic first, Latin
% cp1251 | cp1251.csf | Cyrillic first, Latin
% koi8-u | koi8u.csf | Cyrillic first, Latin
% utf8 | utf8cyrillic.csf | Cyrillic first, Latin
% ----------------------------------------------------------------
% \end{verbatim}
%
% In addition, \BibTeX8 distribution comes with few more CSFs.
% \begin{verbatim}
% ---------------------------------------------------------------
% Encoding | CSF | Sorting order
% ---------------------------------------------------------------
% cp866 | cp866rus.csf | Latin first, Cyrillic
% ---------------------------------------------------------------
% \end{verbatim}
%
% \section{How to use}\label{s2}
%
% \begin{enumerate}
% \item
% Select bibliography style by adding appropriate |\bibliographystyle|
% declaration to your source file \file{<filename>.tex}, e.g.
% \begin{verbatim}
% \bibliographystyle{gost2008}
% \bibliography{database}
% \end{verbatim}
%
% \item
% Add the field |langid="ukrainian"| or |langid="russian"| to the
% bibliographic entries in Ukrainian or Russian languages in your
% database; English is the default language. German, Italian and
% French are partially supported.
%
% \item
% To compile list of references from your database use \file{bibtex8.exe}
% rather than \file{bibtex.exe}. Depending on the codepage of your
% bibliographic database, indicate one of the CS files
% listed above as option to \file{bibtex8.exe}. Run LaTeX, then run
% \file{bibTeX8} and LaTeX again:
% \begin{verbatim}
% latex <filename>.tex
% bibtex8 -B -c <csf_file>.csf <filename>.aux
% latex <filename>.tex
% \end{verbatim}
%
% \item
% For details on preparing bibliographic database see examples in
% \file{gost*.pdf} and \file{ugost*.pdf}.
%
% \item
% \file{ugost*} styles are primarily intended for use
% with unicode compilers (\file{xelatex} and \file{lualatex}). They
% should be preferred as well when using 8bit compilers
% (\file{latex} and \file{pdflatex}) if source file is in utf8 encoding.
%
% \item
% Neither \file{bibtex.exe} nor \file{bibtex8.exe} provides
% correct sorting order of unicode text. It means that using
% \file{ugost2008s} or \file{ugost2008ns} may produce unexpected result
% for documents in \texttt{utf8} encoding.
%
% \item
% \file{Bibtex8} fails to change case of a string if it contains Cyrillic
% letter in unicode. Therefore \file{ugost2008*} styles do not change case of
% titles and other parts of bibliographic record while 8-bit styles
% do the case change where appropriate.
%
% \item
% Either \file{bibtex.exe} or \file{bibtex8.exe} fail to cut Cyrillic names to
% initials. Therefore \file{ugost2008*} styles do not modify name of
% authors.
%
% \item
% Package |natbib| is required when choosing styles with
% suffix |n| in their names.
%
% \end{enumerate}
%
%
% \section{Customization}\label{s3}
%
% Every GOST style defines few commands to format some parts of a
% reference. You can redefine these commands prior to
% the |\bibliography{<bibtex_style>}| command. Initial
% definitions are listed below.
% \begin{verbatim}
% \providecommand*{\url}[1]{{\small #1}}
% \providecommand*{\BibUrl}[1]{\url{#1}}
% \providecommand{\BibAnnote}[1]{}
% \providecommand*{\BibEmph}[1]{#1}
% \end{verbatim}
%
% By default, gost styles separate logical parts of a bibliography
% record by a period and cyrdash (|. "---|). It is legitimate to drop
% that dash by overriding the command |\BibDash| as follows
%
% \begin{verbatim}
% \providecommand*{\BibDash}{}
% \end{verbatim}
%
% By default, |\BibDash| is equivalent to the shorthand |"---|
% defined by the babel package with the option |russian|.
% It prints a so called Cyrillic dash (|\cyrdash|),
% which is 20\% shorter then ordinary LaTeX dash (|---|), and puts
% unbreakable space before |\cyrdash| so that dash never appears
% in the beginning of a line.
%
% \section{Where to get}\label{s4}
%
% \begin{enumerate}
% \item
% \href{http://ctan.org/pkg/gost}{http://ctan.org/pkg/gost}.
% \item
% \href{http://github.com/kia999/gost}{http://github.com/kia999/gost}.
% \end{enumerate}
%
%
% \section{Version history}\label{s5}
%
% \subsection*{Version 1.3 (2017.02.25)}
%
% \begin{enumerate}
% \item
% All stuff is now generated from |gost.dtx|.
%
% \item
% Limited support of the |date| field added.
%
% \item
% Formatting of |doi| field updated: |http://dx.doi.org| changed
% to |https://doi.org|.
%
% \item
% Restricted support of |date| field added.
%
% \item
% Documentation and examples update (thanks to Leonid Sinev).
%
% \end{enumerate}
%
%
% \subsection*{Version 1.2i (2017.01.12)}
%
% \begin{enumerate}
% \item
% Documentation and examples update (thanks to Leonid Sinev).
%
% \item
% Restored |@MastersThesis| instead of |@MasterThesis| (thanks to Leonid Sinev).
%
% \item
% |media="eresource"| is introduced in addition to |media="online"| and
% |media="text"|; if present, the |media| field is not ignored any more in
% modern bst-styles compiled without the |strict| option.
%
% \item
% |location| field is introduced as an alias of |address| field.
%
% \item
% |@DSCISTHESIS| entry renamed to |@DOCTHESIS|.
%
% \item
% |school| field in |@THESIS| and similar entries is replaced by
% |institution| to comply with |biblatex-gost| style.
%
% \end{enumerate}
%
%
% \subsection*{Version 1.2h (2016.08.21)}
%
% \begin{enumerate}
% \item
% Minor changes in documentation.
%
% \end{enumerate}
%
%
% \subsection*{Version 1.2g (2016.07.25)}
%
% \begin{enumerate}
% \item
% Minor changes in documentation.
%
% \end{enumerate}
%
%
% \subsection*{Version 1.2f (2016.07.12)}
%
% \begin{enumerate}
% \item
% Support for patent entry added (thanks to Stanislav Kruchinin).
%
% \item
% |medium| field renamed to |media| field for compatibility with biblatex.
%
% \end{enumerate}
%
% \subsection*{Version 1.2e (2016.07.07)}
%
% \begin{enumerate}
% \item
% Hard coded "URL" string replaced with a language sensitive string
% (thanks to Roman Budnyi).
%
% \end{enumerate}
%
% \subsection*{Version 1.2d (2015.02.18)}
%
% \begin{enumerate}
% \item
% jan, feb, etc. macros fixed.
%
% \item
% New macro |format.month|.
% \end{enumerate}
%
% \subsection*{Version 1.2c (2015.01.10)}
%
% \begin{enumerate}
% \item
% |langid| field is added. It has same meaning as |language| which is now
% obsolete but is still supported for backward compatibility; |langid| has
% priority over |language|.
%
% \item
% |eid| field is added. It has priority over |pages|.
%
% \item
% The ligature |"---| has been substituted with |\BibDash| for \texttt{.bst}
% styles compiled without |modern| options (\texttt{gost2003.bst} and
% \texttt{gost2003s.bst}). For modern styles this was done in earlier versions.
%
% \item
% Spacing around |\BibDash| has been improved.
%
% \item
% |\BibDash| now typesets short em-dash (|\cyrdash|) only for |russian| and
% |ukrainian| languages. In earlier versions, it produces short em-dash for
% all languages.
%
% (This feature was removed since it did not work with all engines.)
%
% \end{enumerate}
%
% \subsection*{Version 1.2a (2012.08.31)}
%
% \begin{enumerate}
%
% \item
% |\cyrdash| is now defined via |\ProvideTextCommand| rather than
% |\providecommand|.
%
% \end{enumerate}
%
% \subsection*{Version 1.2 (2012.02.22)}
%
% \begin{enumerate}
% \item
% Code refactoring. All styles are now generated from single source file.
%
% \item
% Support for GOST 7.1-2003. The field |medium| is added to reflect type
% of material. For most entry types |medium| defaults to |text|.
%
% \item
% Support for |natbib| package.
%
% \item
% All modern styles are now compiled with the |eprint| option.
%
% \end{enumerate}
%
%
% \subsection*{Version 1.1 (2012.01.21)}
%
% \begin{enumerate}
% \item
% Support for GOST 7.0.5-2008 and GOST 7.1-2003 is provided.
%
% \item
% |@Online| entry is added to format a reference to electronic
% resource on Internet.
%
% \item
% |@MastersThesis| entry is added to format a reference to master's thesis.
%
% \item
% |@DSciThesis| entry is added to format a reference to doctor of
% sciences thesis.
%
% \item
% |Urldate|, |eprint|, |eprintclass|, |eprinttype| fields are added.
%
% \end{enumerate}
%
% \subsection{Older versions}
%
% \begin{enumerate}
% \item[2012.02.22] Support for |natbib| package.
% \item[2012.02.02] Adaptation to GOST 7.0.5, electronic publishing.
% \item[2005.08.12] First version uploaded to CTAN.
% \item[2003.06.06] First public version.
% \end{enumerate}
%
% \StopEventually{
% \IndexPrologue{\section{Index}
% Numbers written in dark blue refer to the page where the corresponding
% entry is described; numbers in black roman refer to the code lines where
% the entry is used.
% }
% \GlossaryPrologue{\section{Change History}}
% \PrintChanges
% \PrintIndex
% }
%
% \section{Implementation}\label{s6}
%
% We need Russian fonts to produce documentation of the code below.
% Therefore we switch current language to Russian by issuing the command
% |\selectlanguage{russian}|.
%
% \selectlanguage{russian}
%
% \begin{macrocode}
%<*bst>
% \end{macrocode}
%
% \begin{macrocode}
%% This bibstyle attempts to format bibliography according to
%<strict>%% GOST 7.1-2003 for bibliographic records.
%<!strict>%% GOST 7.0.5-2008 for bibliographic reference.
%<*natbib>%%
%%-------------------------------------------------------------------
%% This is an author-year citation style bibliography.
%% It requires a special package file to function properly