-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: generate thebibliography
environment
#292
Comments
This is not really going to be possible in general I think. The way |
@nickkolok suggested outputing right into pdf, for example using something like this: \defbibenvironment{thebibliography}
{\textbackslash begin\{thebibliography\}\{99\}
\renewcommand*{\mkbibemph}[1]{\textbackslash textit\{##1\}}
\list{}{}}
{\endlist
\textbackslash end\{thebibliography\}}
{\item\textbackslash bibitem\{\printfield{entrykey}\}\\} and then \printbibliography[env=thebibliography] This is already useful, you can just copy the text from the pdf file to the tex source. But maybe this can be adapted even futher? An MWE to experiment: \RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@INBOOK{i1:aa,
author = {Author},
title = {Ztitle},
booktitle = {Booktitle},
editor = {Editor},
}
@BOOK{b1:ee-tt,
author = {Eauthor},
title = {Title},
}
@BOOK{b2_sss,
author = {Sauthor},
title = {Title},
}
\end{filecontents*}
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{biblatex}
\addbibresource{\jobname.bib}
\defbibenvironment{thebibliography}
{\textbackslash begin\{thebibliography\}\{99\}
\renewcommand*{\mkbibemph}[1]{\textbackslash textit\{##1\}}
\list{}{}}
{\endlist
\textbackslash end\{thebibliography\}}
{\item\textbackslash bibitem\{\printfield{entrykey}\}\\}
\begin{document}
\nocite{*}
\printbibliography[env=thebibliography]
\printbibliography
\end{document} |
Uploaded a package to CTAN: https://ctan.org/pkg/biblatex2bibitem |
That looks interesting. I take it this is an extension of the idea @odomanov presented above? The GitLab repo appears to be private (at least I get asked for a log-in). Can you share a short example that uses your package? I decided to lock the discussion at #783 to bundle comments on one issue. In case people are interested in this issue they may still want to read the comments in #783 for some background. |
Yes, surely. For the very initial history, refer to odomanov/biblatex-gost#20 (in Russian).
Sorry, it was my fault. Now it should be public. |
Here you are: https://gitlab.com/Nickkolok/biblatex2bibitem/-/blob/master/mwe.tex The PDF file looks like this: |
Added more examples with formulas to the same file |
The answer is really clear: the output should be compatible with the
Well, looks as a missing fallback! Sometimes I'd prefer to format one reference manually (because of lack of time) and to get others formatted by
It would be great if Anyway, it is a topic for a separate feature request.
My use-case is pretty simple: I know how to configure
Agree completely. Summing up: your arguments against including the feature into the core of |
There are some tricky issues that you may want to help with: https://gitlab.com/Nickkolok/biblatex2bibitem/issues |
I guess that is one sensible way to define what to do, yes. (Note that the
As I said, The closest way to having most entries formatted by
I'm afraid I won't have time to contribute actively to your project in the near future. But for https://gitlab.com/Nickkolok/biblatex2bibitem/issues/1 you may want to look at the field formats for DOIs and URLs in biblatex/tex/latex/biblatex/biblatex.def Lines 481 to 485 in 2ddd283
biblatex/tex/latex/biblatex/biblatex.def Line 568 in 2ddd283
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear, backend=biber]{biblatex}
\addbibresource{biblatex-examples.bib}
\DeclareFieldFormat{url}{\mkbibacro{URL}\addcolon\space\ttfamily \textbackslash url\{\url{#1}\}}
\begin{document}
\cite{markey}
\printbibliography
\end{document} |
Thank you very much for pointing out to \renewcommand*{\nolinkurl}[1]{\textbackslash nolinkurl \{##1\}}%
\renewcommand*{\url}[1]{\textbackslash url \{##1\}}%
\renewcommand*{\href}[2]{\textbackslash href \{##1\} \{##2\}}% The only problem is that the rows are too long and thus not copyable... |
If URLs are typeset as normal text, TeX will have a hard time figuring out where to break/hyphenate them. That's why in my solution I tried to still use \let\blxiibitm@nolinkurl\nolinkurl
\renewcommand*{\nolinkurl}[1]{\textbackslash nolinkurl\{\blxiibitm@nolinkurl{#1}\}}
\renewcommand*{\url}[1]{\textbackslash url\{\blxiibitm@nolinkurl{#1}\}} can help. |
Just for the record, and with no expectation of reviving this issue, I wanted to add another niche use case to this conversation. As a style author looking to replicate a particular specification, I have a sets of tests consisting of a manually formatted reference and the automated output from LaTeX. Up till now, I have been comparing them by eye, and not always accurately. Having found a way to automate the comparison process with a CSL style I maintain, I have been looking at how I could to the same with LaTeX. With BibTeX it turned out to be relatively straightforward to post-process the .bbl file, but I struggled with how to get the biblatex output into a form I could use. Then just recently I stumbled on this thread and found that the output from biblatex2bibitem worked the best of the options I tried. It would be preferable to get the output as plain text to avoid artefacts from the PDF (such as blank lines from page breaks and truncated unbreakable strings) but these things can be worked around. As I say, I have no expectation of any action, but I wanted to point out there is another use for this sort of output. If there are other ways of programmatically testing the output of biblatex I've missed (which is quite likely) I would be interested to hear about them. |
If you have the typeset LaTeX "target" ready (e.g. because you know that the output currently produced by the style is correct), you can use The downside to |
|
For an example of this I've started using this for the next version of |
I'm going to stick with the I have working solutions set up such that a Python script compares the output against the target text in the documentation for me:
But it is very helpful to have examples of the |
Biblatex is great, but unfortunately I sometimes submit papers to IEEE journals that require using BibTeX with IEEEtran.bst or pasting
\bibitem
s into athebibliography
environment. The latter could be a shortcut to using Biblatex instead - if only I could make Biblatex generate\bibitem
s. Could this be possible?The text was updated successfully, but these errors were encountered: