I have already seen Can one TeX file output to multiple PDF files?, and I'm aware this is likely to require "external" scripting - but I just wanted to see if anyone has a straightforward approach.
With the MWE posted below, I'm trying to create an "article card" - for each of the given citations sourced from a bibliography, generate a page with the given citation, and all of the author names - one author name per line. This works fine as far as Latex to PDF is concerned; and the output is something like this (click for full res):
Now this is what I want to do - I want each of these pages as a .odt Open Document, with the same name as the citation; that is, instead of the single PDF with 4 pages -- I'd want 4 ODT documents, named according to the respective citation key, that is: aksin.odt
, cotton.odt
, herrmann.odt
, murray.odt
, for each page respectively.
I have seen How to convert .tex into .odt? - Ask Ubuntu, and the suggestions there - but I'm not really sure, if it would be possible e.g. to call latex test.tex
+ biber test
once, and then do one (or multiple) calls to, say mk4ht oolatex test.tex
which would generate the per-page .odt files.
Any ideas/pointers about the most straightforward way to achieve this?
The test.tex
code:
\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{times}
\usepackage[top=3cm,bottom=3cm,left=2cm,right=2cm,showframe]{geometry}
\usepackage{pgffor}
\usepackage[firstinits=true]{biblatex}
\bibliography{biblatex-examples}
% based on {name:delim}, biblatex.def
% use newline as delimiter (not \par, as it indents)
\newbibmacro*{name:delimline}[1]{%
\ifnumgreater{\value{listcount}}{\value{liststart}}
{\ifboolexpr{
test {\ifnumless{\value{listcount}}{\value{liststop}}}
or
test \ifmorenames
}
{\newline}%{\multinamedelim}
{\newline}}%{\lbx@finalnamedelim{#1}}}
{}}
% based on {name:first-last}, biblatex.def
% simply uses the above line as delimiter
\newbibmacro*{name:first-lastline}[4]{%
\usebibmacro{name:delimline}{#2#3#1}%
\usebibmacro{name:hook}{#2#3#1}%
\ifblank{#2}{}{\mkbibnamefirst{#2}\isdot\bibnamedelimd}%
\ifblank{#3}{}{%
\mkbibnameprefix{#3}\isdot
\ifpunctmark{'}
{}
{\ifuseprefix{\bibnamedelimc}{\bibnamedelimd}}}%
\mkbibnamelast{#1}\isdot
\ifblank{#4}{}{\bibnamedelimd\mkbibnameaffix{#4}\isdot}}
% based on [labelname], biblatex.def
\DeclareNameFormat{labelnameallline}{%
% \ifcase\value{uniquename}%
% \usebibmacro{name:last}{#1}{#3}{#5}{#7}%
% \or
% \ifuseprefix
% {\usebibmacro{name:first-lastline}{#1}{#4}{#5}{#8}}% w/ firstinits
% {\usebibmacro{name:first-lastline}{#1}{#4}{#6}{#8}}% w/ firstinits
% \or
\usebibmacro{name:first-lastline}{#1}{#3}{#5}{#7}% % without firstinits!
% \fi
% %\usebibmacro{name:andothers}% output all explicitly
}
% \setkeys{blx@opt@pre}{firstinits=false}%
% \csname KV@blx@opt@pre@firstinits\endcsname -> \settoggle {blx@firstinits}{#1}
\DeclareCiteCommand{\citeallnamesline}
{\usebibmacro{prenote}}
%{\printnames[first-last]{labelnameallline}}
{%
\makeatletter%
% NO spaces here in iftoggle, or before endcsname!
\typeout{IT IS: \expandafter\meaning\csname KV@blx@opt@pre@firstinits\endcsname}%
\iftoggle{blx@firstinits}{\typeout{true}}{\typeout{false}}%
%\setkeys{blx@opt@pre}{firstinits=false}% no influence here, if it is false already; but doesn't matter, because NameFormat labelnameallline now explicitly uses full names
\makeatother%
% print all names w/ \thelisttotal, regardless of other settings
\printnames[labelnameallline][-\thelisttotal]{author}%
}
{}%\multicitedelim}
{\usebibmacro{postnote}}
\def\pageTemplate#1{%
\section*{\centering Article Card}
\bigskip
\noindent The paper is:
\bigskip
\fullcite{#1}
\bigskip
\noindent The authors are:
\bigskip
\noindent%
%\citeauthor{#1}
\citeallnamesline{#1}
\clearpage
}
\begin{document}
\foreach\x in {aksin,cotton,herrmann,murray}{
\pageTemplate{\x}
}
\end{document}