0

I need to output the bibliography as a table. Example: enter image description here

My biblatex Style 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} }

I am currently using this setting, but how to add the output of the horizontal lines of the table in it, I can not understand.

    \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]}

Related questions: Biblatex tabular bibliography, tabular bibliography with biblatex

  • 1
    Welcome to TeX.SE. The example that you provided seems to be rather different from a regular bibliography (with authors, journals, year of publication etc.). Maybe using a glossary of some sort would be a better fit? This would also make it easier to format the result as a table. See for example http://mirrors.ctan.org/macros/latex/contrib/glossaries/glossariesbegin.pdf. – Marijn Apr 19 '21 at 06:45
  • Maybe you're right. I'll try using a glossary. But I still need to sort by keywords. So I decided to use Biblatex. – Антон Брюзгин Apr 19 '21 at 08:32
  • With glossaries you can also sort in various ways, see for example https://tex.stackexchange.com/questions/304092/glossaries-use-of-sort-key. – Marijn Apr 19 '21 at 09:40

1 Answers1

3

My biblatex-ext bundle contains the package biblatex-ext-tabular that can be used to typeset tabular bibliographies. The code in the bundle is based on Audrey's code from tabular bibliography with biblatex, but bundling it up in a package means it is easier to use.

Here is a very simple definition that just prints header and title of your @reference entries. For more complex definitions have a look at the biblatex-ext documentation (§6 Tabular Bibliographies in v0.12).

\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}

Tabular bibliography for standards


In response to further comments and questions.

I don't think it is possibly to sort by keywords (and since keywords are internal markers, I think it would be tricky to sort by keywords anyway, plus they have a very particular semantic: e.g. if you give multiple keywords for the same entry, order should not matter, but it would for sorting). But it is possible to cook up sorting based on keywords with a Biber sourcemap. In this case, however, I feel entrysubtype is much more appropriate than keywords for the job, so I used that.

\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}

List sorted by standard type, then title.

moewe
  • 175,683
  • Yes, this is what you need. I didn't find it in the documentation. Is it possible to use sorting when outputting \printbibtabular[type=reference, keyword={Standart}, title={Standart }] Biblatex/Biber subbibliography sorting by keywords – Антон Брюзгин Apr 20 '21 at 08:21
  • @АнтонБрюзгин Sure. You can use whatever sorting you want. Just pass the sorting option to biblatex at load-time. If you want the tabular bibliography sorted with a different sorting scheme place \newrefcontext[sorting=<scheme>] before the \printbibtabular call. – moewe Apr 20 '21 at 15:09
  • Thank you, but this is sorting by field. I need to output by the keyword look Biblatex page 91 keyword=<keyword> Print only entries whose keywordsfield includes <keyword>. This option may be used multiple times. – Антон Брюзгин Apr 21 '21 at 05:51
  • @АнтонБрюзгин I'm sorry, I don't think I understand what you want to do. Filtering and sorting are two different things that are for the most part independent. With keyword=foo, you filter entries and only show entries with keyword foo in the bibliography. That works fine here. But this has nothing to do with sorting as such. Maybe you can explain what you want to do in the setting of the code from my answer. – moewe Apr 21 '21 at 06:06
  • @АнтонБрюзгин See the edit, please. – moewe Apr 24 '21 at 10:21
  • Thank you, this is what you need. – Антон Брюзгин Apr 29 '21 at 04:09