CountZero:

Thank you kindly. That is exactly what was needed to move me off of stuck. I just deployed the app tonight. I believe it to be doing the trick as I write, based on feedback from three testers (including myself).

And the working code looks like this:

$self->{'tt'} = Template->new({ INCLUDE_PATH => $self->{'cfg'}->param("pdf.include_path"), OUTPUT_PATH => $self->{'cfg'}->param("pdf.tmp_path") }); $self->{'tt'}->process($template,{ field => $field },$self->{'pdf_ou +tput'} . '.tex',binmode => 1) || die $self->{'tt'}->error(); my $cwd = cwd(); chdir $self->{'cfg'}->param("pdf.tmp_path"); $ENV{'USER'} = $self->{'cfg'}->param("pdf.user"); $ENV{'HOME'} = $self->{'cfg'}->param("pdf.home"); `latexmk -pdf $tmp_file.tex`; chdir $cwd; rename "$tmp_file.pdf", $file; unlink <$tmp_file.*>; $self->{'pdf_output_file'} = $file; $self->{'pdf_output_file_name'} = $self->{'pdf_output'} . '.pdf';
As I see this posted, it seems I ought to refactor some of my config paramters which no longer point to pdf files but now to tex files. But other than that, your solution moved me forward in rather quick style.

This is meeting all of my requirements, with respect to filing the resulting file appropriately and avoiding the risk of race conditions which would corrupt our archives. I have control over what to name the files.

So far, the only complaint I've had about latexmk is how noisy it has been when I'm running my test suite. I'll have to review the --help on that script again. I'll bet their is a switch to quiet it down. But it was an easy install. I would be more comfortable calling methods somehow, for some reason using backticks other than in a quick throw-away script makes me nervous. But I have no idea if there is any reason for that.

With this trick, the only thing holding me back now is my rudimentary latex skills.

But I'd guess this will give me more reason to practice with that.

Thanks again for the lead.

-- Hugh

if( $lal && $lol ) { $life++; }
if( $insurance->rationing() ) { $people->die(); }

In reply to Re^2: Template::Latex Frustrations . . . by hesco
in thread Template::Latex Frustrations . . . by hesco

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.