% \iffalse meta-comment %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% %% This bibliography style attempts %% to format bibliography according to %% GOST 7.1-84 with some conventional modifications. %% %% Based on style gost71u.bst by Maksym Polyakov. %% %% For the Russian bibliographic entries %% you need to create field %% language = {russian}. %% Default language is English. %% Field numpages for books must contain number of pages. %% Optional field url will format url (using hyperref, if loaded). %% %% Requires 8-bit bibtex with switch -B and csf file %% supporting cyrillic. %% %% bibtex8 -B -c .csf %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %<*driver> \ProvidesFile{gost705.drv}[2009/11/20 1.1.4 Bibliography style for dissertations.] \documentclass{ltxdoc} \usepackage[a4paper,includeheadfoot,nohead,mag=1000, left=5cm,right=1cm,top=1.5cm,bottom=1.5cm]{geometry} \usepackage{ifpdf,indentfirst,color,makeidx} \definecolor{darkblue}{rgb}{0,0,.6} \ifpdf \usepackage[% pdftex, colorlinks, plainpages=false, pdftitle = {Documented source code of the disser package}, pdfauthor = {Stanislav Kruchinin}, pdfsubject = {disser}, pdfstartview = {FitH}, pdfborder = {0 0 0}, bookmarksopen, bookmarksnumbered, bookmarksopenlevel = 2, pdfusetitle, unicode]{hyperref} \usepackage{cmap} \else \usepackage[hypertex]{hyperref} \fi \hypersetup{ colorlinks = true, linkcolor = darkblue, citecolor = darkblue, filecolor = darkblue, menucolor = darkblue, urlcolor = darkblue } \IfFileExists{pscyr.sty}{% \usepackage{pscyr} \renewcommand\ttdefault{cmtt} \renewcommand\rmdefault{ftm} }{ \IfFileExists{cyrtimes.sty}{% \renewcommand\ttdefault{cmtt} \renewcommand\rmdefault{ftm} }{} } \IfFileExists{url.sty}{\RequirePackage{url}}{\newcommand\url{\texttt}} \usepackage[T2A]{fontenc} \usepackage[cp1251]{inputenc} \usepackage[english,russian]{babel} \MakeShortVerb{\|} \def\file#1{\texttt{#1}} \def\pkg#1{\textsf{#1}} \def\cmd#1{\texttt{#1}} \newcommand\DescribeBSTFunction[1]{ \DescribeMacro{#1}\index{Функции!\texttt{#1}} } \newcommand\DescribeBSTMacro[1]{ \DescribeMacro{#1}\index{Макросы!\texttt{#1}} } \makeatletter \def\IndexParms{% \parindent \z@ \columnsep 15pt \parskip 0pt plus 1pt \rightskip 15pt \mathsurround \z@ \parfillskip=-15pt \small \def\@idxitem{\normalfont\par\hangindent 30pt\bfseries}% \def\subitem{\normalfont\par\hangindent 30pt}% \def\subsubitem{\normalfont\par\hangindent 30pt\hspace*{15pt}}% \def\indexspace{\par\vspace{10pt plus 2pt minus 3pt}}% } \def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi \columnseprule \z@ \columnsep 35\p@ \twocolumn[\index@prologue]% \IndexParms \let\item\@idxitem \ignorespaces} \def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi} \makeatother \setlength\hfuzz{20pt} \hbadness=10000 \makeindex \begin{document} \sloppy \PrintChanges \DocInput{gost705.dtx} \IndexPrologue{\section{Предметный указатель}} \printindex \end{document} % % \fi % \GetFileInfo{gost705.drv} % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % \title{\pkg{gost705} и \pkg{gost705s} "--- стили оформления библиографии % в соответствии с ГОСТ Р 7.0.5-2008} % \date{Версия \fileversion\\[6pt]\filedate} % \author{Станислав Кручинин\\[6pt] % \normalsize E-mail: % \href{mailto:stanislav.kruchinin@gmail.com} % {\texttt{stanislav.kruchinin@gmail.com}}} % % \maketitle % % \tableofcontents % % \section{Исходный текст}\parindent=0pt % \begin{macrocode} %<*gost705|gost705s> % \end{macrocode} % \subsection{Поля, используемые в bib-файлах} % \begin{macrocode} ENTRY { address annote author booktitle bookauthor chapter edition editor compiler howpublished institution journal key month note number organization pages numpages publisher school series title type volume year language booklanguage url urldate } {} { label } % \end{macrocode} % \subsection{Объявление и инициализация переменных и констант} % \begin{macrocode} INTEGERS { output.state before.all mid.sentence after.sentence after.block after.dblslash after.slash after.column after.semicolumn } % \end{macrocode} % \DescribeBSTFunction{init.state.consts} % \begin{macrocode} FUNCTION {init.state.consts} { #0 'before.all := #1 'mid.sentence := #2 'after.sentence := #3 'after.block := #4 'after.dblslash := #5 'after.slash := #6 'after.column := #7 'after.semicolumn := } STRINGS { s t } STRINGS { curlanguage } % \end{macrocode} % \subsection{Переключение языка} % \DescribeBSTFunction{change.language} % \begin{macrocode} FUNCTION {change.language} { booklanguage empty$ { "" } { booklanguage 'curlanguage := "\selectlanguageifdefined{" curlanguage * "}" * } if$ } % \end{macrocode} % \subsection{Вывод библиографической записи} % \DescribeBSTFunction{output.nonnull} % \begin{macrocode} FUNCTION {output.nonnull} { swap$ output.state mid.sentence = { ", " * write$ } { output.state after.block = { add.period$ " " * write$ newline$ "\newblock " write$ } { output.state before.all = 'write$ { output.state after.dblslash = { "~//" * change.language * " " * write$ } { output.state after.slash = { "~/ " * write$ } { output.state after.column = { ": " * write$ } { output.state after.semicolumn = { "; " * write$ } { add.period$ " " * write$ } if$ } if$ } if$ } if$ } if$ } if$ mid.sentence 'output.state := } if$ } % \end{macrocode} % \DescribeBSTFunction{output} % \begin{macrocode} FUNCTION {output} { duplicate$ empty$ 'pop$ 'output.nonnull if$ } % \end{macrocode} % \DescribeBSTFunction{output.check} % \begin{macrocode} FUNCTION {output.check} { 't := duplicate$ empty$ { pop$ "empty " t * " in " * cite$ * warning$ } 'output.nonnull if$ } % \end{macrocode} % \subsection{Вывод блоков и ограничителей} % \DescribeBSTFunction{fin.entry} % \begin{macrocode} FUNCTION {fin.entry} { add.period$ write$ newline$ } % \end{macrocode} % \DescribeBSTFunction{new.block} % \begin{macrocode} FUNCTION {new.block} { output.state before.all = 'skip$ { after.block 'output.state := } if$ } % \end{macrocode} % \DescribeBSTFunction{new.dblslash} % \begin{macrocode} FUNCTION {new.dblslash} { output.state before.all = 'skip$ { after.dblslash 'output.state := } if$ } % \end{macrocode} % \DescribeBSTFunction{new.slash} % \begin{macrocode} FUNCTION {new.slash} { output.state before.all = 'skip$ { after.slash 'output.state := } if$ } % \end{macrocode} % \DescribeBSTFunction{new.column} % \begin{macrocode} FUNCTION {new.column} { output.state before.all = 'skip$ { after.column 'output.state := } if$ } % \end{macrocode} % \DescribeBSTFunction{new.semicolumn} % \begin{macrocode} FUNCTION {new.semicolumn} { output.state before.all = 'skip$ { after.semicolumn 'output.state := } if$ } % \end{macrocode} % \DescribeBSTFunction{new.sentence} % \begin{macrocode} FUNCTION {new.sentence} { output.state after.block = 'skip$ { output.state before.all = 'skip$ { after.sentence 'output.state := } if$ } if$ } % \end{macrocode} % \DescribeBSTFunction{add.blank} % \begin{macrocode} FUNCTION {add.blank} { " " * before.all 'output.state := } % \end{macrocode} % \DescribeBSTFunction{not} % \begin{macrocode} FUNCTION {not} { { #0 } { #1 } if$ } % \end{macrocode} % \DescribeBSTFunction{and} % \begin{macrocode} FUNCTION {and} { 'skip$ { pop$ #0 } if$ } % \end{macrocode} % \DescribeBSTFunction{or} % \begin{macrocode} FUNCTION {or} { { pop$ #1 } 'skip$ if$ } % \end{macrocode} % \DescribeBSTFunction{non.stop} % \begin{macrocode} FUNCTION {non.stop} { duplicate$ "}" * add.period$ #-1 #1 substring$ "." = } % \end{macrocode} % \DescribeBSTFunction{new.block.checka} % \begin{macrocode} FUNCTION {new.block.checka} { empty$ 'skip$ 'new.block if$ } % \end{macrocode} % \DescribeBSTFunction{new.block.checkb} % \begin{macrocode} FUNCTION {new.block.checkb} { empty$ swap$ empty$ and 'skip$ 'new.block if$ } % \end{macrocode} % \DescribeBSTFunction{new.sentence.checka} % \begin{macrocode} FUNCTION {new.sentence.checka} { empty$ 'skip$ 'new.sentence if$ } % \end{macrocode} % \DescribeBSTFunction{new.sentence.checkb} % \begin{macrocode} FUNCTION {new.sentence.checkb} { empty$ swap$ empty$ and 'skip$ 'new.sentence if$ } % \end{macrocode} % \DescribeBSTFunction{field.or.null} % \begin{macrocode} FUNCTION {field.or.null} { duplicate$ empty$ { pop$ "" } 'skip$ if$ } % \end{macrocode} % \DescribeBSTFunction{emphasize} % \begin{macrocode} FUNCTION {emphasize} { duplicate$ empty$ { pop$ "" } { "\BibEmph{" swap$ * "}" * } if$ } % \end{macrocode} % \DescribeBSTFunction{space.word} % \begin{macrocode} FUNCTION {space.word} { " " swap$ * " " * } % \end{macrocode} % \subsection{Общепринятые сокращения} % \begin{macrocode} FUNCTION {bbl.edby} % { "\bbledby{}" } { curlanguage "english" = { "Ed. by " } { curlanguage "russian" = { "{\cyr\CYRP\cyro\cyrd\ \cyrr\cyre\cyrd.\ }" } { "language is not defined: " language "edited by" * * warning$ "edited by" } if$ } if$ } FUNCTION {bbl.cmplr} { curlanguage "english" = { "Compiler " } { curlanguage "russian" = { "{\cyr\CYRS\cyro\cyrs\cyrt.\ }" } { "language is not defined: " language "compiler" * * warning$ "compiler" } if$ } if$ } FUNCTION {bbl.edition} % { "\bbledition{}" } { curlanguage "english" = { "edition" } { curlanguage "russian" = { "{\cyr\cyri\cyrz\cyrd.}" } { "language is not defined: " language "edition" * * warning$ "edition" } if$ } if$ } FUNCTION {bbl.vvolume} % { "\bblVolume{}" } { curlanguage "english" = { "Volume" } { curlanguage "russian" = { "{\cyr\CYRT\cyro\cyrm}" } { "language is not defined: " language "Volume" * * warning$ "Volume" } if$ } if$ } FUNCTION {bbl.vvol} % { "\bblVol{}" } { curlanguage "english" = { "Vol." } { curlanguage "russian" = { "{\cyr\CYRT.}" } { "language is not defined: " language "Vol." * * warning$ "Vol." } if$ } if$ } FUNCTION {bbl.iissue} % { "\bblIssue{}" } { curlanguage "english" = { "Issue" } { curlanguage "russian" = { "{\cyr\CYRV\cyrery\cyrp\cyru\cyrs\cyrk}" } { "language is not defined: " language * warning$ "Issue" } if$ } if$ } FUNCTION {bbl.iiss} % { "\bblIss{}" } { curlanguage "english" = {"Iss."} { curlanguage "russian" = { "{\cyr\CYRV\cyrery\cyrp.}" } { "language is not defined: " language * warning$ "Issue" } if$ } if$ } FUNCTION {bbl.of} % { "\bblof{}" } { curlanguage "english" = {"of"} { curlanguage "russian" = { "{\cyr\cyri\cyrz}" } { "language is not defined: " language "of" * * warning$ "of" } if$ } if$ } FUNCTION {bbl.etal} % { "\bblof{}" } { curlanguage "english" = { "et~al." } { curlanguage "russian" = { "{\cyr\cyri~\cyrd\cyrr.}" } { "language is not defined: " language "at al" * * warning$ "at al." } if$ } if$ } FUNCTION {bbl.nnumber} % { "\bblNumber{}" } { curlanguage "english" = { "Number" } { curlanguage "russian" = { "{\cyr\CYRN\cyro\cyrm\cyre\cyrr}" } { "language is not defined: " language "Number" * * warning$ "Number" } if$ } if$ } FUNCTION {bbl.number} % { "\bblnumber{}" } { curlanguage "english" = { "number" } { curlanguage "russian" = { "{\cyr\cyrn\cyro\cyrm\cyre\cyrr}" } { "language is not defined: " language "number" * * warning$ "number" } if$ } if$ } FUNCTION {bbl.nr} % { "\bblno{}" } { curlanguage "english" = { "no." } { curlanguage "russian" = { "{\cyr\textnumero}" } { "language is not defined: " language "no." * * warning$ "no." } if$ } if$ } FUNCTION {bbl.nnr} % { "\bblno{}" } { curlanguage "english" = { "No." } { curlanguage "russian" = { "{\cyr\textnumero}" } { "language is not defined: " language "No." * * warning$ "No." } if$ } if$ } FUNCTION {bbl.in} % { "\bblin{}" } { curlanguage "english" = { "in" } { curlanguage "russian" = { "{\cyr\cyrv}" } { "language is not defined: " language "in" * * warning$ "in" } if$ } if$ } FUNCTION {bbl.iin} % { "\bblIn{}" } { curlanguage "english" = { "In" } { curlanguage "russian" = { "{\cyr\CYRV}" } { "language is not defined: " language "In" * * warning$ "In" } if$ } if$ } FUNCTION {bbl.pages} % { "\bblpp." } { curlanguage "english" = { "pp." } { curlanguage "russian" = { "{\cyr\cyrs.}" } { "language is not defined: " language "pp." * * warning$ "pp." } if$ } if$ } FUNCTION {bbl.page} % { "\bblp." } { curlanguage "english" = {"p."} { curlanguage "russian" = { "{\cyr\cyrs.}"} { "language is not defined: " language "p." * * warning$ "p." } if$ } if$ } FUNCTION {bbl.ppages} % { "\bblPp." } { curlanguage "english" = { "Pp." } { curlanguage "russian" = { "{\cyr\CYRS.}" } { "language is not defined: " language "Pp." * * warning$ "Pp." } if$ } if$ } FUNCTION {bbl.ppage} % { "\bblP." } { curlanguage "english" = { "P." } { curlanguage "russian" = { "{\cyr\CYRS.}" } { "language is not defined: " language "P." * * warning$ "P." } if$ } if$ } FUNCTION {bbl.techrep} { curlanguage "english" = { "Tech. Rep." } { curlanguage "russian" = { "{\cyr\CYRT\cyre\cyrh.\ \cyrd\cyro\cyrk\cyrl\cyra\cyrd.}" } { "language is not defined: " language "Tech. Rep." * * warning$ "P." } if$ } if$ } FUNCTION {bbl.mthesis} { curlanguage "english" = { "Master's thesis" } { curlanguage "russian" = { "{\cyr\CYRM\cyra\cyrg\cyri\cyrs\cyrt\cyre\cyrr\cyrs\cyrk\cyra\cyrya\ \cyrd\cyri\cyrs\cyrs\cyre\cyrr\cyrt\cyra\cyrc\cyri\cyrya}" } { "language is not defined: " language "Master's thesis" * * warning$ "P." } if$ } if$ } FUNCTION {bbl.phdthesis} { curlanguage "english" = { "Ph.D. thesis" } { curlanguage "russian" = { "{\cyr\CYRK\cyra\cyrn\cyrd\cyri\cyrd\cyra\cyrt\cyrs\cyrk\cyra\cyrya\ \cyrd\cyri\cyrs\cyrs\cyre\cyrr\cyrt\cyra\cyrc\cyri\cyrya}" } { "language is not defined: " language "Ph.D. thesis" * * warning$ "P." } if$ } if$ } % \end{macrocode} % \subsection{Формат элементов библиографических ссылок} % \begin{macrocode} INTEGERS { nameptr namesleft numnames } % \end{macrocode} % \DescribeBSTFunction{format.names} % \begin{macrocode} FUNCTION {format.names} { 's := #1 'nameptr := s num.names$ 'numnames := numnames 'namesleft := { namesleft #0 > } { s nameptr "{vv~}{ll}{~f.}{, jj}" format.name$ 't := nameptr #1 > { nameptr #4 = numnames #4 > and { "others" 't := #1 'namesleft := } 'skip$ if$ namesleft #1 > { ", " * t * } { t "others" = t "~others" = or { " " * bbl.etal * } { ", " * t * } if$ } if$ } 't if$ nameptr #1 + 'nameptr := namesleft #1 - 'namesleft := } while$ } % \end{macrocode} % \DescribeBSTFunction{format.names.rev} % \begin{macrocode} FUNCTION {format.names.rev} { 's := #1 'nameptr := s num.names$ 'numnames := numnames 'namesleft := { namesleft #0 > } { s nameptr "{f.}{~vv}{~ll}{, jj}" format.name$ 't := nameptr #1 > { nameptr #4 = numnames #4 > and { "others" 't := #1 'namesleft := } 'skip$ if$ namesleft #1 > { ", " * t * } { t "others" = t "~others" = or { " " * bbl.etal * } { ", " * t * } if$ } if$ } 't if$ nameptr #1 + 'nameptr := namesleft #1 - 'namesleft := } while$ } % \end{macrocode} % \DescribeBSTFunction{format.authors} % \begin{macrocode} FUNCTION {format.authors} { author empty$ { "" } { author format.names emphasize } if$ } % \end{macrocode} % \DescribeBSTFunction{format.bookauthors} % \begin{macrocode} FUNCTION {format.bookauthors} { bookauthor empty$ { "" } { bookauthor format.names } if$ } % \end{macrocode} % \DescribeBSTFunction{format.authors.after} % \begin{macrocode} FUNCTION {format.authors.after} { author empty$ { "" } { author format.names.rev } if$ } % \end{macrocode} % \DescribeBSTFunction{format.bookauthors.after} % \begin{macrocode} FUNCTION {format.bookauthors.after} { bookauthor empty$ { "" } { bookauthor format.names.rev } if$ } % \end{macrocode} % \DescribeBSTFunction{format.editors.after} % \begin{macrocode} FUNCTION {format.editors.after} { editor empty$ { "" } { bbl.edby editor format.names.rev * } if$ } % \end{macrocode} % \DescribeBSTFunction{format.compiler.after} % \begin{macrocode} FUNCTION {format.compiler.after} { compiler empty$ { "" } { bbl.cmplr compiler format.names.rev * } if$ } % \end{macrocode} % \DescribeBSTFunction{format.title} % \begin{macrocode} FUNCTION {format.title} { title empty$ { "" } { title } if$ } % \end{macrocode} % \DescribeBSTFunction{format.date} % \begin{macrocode} FUNCTION {format.date} { year empty$ { month empty$ { "" } { "there's a month but no year in " cite$ * warning$ month } if$ } { month empty$ 'year { year ". " quote$ "--- " month * * * * } if$ } if$ } % \end{macrocode} % \DescribeBSTFunction{output.address.publisher.date} % \begin{macrocode} FUNCTION {output.address.publisher.date} { address empty$ 'skip$ { address output publisher empty$ 'skip$ { new.column } if$ } if$ publisher output format.date output } % \end{macrocode} % \DescribeBSTFunction{output.bibitem} % \begin{macrocode} FUNCTION {output.bibitem} { newline$ "\bibitem[" write$ "\BibPrefix" write$ label write$ "\BibPostfix" write$ "]{" write$ cite$ write$ "}" write$ newline$ language empty$ { "english" 'curlanguage := } { language 'curlanguage := } if$ "\selectlanguageifdefined{" write$ curlanguage write$ "}" write$ newline$ "" before.all 'output.state := } % \end{macrocode} % \DescribeBSTFunction{n.dashify} % \begin{macrocode} FUNCTION {n.dashify} { 't := "" { t empty$ not } { t #1 #1 substring$ "-" = { t #1 #2 substring$ "--" = not { "--" * t #2 global.max$ substring$ 't := } { { t #1 #1 substring$ "-" = } { "-" * t #2 global.max$ substring$ 't := } while$ } if$ } { t #1 #1 substring$ * t #2 global.max$ substring$ 't := } if$ } while$ } % \end{macrocode} % \DescribeBSTFunction{word.in} % \begin{macrocode} FUNCTION {word.in} { bbl.iin " " * } % \end{macrocode} % \DescribeBSTFunction{format.btitle} % \begin{macrocode} FUNCTION {format.btitle} { title } % \end{macrocode} % \DescribeBSTFunction{tie.or.space.connect} % \begin{macrocode} FUNCTION {tie.or.space.connect} { duplicate$ text.length$ #3 < { "~" } { " " } if$ swap$ * * } % \end{macrocode} % \DescribeBSTFunction{tie.connect} % \begin{macrocode} FUNCTION {tie.connect} { "~" swap$ * * } % \end{macrocode} % \DescribeBSTFunction{either.or.check} % \begin{macrocode} FUNCTION {either.or.check} { empty$ 'pop$ { "can't use both " swap$ * " fields in " * cite$ * warning$ } if$ } % \end{macrocode} % \DescribeBSTFunction{format.bvolume} % \begin{macrocode} FUNCTION {format.bvolume} { volume empty$ { "" } { bbl.vvol volume tie.connect series empty$ 'skip$ { bbl.of space.word * series emphasize * } if$ "volume and number" number either.or.check } if$ } % \end{macrocode} % \DescribeBSTFunction{format.number.series} % \begin{macrocode} FUNCTION {format.number.series} { volume empty$ { number empty$ { series field.or.null } { series empty$ { "there's a number but no series in " cite$ * warning$ bbl.nnr } { new.sentence series bbl.nr tie.or.space.connect } if$ number tie.or.space.connect } if$ } { "" } if$ } % \end{macrocode} % \DescribeBSTFunction{is.num} % \begin{macrocode} FUNCTION {is.num} { chr.to.int$ duplicate$ "0" chr.to.int$ < not swap$ "9" chr.to.int$ > not and } % \end{macrocode} % \DescribeBSTFunction{extract.num} % \begin{macrocode} FUNCTION {extract.num} { duplicate$ 't := "" 's := { t empty$ not } { t #1 #1 substring$ t #2 global.max$ substring$ 't := duplicate$ is.num { s swap$ * 's := } { pop$ "" 't := } if$ } while$ s empty$ 'skip$ { pop$ s } if$ } % \end{macrocode} % \DescribeBSTFunction{convert.edition} % \begin{macrocode} FUNCTION {convert.edition} { edition } % \end{macrocode} % \DescribeBSTFunction{format.edition} % \begin{macrocode} FUNCTION {format.edition} { edition empty$ { "" } { output.state mid.sentence = { convert.edition "l" change.case$ " " * bbl.edition * } { convert.edition "t" change.case$ " " * bbl.edition * } if$ } if$ } INTEGERS { multiresult } % \end{macrocode} % \DescribeBSTFunction{multi.page.check} % \begin{macrocode} FUNCTION {multi.page.check} { 't := #0 'multiresult := { multiresult not t empty$ not and } { t #1 #1 substring$ duplicate$ "-" = swap$ duplicate$ "," = swap$ "+" = or or { #1 'multiresult := } { t #2 global.max$ substring$ 't := } if$ } while$ multiresult } % \end{macrocode} % \DescribeBSTFunction{format.pages} % \begin{macrocode} FUNCTION {format.pages} { pages empty$ { "" } { pages multi.page.check { bbl.ppages pages n.dashify tie.connect } { bbl.ppage pages tie.connect } if$ } if$ } % \end{macrocode} % \DescribeBSTFunction{format.pages.page} % \begin{macrocode} FUNCTION {format.pages.page} { pages empty$ { numpages empty$ { "" } { numpages bbl.pages tie.connect } if$ } { format.pages } if$ } % \end{macrocode} % \DescribeBSTFunction{format.vol.num.pages} % \begin{macrocode} FUNCTION {format.vol.num.pages} { volume field.or.null number empty$ 'skip$ { ", no." number tie.or.space.connect * volume empty$ { "there's a number but no volume in " cite$ * warning$ } 'skip$ if$ } if$ pages empty$ 'skip$ { duplicate$ empty$ { pop$ format.pages } { ": " * pages n.dashify * } if$ } if$ } % \end{macrocode} % \DescribeBSTFunction{format.volume} % \begin{macrocode} FUNCTION {format.volume} { volume empty$ { "" } { bbl.vvol volume tie.or.space.connect } if$ } % \end{macrocode} % \DescribeBSTFunction{format.number} % \begin{macrocode} FUNCTION {format.number} { number empty$ { "" } { bbl.nr number tie.or.space.connect } if$ } % \end{macrocode} % \DescribeBSTFunction{empty.misc.check} % \begin{macrocode} FUNCTION {empty.misc.check} { author empty$ title empty$ howpublished empty$ month empty$ year empty$ note empty$ and and and and and key empty$ not and { "all relevant fields are empty in " cite$ * warning$ } 'skip$ if$ } % \end{macrocode} % \DescribeBSTFunction{format.thesis.type} % \begin{macrocode} FUNCTION {format.thesis.type} { type empty$ 'skip$ { pop$ type "t" change.case$ } if$ } % \end{macrocode} % \DescribeBSTFunction{format.tr.number} % \begin{macrocode} FUNCTION {format.tr.number} { type empty$ { bbl.techrep } 'type if$ number empty$ { "t" change.case$ } { number tie.or.space.connect } if$ } % \end{macrocode} % \DescribeBSTFunction{author.before} % \begin{macrocode} FUNCTION {author.before} { author empty$ 'skip$ { format.authors output new.sentence } if$ } % \end{macrocode} % \DescribeBSTFunction{bookauthor.before} % \begin{macrocode} FUNCTION {bookauthor.before} { bookauthor empty$ 'skip$ { format.bookauthors output new.sentence } if$ } % \end{macrocode} % \DescribeBSTFunction{author.after} % \begin{macrocode} FUNCTION {author.after} { author empty$ 'skip$ { author num.names$ #3 > { format.authors.after output new.semicolumn } 'skip$ if$ } if$ } % \end{macrocode} % \DescribeBSTFunction{bookauthor.after} % \begin{macrocode} FUNCTION {bookauthor.after} { bookauthor empty$ 'skip$ { bookauthor num.names$ #3 > { format.bookauthors.after output new.semicolumn } 'skip$ if$ } if$ } % \end{macrocode} % \DescribeBSTFunction{editor.organization.after} % \begin{macrocode} FUNCTION {editor.organization.after} { compiler empty$ 'skip$ { format.compiler.after output new.semicolumn } if$ editor empty$ 'skip$ { format.editors.after output new.semicolumn } if$ organization empty$ 'skip$ { organization output new.semicolumn } if$ } % \end{macrocode} % \DescribeBSTFunction{format.url} % \begin{macrocode} FUNCTION {format.url} { url empty$ { "" } { "\BibUrl{" url * "}" * } if$ } % \end{macrocode} % \DescribeBSTFunction{format.urldate} % \begin{macrocode} FUNCTION {format.urldate} { urldate empty$ { "" } { add.blank "\BibUrlDate{" urldate * "}" * } if$ } % \end{macrocode} % \DescribeBSTFunction{output.url} % \begin{macrocode} FUNCTION {output.url} { url empty$ 'skip$ { format.url output format.urldate output } if$ } % \end{macrocode} % \DescribeBSTFunction{format.annote} % \begin{macrocode} FUNCTION {format.annote} { annote empty$ { "" } { after.sentence 'output.state := "\BibAnnote{" annote add.period$ * "}" * } if$ } % \end{macrocode} % \subsection{Описание типов библиографических ссылок} % \DescribeBSTFunction{article} % \begin{macrocode} FUNCTION {article} { output.bibitem author.before format.title "title" output.check new.dblslash journal emphasize "journal" output.check new.block format.date output new.block format.volume output format.number output new.block format.pages.page output new.block note output new.sentence output.url format.annote output fin.entry } % \end{macrocode} % \DescribeBSTFunction{book} % \begin{macrocode} FUNCTION {book} { output.bibitem author.before format.btitle "title" output.check editor.organization.after new.sentence format.number.series output new.block format.edition output new.block output.address.publisher.date new.block format.bvolume output new.block format.pages.page output new.block note output new.sentence output.url format.annote output fin.entry } % \end{macrocode} % \DescribeBSTFunction{booklet} % \begin{macrocode} FUNCTION {booklet} { output.bibitem author.before format.title "title" output.check editor.organization.after new.block howpublished output address output format.date output new.block note output new.sentence output.url format.annote output fin.entry } % \end{macrocode} % \DescribeBSTFunction{inbook} % \begin{macrocode} FUNCTION {inbook} { output.bibitem author.before format.btitle "title" output.check new.dblslash bookauthor.before booktitle "booktitle" output.check editor.organization.after new.block format.edition output new.block format.number.series output new.sentence output.address.publisher.date new.block format.bvolume output new.block format.pages.page output new.block note output new.sentence output.url format.annote output fin.entry } % \end{macrocode} % \DescribeBSTFunction{incollection} % \begin{macrocode} FUNCTION {incollection} { output.bibitem author.before new.sentence format.title "title" output.check new.dblslash booktitle "booktitle" output.check new.slash editor.organization.after new.block output.address.publisher.date new.block format.bvolume output format.number.series output new.block format.pages.page output new.block note output new.block output.url format.annote output fin.entry } % \end{macrocode} % \DescribeBSTFunction{inproceedings} % \begin{macrocode} FUNCTION {inproceedings} { output.bibitem author.before new.sentence format.title "title" output.check new.dblslash booktitle "booktitle" output.check new.slash editor.organization.after new.block format.bvolume output format.number.series output new.block address empty$ { publisher output format.date "year" output.check } { address output.nonnull new.column publisher output format.date "year" output.check } if$ new.block format.pages.page output new.block note output new.sentence output.url format.annote output fin.entry } % \end{macrocode} % \DescribeBSTFunction{conference} % \begin{macrocode} FUNCTION {conference} { inproceedings } % \end{macrocode} % \DescribeBSTFunction{manual} % \begin{macrocode} FUNCTION {manual} { output.bibitem author empty$ { organization empty$ 'skip$ { organization output.nonnull address output } if$ } { format.authors output.nonnull } if$ new.block format.btitle "title" output.check author empty$ { organization empty$ { address new.block.checka address output } 'skip$ if$ } { organization address new.block.checkb organization output address output } if$ format.edition output format.date output new.block note output new.sentence output.url format.annote output fin.entry } % \end{macrocode} % \DescribeBSTFunction{mastersthesis} % \begin{macrocode} FUNCTION {mastersthesis} { output.bibitem format.authors "author" output.check new.block format.btitle "title" output.check new.block bbl.mthesis format.thesis.type output.nonnull school "school" output.check address output format.date "year" output.check new.block note output new.block output.url format.annote output fin.entry } % \end{macrocode} % \DescribeBSTFunction{phdthesis} % \begin{macrocode} FUNCTION {misc} { output.bibitem format.authors "author" output.check new.block format.title "title" output.check new.block howpublished output new.block format.date output new.block note output new.sentence output.url format.annote output fin.entry } % \end{macrocode} % \DescribeBSTFunction{phdthesis} % \begin{macrocode} FUNCTION {phdthesis} { output.bibitem format.authors "author" output.check new.sentence format.btitle "title" output.check new.column bbl.phdthesis format.thesis.type output.nonnull new.slash school "school" output.check new.block output.address.publisher.date new.block format.pages.page output note output new.sentence output.url format.annote output fin.entry } % \end{macrocode} % \DescribeBSTFunction{proceedings} % \begin{macrocode} FUNCTION {proceedings} { output.bibitem format.btitle "title" output.check new.slash editor.organization.after new.block format.bvolume output format.number.series output address empty$ { publisher output format.date "year" output.check } { address output.nonnull format.date "year" output.check new.sentence publisher output } if$ new.block note output new.sentence output.url format.annote output fin.entry } % \end{macrocode} % \DescribeBSTFunction{techreport} % \begin{macrocode} FUNCTION {techreport} { output.bibitem author.before new.sentence format.title "title" output.check new.column format.tr.number output.nonnull editor.organization.after new.block address output new.column institution "institution" output.check format.date "year" output.check new.block note output new.sentence output.url format.annote output fin.entry } % \end{macrocode} % \DescribeBSTFunction{unpublished} % \begin{macrocode} FUNCTION {unpublished} { output.bibitem author.before format.btitle "title" output.check editor.organization.after new.block note "note" output.check new.sentence output.url format.annote output fin.entry } % \end{macrocode} % \DescribeBSTFunction{default.type} % \begin{macrocode} FUNCTION {default.type} { misc } % \end{macrocode} % \subsection{Сокращения названий месяцев и журналов} % \begin{macrocode} MACRO {jan} {"\bbljan{}"} MACRO {feb} {"\bblfeb{}"} MACRO {mar} {"\bblmar{}"} MACRO {apr} {"\bblapr{}"} MACRO {may} {"\bblmay{}"} MACRO {jun} {"\bbljun{}"} MACRO {jul} {"\bbljul{}"} MACRO {aug} {"\bblaug{}"} MACRO {sep} {"\bblsep{}"} MACRO {oct} {"\bbloct{}"} MACRO {nov} {"\bblnov{}"} MACRO {dec} {"\bbldec{}"} MACRO {acmcs} {"ACM Computing Surveys"} MACRO {acta} {"Acta Informatica"} MACRO {cacm} {"Communications of the ACM"} MACRO {ibmjrd} {"IBM Journal of Research and Development"} MACRO {ibmsj} {"IBM Systems Journal"} MACRO {ieeese} {"IEEE Transactions on Software Engineering"} MACRO {ieeetc} {"IEEE Transactions on Computers"} MACRO {ieeetcad} {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} MACRO {ipl} {"Information Processing Letters"} MACRO {jacm} {"Journal of the ACM"} MACRO {jcss} {"Journal of Computer and System Sciences"} MACRO {scp} {"Science of Computer Programming"} MACRO {sicomp} {"SIAM Journal on Computing"} MACRO {tocs} {"ACM Transactions on Computer Systems"} MACRO {tods} {"ACM Transactions on Database Systems"} MACRO {tog} {"ACM Transactions on Graphics"} MACRO {toms} {"ACM Transactions on Mathematical Software"} MACRO {toois} {"ACM Transactions on Office Information Systems"} MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} MACRO {tcs} {"Theoretical Computer Science"} READ % \end{macrocode} % \subsection{Функции для сортировки списка литературы по именам авторов и названиям} % \begin{macrocode} %<*gost705s> % \end{macrocode} % \DescribeBSTFunction{sortify} % \begin{macrocode} FUNCTION {sortify} { purify$ "l" change.case$ } INTEGERS { len } % \end{macrocode} % \DescribeBSTFunction{chop.word} % \begin{macrocode} FUNCTION {chop.word} { 's := 'len := s #1 len substring$ = { s len #1 + global.max$ substring$ } 's if$ } % \end{macrocode} % \DescribeBSTFunction{sort.format.names} % \begin{macrocode} FUNCTION {sort.format.names} { 's := #1 'nameptr := "" s num.names$ 'numnames := numnames 'namesleft := { namesleft #0 > } { nameptr #1 > { " " * } 'skip$ if$ s nameptr "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" format.name$ 't := nameptr numnames = t "others" = and { "et al" * } { t sortify * } if$ nameptr #1 + 'nameptr := namesleft #1 - 'namesleft := } while$ } % \end{macrocode} % \DescribeBSTFunction{sort.format.title} % \begin{macrocode} FUNCTION {sort.format.title} { 't := "A " #2 "An " #3 "The " #4 t chop.word chop.word chop.word sortify #1 global.max$ substring$ } % \end{macrocode} % \DescribeBSTFunction{author.sort} % \begin{macrocode} FUNCTION {author.sort} { author empty$ { key empty$ { "to sort, need author or key in " cite$ * warning$ "" } { key sortify } if$ } { author sort.format.names } if$ } % \end{macrocode} % \DescribeBSTFunction{author.title.sort} % \begin{macrocode} FUNCTION {author.title.sort} { author empty$ { title empty$ { key empty$ { "to sort, need author, title, or key in " cite$ * warning$ "" } { key sortify } if$ } { title sort.format.title } if$ } { author sort.format.names } if$ } % \end{macrocode} % \DescribeBSTFunction{presort} % \begin{macrocode} FUNCTION {presort} { author.title.sort " " * year field.or.null sortify * " " * title field.or.null sort.format.title * #1 entry.max$ substring$ 'sort.key$ := } ITERATE {presort} SORT % % \end{macrocode} % \subsection{Вычисление длины табуляции между номером и текстом} % \begin{macrocode} STRINGS { longest.label } INTEGERS { number.label longest.label.width } % \end{macrocode} % \DescribeBSTFunction{initialize.longest.label} % \begin{macrocode} FUNCTION {initialize.longest.label} { "" 'longest.label := #1 'number.label := #0 'longest.label.width := } % \end{macrocode} % \DescribeBSTFunction{longest.label.pass} % \begin{macrocode} FUNCTION {longest.label.pass} { number.label int.to.str$ 'label := number.label #1 + 'number.label := label width$ longest.label.width > { label 'longest.label := label width$ 'longest.label.width := } 'skip$ if$ } EXECUTE {initialize.longest.label} ITERATE {longest.label.pass} % \end{macrocode} % \subsection{Формирование окружения thebibliography} % \subsubsection{Преамбула} % \DescribeBSTFunction{begin.bib} % \begin{macrocode} FUNCTION {begin.bib} { preamble$ empty$ 'skip$ { preamble$ write$ newline$ } if$ "\makeatletter\renewcommand{\@biblabel}[1]{#1.}\makeatother" write$ newline$ "\ifx\undefined\BibPrefix\def\BibPrefix{}\else\fi" write$ newline$ "\ifx\undefined\BibPostfix\def\BibPostfix{}\else\fi" write$ newline$ "\ifx\undefined\BibEmph\def\BibEmph#1{#1}\else\fi" write$ newline$ "\ifx\undefined\url\def\url#1{\texttt{#1}}\else\fi" write$ newline$ "\ifx\undefined\urlprefix\def\urlprefix{URL: }\else\fi" write$ newline$ "\ifx\undefined\BibUrl\def\BibUrl#1{\urlprefix\url{#1}}\else\fi" write$ newline$ "\ifx\undefined\BibUrlDate\long\def\BibUrlDate#1{({%" write$ newline$ "\cyr\cyrd\cyra\cyrt\cyra\ %" write$ newline$ "\cyro\cyrb\cyrr\cyra\cyrshch\cyre\cyrn\cyri\cyrya}: #1)}\else\fi" write$ newline$ "\ifx\undefined\BibAnnote\long\def\BibAnnote#1{#1}\else\fi" write$ newline$ "\begin{thebibliography}{\BibPrefix" longest.label * "\BibPostfix}" * write$ newline$ "\def\selectlanguageifdefined#1{" write$ newline$ "\expandafter\ifx\csname date#1\endcsname\relax" write$ newline$ "\else\language\csname l@#1\endcsname\fi}" write$ newline$ } % \end{macrocode} % \subsubsection{Начало окружения} % \begin{macrocode} EXECUTE {begin.bib} EXECUTE {init.state.consts} ITERATE {call.type$} % \end{macrocode} % \subsubsection{Конец окружения} % \DescribeBSTFunction{end.bib} % \begin{macrocode} FUNCTION {end.bib} { newline$ "\end{thebibliography}" write$ newline$ } EXECUTE {end.bib} % % \end{macrocode}