problem with a variable in pdfinfo, probably something obvious

Mike Marchywka marchywka at hotmail.com
Wed Jun 17 16:35:37 CEST 2020


On Wed, Jun 17, 2020 at 03:17:30PM +0100, David Carlisle wrote:
>    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.

Thanks, this works great,  although at first it was complaining
because it took spurious braces as part of file name : 


%   PAGES =         \{6\},
\makeatletter
  PAGES =         \{ \@@input \mjmbasename.last_page \},
  %PAGES =         \{ \@@input /home/documents/latex/proj/\mjmbasename/\mjmbasename.last_page \},
  %PAGES =         \{ \@@input{/home/documents/latex/proj/\mjmbasename/\mjmbasename.last_page}\},
\makeatother

and then in the pdf, 

YEAR = {2020},
AUTHOR1EMAIL = {marchywka at hotmail.com},
AUTHOR1ID = {orcid.org/0000-0001-9237-455X},
PAGES = { 28 },
CONTACT = {marchywka at hotmail.com},

> 
>    On Wed, 17 Jun 2020 at 15:07, Mike Marchywka <[mailto:marchywka at hotmail.com]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             : [mailto:marchywka at hotmail.com]marchywka at hotmail.com
>      X-bib-contact                   : [mailto:marchywka at hotmail.com]marchywka at hotmail.com
>      X-bib-author 1id                : [http://orcid.org/0000-0001-9237-455X]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{\[mailto:mjmemail%7D%7Bmarchywka at hotmail.com]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}{[http://orcid.org/0000-0001-9237-455X]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 =       \{[mailto:marchywka at hotmail.com]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

-- 

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


More information about the texhax mailing list.