hesco has asked for the wisdom of the Perl Monks concerning the following question:
The perl side of this is working fine for me (from almost the first moment I drafted it), but getting the LaTeX part of this right has been a hair pulling experience. perldoc makes sense to me in ways that spending the day reading LaTeX artciles has not.
I have two, perhaps three issues at this point:
(1) Making my letterhead render with the logo in the top left corner (even inside the generous margins LaTeX offers by default), with the copy from the letterhead centered in a box to its right, all above the horizontal line offered by the letterhead.tex template;
(2) sorting out where the \begin and \end{document} commands ought to go given that I have one .tex file seeking to include another .tex file; and
(3) figuring out how to make that indentation work for all the lines related to the pollwatcher which are pulled from the data.
My letterhead.tex file:
and my pollwatcher_408b1.tmpl file:\documentclass{article} \usepackage{fancyhdr} \usepackage[letterpaper]{geometry} \usepackage[pdftex]{graphicx} \pagestyle{fancy} \addtolength{\headheight}{0.25in} \begin{document} \fancyheadoffset[L]{10pt} \fancyhead[L]{\includegraphics{ggp_logo_100px}}% \begin{minipage}[t]{5in} \setlength\oddsidemargin{2in} \begin{center} \Large\textbf{The Georgia Green Party} \\ \normalsize {P.O. Box 450012; Atlanta GA 31145 \\ 404-574-3471 * ggp@greens.org \\ \underline{http://www.greens.org/georgia/}} \bigskip \small\emph{Ecological Wisdom * Grassroots Democracy * Social Justice +* Peace and Nonviolence \\ Decentralisation * Community-Based Economics * Feminism * Respect for +Diversity \\ Personal and Global Responsibility * Future Focus on Sustainability } \end{center} \end{minipage} \end{document}
And the trivial test script that is supposed to put it altogether (merging data from database awaits a working test of what is shown above), called: create_pollwatcher_letter.pl\documentclass{article} % \include{letterhead} \begin{document} {The Superintendent of Elections \\ for [% County_Name %] County Georgia \\ [% County_Addr1 %] \\ [% County_Addr2 %] \\ [% County_city_st_zip %] \\ [% date %] \\ The undersigned, Chairperson(s) and Secretary of the Georgia Green Par +ty, pursuant to our authority under the Georgia Election Code, [% co +de_authority %], designate the below individual as a poll watcher for + the [% Election_Date_and_Type %] and assign them to observe operatio +ns at [% Precinct_Name %]; [%Precinct_Address %]. \\ \setlength\parindent{4em} [% Poll_Watcher %] \\ \setlength\parindent{4em} Birthday: [% Poll_Watcher_Birthdate %] \\ \setlength\parindent{4em} [% Poll_Watcher_Addr1 %]; [% Poll_Watcher_city_st_zip %] \\ \setlength\parindent{0em} We are yours for a just and sustainable future, \\ Thano Paris, Co-Chair \\ Harry Rezzemini, Secretary \\ \end{document}
Any and all advise is appreciated. Thanks,#!/usr/bin/perl -w use strict; use warnings; use Template; use Template::Plugin::Latex; my $cfg = { INCLUDE_PATH => '/home/hesco/GP/GGP/PollWatchers/Templates' }; my $template = Template->new($cfg); my $vars = { County_Name => 'Camden County', County_Addr1 => '208 East 4th Street', County_Addr2 => 'P.O. Box 608', County_city_st_zip => 'Woodbine GA 31569-0608', date => 'Monday, October 27th, 2008', code_authority => '21-2-408(b)(1)', Election_Date_and_Type => 'November 4th, 2008 General Election', Precinct_Name => 'Woodbine City Hall 03 Precinct', Precinct_Address => '310 Bedell Avenue; Woodbine GA 31569' +, County => 'Camden', Poll_Watcher => 'Jane Citizen', Poll_Watcher_Birthdate => 'January 31, 1956', Poll_Watcher_Addr1 => '197 Some Drive', Poll_Watcher_city_st_zip => 'Brunswick GA 31525', }; my $input = 'pollwatcher_408b1.tmpl'; my $output = 'test'; $template->process($input,$vars,"$output.tex", binmode => 1) || die $t +emplate->error(); # my $result = `latex "$output.tex"`; # $result = `dvips "$output.dvi"`; # $result = `ps2pdf "$output.ps"`; 1;
-- Hugh
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: OFF-TOPIC: Seeking LaTeX advice, please
by kvale (Monsignor) on Oct 28, 2008 at 00:41 UTC | |
|
Re: OFF-TOPIC: Seeking LaTeX advice, please
by CountZero (Bishop) on Oct 28, 2008 at 06:36 UTC | |
|
Re: OFF-TOPIC: Seeking LaTeX advice, please
by moritz (Cardinal) on Oct 28, 2008 at 06:37 UTC |