problem with a variable in pdfinfo, probably something obvious

David Carlisle d.p.carlisle at gmail.com
Wed Jun 17 16:17:30 CEST 2020


It's a bit hard to follow your example fragments but most likely you need
something that expands to the value and latex \input is not expandable
You can probably use

\makeatletter
\mjmaddbib{pages}{ \@@input \mjmbasename.last_page }
\makeatother

to use the expandable primitive input  (note no {}) but depending on ...
things you may get an unwanted \par from the end of the file.




On Wed, 17 Jun 2020 at 15:07, Mike Marchywka <marchywka at hotmail.com> wrote:

> I'm trying to include bib info in the pdf file in a machine readable format
> and it mostly works. For example,
>
> ( my script that just wraps an call to exiftool or whatever it is called ),
>
> exifutil -list covid19.pdf | grep X-bib
> X-bib-title                     : On the age distribution of SARS-Cov-2
> Patients
> X-bib-author                    : Mike J Marchywka
> X-bib-type                      : TECHREPORT
> X-bib-name                      : marchywka-MJM-2020-002
> X-bib-number                    : MJM-2020-002
> X-bib-institution               : not institutionalized, independent
> X-bib-address                   :  306 Charles Cox , Canton GA 30115
> X-bib-date                      : June 17, 2020
> X-bib-version                   :  0.00 June 17, 2020 NOT public NOTES
> X-bib-day                       : 11
> X-bib-month                     : 05
> X-bib-year                      : 2020
> X-bib-author 1email             : marchywka at hotmail.com
> X-bib-contact                   : marchywka at hotmail.com
> X-bib-author 1id                : orcid.org/0000-0001-9237-455X
> X-bib-pages                     :  covid19.lastpage
> X-bib-filename                  : covid19
>
> Except you may notice that the X-bib-pages contains a thing that was
> supposed to evaluate.
>
> I use these definitions,
>
> \newcommand{\mjmaddbib}[2]{\hypersetup{ pdfinfo={ x-bib-#1 =
> {#2}}}\mjmsummabib{#1}{#2}}
> \newcommand{\mjmaddbibonly}[2]{\hypersetup{ pdfinfo={ x-bib-#1 = {#2}}}}
> \newcommand{\mjmaddbibe}[2]{\hypersetup{ pdfinfo= x-bib-#1 = #2}}
>
> And then in the text, the offending entry seems to ignore the "input"
> thing,
>
> \newcommand{\mjmemail}{marchywka at hotmail.com}
> \mjmaddbib{title}{\mjmtitle}
> \mjmaddbib{author}{\mjmauthor}
> \mjmaddbib{type}{TECHREPORT}
> \mjmaddbib{name}{marchywka-\mjmtrno}
> \mjmaddbib{number}{\mjmtrno}
> %\mjmaddbib{version}{\mjmversion}
> \mjmaddbib{institution}{not institutionalized, independent }
> \mjmaddbib{address}{ 306 Charles Cox , Canton GA 30115}
> \mjmaddbib{date}{\today}
> \mjmaddbib{version}{\mjmversion \today   \mjmstatus}
> \mjmaddbib{day}{\mjmbibday}
> \mjmaddbib{month}{\mjmbibmo}
> \mjmaddbib{year}{\mjmbibyear}
> \mjmaddbib{author1email}{\mjmemail}
> \mjmaddbib{contact}{\mjmemail}
> \mjmaddbib{author1id}{orcid.org/0000-0001-9237-455X}
> \mjmaddbib{pages}{ \input{\mjmbasename.last_page}}
> \mjmaddbib{filename}{\mjmbasename}
>
> I'm storing the last page in a file for several reasons but why is input
> ignored here?
>
> This gives the expected output,
>
> %   PAGES =         \{6\},
>   PAGES =         \{ \input{\mjmbasename.last_page} \},
>
>   CONTACT =       \{marchywka at hotmail.com\},
>
>
>
> Thanks.
>
> note new address
>  Mike Marchywka 306 Charles Cox Drive Canton, GA 30115
>  2295 Collinworth  Drive Marietta GA 30062.  formerly 487 Salem Woods
> Drive Marietta GA 30067 404-788-1216 (C)<- leave message 989-348-4796 (P)<-
> emergency
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/texhax/attachments/20200617/bcc36079/attachment.html>


More information about the texhax mailing list.