# embedding self-describing bibtex in dvi or pdf

Mike Marchywka marchywka at hotmail.com
Tue Oct 29 13:23:14 CET 2019

On Tue, Oct 29, 2019 at 01:10:16PM +0100, Enrico Schumann wrote:
>
> Quoting Mike Marchywka <marchywka at hotmail.com>:
>
> > Do these or other formats support this ?
> > For the DVI I can make a special that could be discovered with a dvi
> > interpretter or just a dumb file reader if it is unique enough. PDF I know
> > has a lot of flexibility but not sure what exists for this or if there
> > already is a well known generally accepted approach to put in
> > machine readable citation info.
> >
> > I could imagine tex macro for self info fields but not sure I have ever
> > seen one.  pdfinfo comes close for pdf, I guess if you could add arbitrary
> > key-value pairs this would work . What existing tex would let me insert stuff
> > here to read later for bibtex extraction?
> >
> > pdfinfo cases.pdf
> > Title:
> > Subject:
> > Keywords:
> > Author:
> > Creator:        LaTeX with hyperref package
> > Producer:       pdfTeX-1.40.16
> > CreationDate:   Tue Oct 29 04:51:45 2019
> > ModDate:        Tue Oct 29 04:51:45 2019
> > Tagged:         no
> > UserProperties: no
> > Suspects:       no
> > Form:           none
> > JavaScript:     no
> > Pages:          738
> > Encrypted:      no
> > Page size:      612 x 792 pts (letter)
> > Page rot:       0
> > File size:      10873604 bytes
> > Optimized:      no
> >
> >
> > Thanks.
> >
> > --
> >
> > mike marchywka
> > 306 charles cox
> > canton GA 30115
> > USA, Earth
> > marchywka at hotmail.com
> > 404-788-1216
> > ORCID: 0000-0001-9237-455X
>
> Package 'hyperref' allows you to write user-defined key-value pairs
> into a PDF:
>
>   \documentclass{article}
>   \usepackage{hyperref}
>   \hypersetup{
>     pdfinfo={
>       x-bib-author  = {A. Writer},
>       x-bib-journal = {Test}
>     }
>   }
>   \begin{document}
>   Test
>   \end{document}
>
> I am not sure, however, if pdfinfo can extract them.

I thought there may be a verbose option or something to pickup everything
but did not find it, although see below the info is in the file if I can
parse it without a lot of effort ( I put "od" into a script for ease of use ),

pdfinfo schumann.pdf
Title:
Subject:
Keywords:
Author:
Creator:        LaTeX with hyperref package
Producer:       pdfTeX-1.40.16
CreationDate:   Tue Oct 29 08:18:25 2019
ModDate:        Tue Oct 29 08:18:25 2019
Tagged:         no
UserProperties: no
Suspects:       no
Form:           none
JavaScript:     no
Pages:          1
Encrypted:      no
Page size:      612 x 792 pts (letter)
Page rot:       0
File size:      10903 bytes
Optimized:      no
marchywka at happy:/home/documents/latex/proj/allbib$cat schumann.tex \documentclass{article} \usepackage{hyperref} \hypersetup{ pdfinfo={ x-bib-author = {A. Writer}, x-bib-journal = {Test} x-bib-buy-url = {https://buyexpensivejunk} } } \begin{document} test \end{document} marchywka at happy:/home/documents/latex/proj/allbib$ myod schumann.pdf | grep -B 3 -A 3 bib
002530 28 70 64 66 54 65 58 2d 31 2e 34 30 2e 31 36 29  >(pdfTeX-1.40.16)<
002540 2f 4b 65 79 77 6f 72 64 73 28 29 2f 78 2d 62 69  >/Keywords()/x-bi<
002550 62 2d 61 75 74 68 6f 72 28 41 2e 20 57 72 69 74  >b-author(A. Writ<
002560 65 72 29 2f 78 2d 62 69 62 2d 6a 6f 75 72 6e 61  >er)/x-bib-journa<
002570 6c 28 54 65 73 74 20 78 2d 62 69 62 2d 62 75 79  >l(Test x-bib-buy<
002580 2d 75 72 6c 3d 68 74 74 70 73 3a 2f 2f 62 75 79  >-url=https://buy<
002590 65 78 70 65 6e 73 69 76 65 6a 75 6e 6b 29 0a 2f  >expensivejunk)./<
0025a0 43 72 65 61 74 69 6f 6e 44 61 74 65 20 28 44 3a  >CreationDate (D:<
marchywka at happy:/home/documents/latex/proj/allbib\$

>
> --
> Enrico Schumann
> Lucerne, Switzerland
> http://enricoschumann.net
>

--

mike marchywka
306 charles cox
canton GA 30115
USA, Earth
marchywka at hotmail.com
404-788-1216
ORCID: 0000-0001-9237-455X