我的 biblatex 风格Biblatex-Gost
\RequirePackage[style=gost-authoryear,% Base Style authoryear
backend=biber,%
bibencoding=utf8,%
texencoding=utf8,%
hyperref=true,%
sorting=none,
mcite=false,
doi=false,
singletitle=true,
labeltitle=true,
uniquename=true]{biblatex}
@Reference{QR_160D,
heading = {QR---160D},
hyphenation = {russian},
title = {Environmental conditions and test procedures for airborne equipment}
}
@Reference{ASTM_D2196_18,
heading = {ASTM D2196---18},
hyphenation = {russian},
title = {Standard Test Methods for Rheological Properties of Non-Newtonian Materials by Rotational Viscometer}
}
我目前正在使用这个设置,但是如何在其中添加表格水平线的输出,我不明白。
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=heading, final]
\step[fieldset=shorthand, origfieldval]
}
}
}
\newcommand{\reference}{%
\par\begin{tabularx}{\textwidth}{>{\arraybackslash}m{0.30\textwidth}>{\arraybackslash}m{0.65\textwidth}}
\printfield{heading}
& \printfield{title} \clearfield{heading} \clearfield{title} \clearlist{specdata} \clearfield{pagetotal} %
\clearfield{year} \clearlist{publisher} \clearlist{location} \clearfield{series} \clearfield{year}%
}
\newcommand{\patchdrivers}{%
\xpretobibdriver{reference}{\reference}{}{}%
\xapptobibdriver{reference}{\end{tabularx}}{}{}%
}
\defbibenvironment{tablebib}
{ \setlength{\parindent}{0pt}%
\renewcommand*{\labelnamepunct}{}%
\patchdrivers}
{}
{}
\newcommand*{\VPprintbibliography}{\printbibliography[env=tablebib]}
答案1
我的biblatex-ext
软件包包含可用于排版表格书目的包biblatex-ext-tabular
。软件包中的代码基于奥黛丽的代码来自使用 biblatex 的表格书目,但将其捆绑在一个包中意味着它更容易使用。
这是一个非常简单的定义,它只打印header
您title
的@reference
条目。有关更复杂的定义,请查看biblatex-ext
文档(v0.12 中的§6 表格书目)。
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=gost-authoryear,]{biblatex}
\usepackage{biblatex-ext-tabular}
\usepackage{longtable}
\usepackage{array}
\newcolumntype{L}[1]{%
>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}
\defbibtabular{bibtabular}
{\setlength{\LTpre}{0pt}%
\setlength{\LTpost}{0pt}%
\renewcommand*{\arraystretch}{2}%
\begin{longtable}{%
@{}
|L{\dimexpr0.35\textwidth-\tabcolsep\relax}|
L{\dimexpr0.65\textwidth-\tabcolsep\relax}|
@{}}
\hline
\textbf{Standard designator} & \textbf{Name}\\
\hline
\endfirsthead}
{\end{longtable}}
{\anchorlang{\printfield[default]{heading}}
& \plainlang{\printfield{title}}\\\hline}
\begin{filecontents}{\jobname.bib}
@Reference{QR_160D,
heading = {QR---160D},
title = {Environmental conditions and test procedures for airborne equipment},
}
@Reference{ASTM_D2196_18,
heading = {ASTM D2196---18},
title = {Standard Test Methods for Rheological Properties
of Non-Newtonian Materials by Rotational Viscometer},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\begin{document}
Lorem \autocite{sigfridsson,QR_160D,ASTM_D2196_18}
\printbibliography[nottype=reference]
\printbibtabular[type=reference, title=Standards]
\end{document}
回应进一步的评论和问题。
我认为不可能按关键字排序keywords
(而且由于关键字是内部标记,我认为按关键字排序无论如何都会很棘手,而且它们具有非常特殊的语义:例如,如果您为同一条目提供多个关键字,则顺序应该无关紧要,但排序却很重要)。但是可以使用 Biber 源映射根据关键字进行排序。但是,在这种情况下,我觉得这比这项工作entrysubtype
更合适,所以我使用了它。keywords
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[russian]{babel}
\usepackage{csquotes}
\usepackage[
style=gost-authoryear,
backend=biber,
language=autobib,
autolang=other,
clearlang=true,
defernumbers=true,
sortcites=true,
sorting=none,
mcite=false,
doi=false,
isbn=false,
singletitle=true,
labeltitle=true,
uniquename=true]{biblatex}
\usepackage{biblatex-ext-tabular}
\usepackage{longtable}
\usepackage{array}
\newcolumntype{L}[1]{%
>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}
\defbibtabular{bibtabular}
{\setlength{\LTpre}{0pt}%
\setlength{\LTpost}{0pt}%
\renewcommand*{\arraystretch}{2}%
\begin{longtable}{%
@{}
|L{\dimexpr0.35\textwidth-\tabcolsep\relax}|
L{\dimexpr0.65\textwidth-\tabcolsep\relax}|
@{}}
\hline
\textbf{Standard designator} & \textbf{Name}\\
\hline
\endfirsthead}
{\end{longtable}}
{\anchorlang{\printfield[default]{heading}}
& \plainlang{\printfield{title}}\\\hline}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldsource=entrysubtype, match=\regexp{\Astandard\Z}, final]
\step[fieldset=presort, fieldvalue=AA]
}
\map{
\step[fieldsource=entrysubtype, match=\regexp{\Aotherstandard\Z}, final]
\step[fieldset=presort, fieldvalue=BB]
}
\map{
\step[fieldsource=entrysubtype, match=\regexp{\Ainterstatestandard\Z}, final]
\step[fieldset=presort, fieldvalue=CC]
\step[fieldset=title, null]
}
}
}
\begin{filecontents}{\jobname.bib}
@reference{QR_160D,
heading = {QR---160D},
title = {Environmental conditions and test procedures for airborne equipment},
entrysubtype = {standard},
}
@reference{QR_160A,
heading = {QR---160A},
title = {Environmental conditions and test procedures for airborne equipment},
entrysubtype = {standard},
}
@reference{QR_160F,
heading = {QR---160F},
title = {Environmental conditions and test procedures for airborne equipment},
entrysubtype = {standard},
}
@reference{ASTM_D2196_18,
heading = {ASTM D2196---18},
title = {Standard Test Methods for Rheological Properties
of Non-Newtonian Materials by Rotational Viscometer},
entrysubtype = {otherstandard},
}
@reference{ASTM_D2196_19,
heading = {ASTM D2196---19},
title = {Standard Test Methods for Rheological Properties
of Non-Newtonian Materials by Rotational Viscometer},
entrysubtype = {otherstandard},
}
@reference{ASTM_D2196_11,
heading = {ASTM D2196---11},
title = {Standard Test Methods for Rheological Properties
of Non-Newtonian Materials by Rotational Viscometer},
entrysubtype = {otherstandard},
}
@reference{ASTM_D2196_48,
heading = {ASTM D2196---48},
title = {Standard Test Methods for Rheological Properties
of Non-Newtonian Materials by Rotational Viscometer},
entrysubtype = {otherstandard},
}
@reference{IEC_60063,
heading = {IEC~60063},
title = {Marking codes for resistors and capacitors},
entrysubtype = {interstatestandard},
}
\end{filecontents}
\addbibresource{\jobname.bib}
%\addbibresource{biblatex-examples.bib}
\begin{document}
Lorem \cite{QR_160D, ASTM_D2196_18, ASTM_D2196_11, ASTM_D2196_19}
\cite{QR_160A, ASTM_D2196_11, ASTM_D2196_48, QR_160F,IEC_60063}
\newrefcontext[sorting=nty]
\printbibtabular[type=reference]
\end{document}