diff options
author | Norbert Preining <norbert@preining.info> | 2020-03-01 03:01:38 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-03-01 03:01:38 +0000 |
commit | ad1928316d819ffb337fc4a926dbef47607dfb95 (patch) | |
tree | ccca9edbbeacc0e88602998f86c75b2c24c02af6 /macros/latex/contrib/biblatex2bibitem | |
parent | 4736ac744a8c914e0d5ced1d157e017a385bbf43 (diff) |
CTAN sync 202003010301
Diffstat (limited to 'macros/latex/contrib/biblatex2bibitem')
-rw-r--r-- | macros/latex/contrib/biblatex2bibitem/README.md | 10 | ||||
-rw-r--r-- | macros/latex/contrib/biblatex2bibitem/biblatex2bibitem.sty | 64 |
2 files changed, 74 insertions, 0 deletions
diff --git a/macros/latex/contrib/biblatex2bibitem/README.md b/macros/latex/contrib/biblatex2bibitem/README.md new file mode 100644 index 0000000000..6873f6272d --- /dev/null +++ b/macros/latex/contrib/biblatex2bibitem/README.md @@ -0,0 +1,10 @@ +## Usage +In preamble: +``` +\usepackage{biblatex2bibitem} +``` + +At the very end of document: +``` +\printbibitembibliography +``` diff --git a/macros/latex/contrib/biblatex2bibitem/biblatex2bibitem.sty b/macros/latex/contrib/biblatex2bibitem/biblatex2bibitem.sty new file mode 100644 index 0000000000..cc3ff68bcf --- /dev/null +++ b/macros/latex/contrib/biblatex2bibitem/biblatex2bibitem.sty @@ -0,0 +1,64 @@ +% A workaround to convert biblatex-generated bibliography to bibitems +% +% (c) Nikolai Avdeev aka @nickkolok, and @odomanov +% +% See also https://github.com/odomanov/biblatex-gost/issues/20 +% +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN archives +%% in directory macros/latex/base/lppl.txt. +% +\NeedsTeXFormat{LaTeX2e}[1994/06/01] +\ProvidesPackage{biblatex2bibitem} + [2020/02/24 v0.01 LaTeX package to convert biblatex-generated bibliography to bibitem commands] + +\RequirePackage{biblatex} + +\defbibenvironment{bibitembibliography} + {\textbackslash begin\{thebibliography\}\{99\} + % Page numbers and page headings are not wanted when copying + \thispagestyle{empty} + \pagestyle{empty} + \hyphenpenalty=10000 + \exhyphenpenalty=10000 + \renewcommand*{\&}{\textbackslash \symbol{38}}% + \renewcommand*{\mkbibemph}[1]{\textbackslash emph\{##1\}}% + \renewcommand*{\mkbibitalic}[1]{\textbackslash textit\{##1\}}% + \renewcommand*{\mkbibbold}[1]{\textbackslash textbf\{##1\}}% + %\DeclareFieldFormat{titlecase}{\texttt{\utffriendlydetokenize{#1}}} + \list{}{}} + {\endlist + \textbackslash end\{thebibliography\} + \thispagestyle{empty} + \pagestyle{empty} + } + {\item\%\\~\textbackslash bibitem\{\printfield{entrykey}\}\\} + +\newcommand{\utffriendlydetokenize}[1]{ + \scantokens{ + \catcode`\_=12 + \catcode`\^=12 + \catcode`\{=12 + \catcode`\}=12 + \catcode`\&=12 + \catcode`\$=12 + \catcode`\#=12 + \catcode`\\=12 + #1 + } +} + + + +\newcommand{\printbibitembibliography}{ + \raggedright + \DeclareFieldFormat{titlecase}{\utffriendlydetokenize{##1}} + %\DeclareDelimFormat[bib]{nametitledelim}{\newline\bibsentence} + \printbibliography[env=bibitembibliography] +} + + + +\endinput +%% +%% End of file `biblatex2bibitem.sty'. |