<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.eprints.org/w/index.php?action=history&amp;feed=atom&amp;title=Files%2FCoverpage_%2F_CoverLatex_plugins</id>
	<title>Files/Coverpage / CoverLatex plugins - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.eprints.org/w/index.php?action=history&amp;feed=atom&amp;title=Files%2FCoverpage_%2F_CoverLatex_plugins"/>
	<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Files/Coverpage_/_CoverLatex_plugins&amp;action=history"/>
	<updated>2026-05-06T02:16:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.8</generator>
	<entry>
		<id>https://wiki.eprints.org/w/index.php?title=Files/Coverpage_/_CoverLatex_plugins&amp;diff=9521&amp;oldid=prev</id>
		<title>Leo@strike.wu.ac.at: Created page with '== Coverpage / CoverLatex plugins ==  This is a plugin that prepends coverpages to documents. It uses a convert plugin to generate the actual pages.  The shipped implementation (…'</title>
		<link rel="alternate" type="text/html" href="https://wiki.eprints.org/w/index.php?title=Files/Coverpage_/_CoverLatex_plugins&amp;diff=9521&amp;oldid=prev"/>
		<updated>2010-09-29T11:52:42Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;== Coverpage / CoverLatex plugins ==  This is a plugin that prepends coverpages to documents. It uses a convert plugin to generate the actual pages.  The shipped implementation (…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Coverpage / CoverLatex plugins ==&lt;br /&gt;
&lt;br /&gt;
This is a plugin that prepends coverpages to documents. It uses a&lt;br /&gt;
convert plugin to generate the actual pages.&lt;br /&gt;
&lt;br /&gt;
The shipped implementation (&amp;lt;tt&amp;gt;CoverLatex&amp;lt;/tt&amp;gt;) uses a citation XML template&lt;br /&gt;
to generate LaTeX source, compiles that into a PDF coverpage and&lt;br /&gt;
prepends it using &amp;lt;tt&amp;gt;pdftk&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Coverpage versions of the documents are updated and saved when&lt;br /&gt;
documents are requested: The plugin uses the new&lt;br /&gt;
&amp;lt;tt&amp;gt;EP_TRIGGER_DOC_URL_REWRITE&amp;lt;/tt&amp;gt; trigger introduced in EPrints&lt;br /&gt;
3.2.1. Coverpage documents are refreshed when the corresponding&lt;br /&gt;
document or when the associated eprint metadata changes.&lt;br /&gt;
&lt;br /&gt;
The plugin also integrates into the upload workflow: If a PDF is&lt;br /&gt;
encrypted and thus prepending a coverpage isn't possible, a warning is&lt;br /&gt;
printed. Besides the &amp;quot;coverpage&amp;quot; metafield of the document is set to&lt;br /&gt;
&amp;lt;tt&amp;gt;FALSE&amp;lt;/tt&amp;gt; to indicate that future attempts to generate a coverpage are&lt;br /&gt;
unnecessary.&lt;br /&gt;
&lt;br /&gt;
It uses document relations (&amp;lt;tt&amp;gt;isCoverPageVersionOf&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;hasCoverPageVersion&amp;lt;/tt&amp;gt;)&lt;br /&gt;
to connect the original document to its coverpage version.  Discovery&lt;br /&gt;
of an appropriate conversion plugin is done via the &amp;quot;&amp;lt;tt&amp;gt;can_convert&amp;lt;/tt&amp;gt;&amp;quot;&lt;br /&gt;
method of the Convert module.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* unpack the [http://files.eprints.org/588 extension package] in your archive directory (&amp;lt;tt&amp;gt;/opt/eprint3/archives/ARCHIVE_ID/&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
* edit &amp;lt;tt&amp;gt;cfg/cfg.d/coverpage.pl&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* edit the citation file &amp;lt;tt&amp;gt;cfg/citations/eprint/coverpage_latex.xml&amp;lt;/tt&amp;gt; and the corresponding phrases &amp;lt;tt&amp;gt;cfg/lang/en/phrases/coverpage.xml&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* add a coverpage field to &amp;lt;tt&amp;gt;cfg/cfg.d/document_fields.pl&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$c-&amp;gt;{fields}-&amp;gt;{document} = [&lt;br /&gt;
        {&lt;br /&gt;
                name =&amp;gt; &amp;quot;coverpage&amp;quot;,&lt;br /&gt;
                type =&amp;gt; &amp;quot;boolean&amp;quot;,&lt;br /&gt;
                input_style =&amp;gt; 'radio',&lt;br /&gt;
        },&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* run&lt;br /&gt;
   &amp;lt;tt&amp;gt;epadmin update_database_structure ''archiveid''&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* add the coverpage field to &amp;lt;tt&amp;gt;cfg/workflows/eprint/default.xml&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;component type=&amp;quot;Documents&amp;quot;&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
      &amp;lt;field ref=&amp;quot;coverpage&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/component&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* add the following code to &amp;lt;tt&amp;gt;validate_document()&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;cfg/cfg.d/document_validate.pl&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        my $cp = $session-&amp;gt;plugin('Coverpage');&lt;br /&gt;
        if ($cp) {&lt;br /&gt;
          my $cp_switch = $document-&amp;gt;get_value('coverpage') || '';&lt;br /&gt;
          if ($cp_switch ne 'FALSE') {&lt;br /&gt;
            my $conv_plugin = $cp-&amp;gt;get_conversion_plugin($document);&lt;br /&gt;
            if ($conv_plugin) {&lt;br /&gt;
              my @conv_problems = $conv_plugin-&amp;gt;validate($document);&lt;br /&gt;
              if (@conv_problems) {&lt;br /&gt;
                # pdf is encrypted&lt;br /&gt;
                push @problems, @conv_problems;&lt;br /&gt;
                $session-&amp;gt;log(&amp;quot;coverpage conversion problems, setting coverpage to false&amp;quot;);&lt;br /&gt;
                $document-&amp;gt;set_value('coverpage', 'FALSE');&lt;br /&gt;
                $document-&amp;gt;commit;&lt;br /&gt;
              }&lt;br /&gt;
            } else {&lt;br /&gt;
              # doc type not supported&lt;br /&gt;
            }&lt;br /&gt;
          } else {&lt;br /&gt;
            # coverpage disabled&lt;br /&gt;
            $cp-&amp;gt;remove_coverpage($document);&lt;br /&gt;
            my $fieldname = $session-&amp;gt;make_element( &amp;quot;span&amp;quot;, class=&amp;gt;&amp;quot;ep_problem_field:documents&amp;quot; );&lt;br /&gt;
            push @problems, $session-&amp;gt;html_phrase('validate:coverpage_disabled',&lt;br /&gt;
                                                  fieldname =&amp;gt; $fieldname);&lt;br /&gt;
          }&lt;br /&gt;
        }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Leo@strike.wu.ac.at</name></author>
		
	</entry>
</feed>