views:

144

answers:

7

We are looking for a good way to produce documents for print like the one below, which have content in them that is shared with other pages (the scanned document below is one page in a 102-page booklet). For example, the "Desired Outcome(s)" section is restated on several other pages. When we want to tweak or add to it, we currently have to locate all of the places where the text is, and then copy/paste among them. I'm sure I don't have to explain to you why this is problematic.

These pages are currently made in Adobe something-or-other and I'm not very fond of it, so I have happily been given the task to port them into something that avoids the manual copy-pasting.

Is this a job for LaTeX? I've only dabbled in it but if you think LaTeX is the right tool for this job then please point me in the right direction to start learning.

There's always any web language that reads from a database and outputs HTML (PHP and MySQL, for example; storing our shared text blocks in a MySQL database, or something similar), but I've had numerous problems in the past trying to format things for print; is there a good guide out there for making print-formatted HTML pages? I'm aware of the CSS media="print" property but that's about the extent of my knowledge in this area.


sample printed page

+1  A: 

ReportLab for Python is pretty nice.

The ReportLab Toolkit is the time-proven, ultra-robust open-source engine for programatically creating PDF documents and forms the foundation of RML; it also contains a library for creating platform-independent vector graphics. It's a fast, flexible, cross platform solution written in Python.

Sample output here.

Joe Koberg
A: 

iText is a PDF library for Java and I think C-sharp. It has a good reputation although I haven't used it in production myself. I have mocked up some demos with it and was quite happy.

Simon
Charles Stewart
A: 

You need to rephrase your question.

Reading the first part gives me the idea that your problem is with content generation and not consumption. Have you tried using templates (your use case seems to be a VDP case for me).

However, at the end, you talk about creating print material and the best choice of output is PostScript and/or if you can -- PDF. The CSS media=print is again something related on the output/consumption side.

dirkgently
I edited and tried to clarify the first paragraph. All of the content is already written, it's in a booklet, but we are looking to transfer it to a format more maintainable, in that our current maintenance involves copying and pasting changes and yes, we do need something that involves the use of variables aka VDP. We need whatever we use to output to something which we can print, don't care what; LaTeX can output to PDF, while a web language like PHP could read our variable text from a database and output as HTML. The file format doesn't matter, we are fine with hitting file -> print.
Ricket
IIRC, there is a VDP plugin for InD. Are you looking at a free alternative? IMHO, PDF is the best bet if you want a maintainable format. You'll have to look up a particular flavor of the PDF spec (such as PDF/A for archiving, PDF/VT etc) that suits your needs the best.
dirkgently
+1  A: 

If you are going for print, you should definitely use latex over html. html sounds like a nightmare for managing printed material.

I face the same situation at work: I have about 70 documents, and a lot of it is repeat material. I choose to split at the section level; that is, each \section{} in every document is its own .tex file. I will then "build" the documents from these files using the input command:

\input{documentname} (the input command doesn't take the file extension)

Now, when I need to update a piece of information, I update one file, then just re-compile all the effected documents. It's working rather well for me. The only problem I run across is locating which documents are effected by a file change, but this is much less of a problem that copy/pasting between a bunch of different files.

I try and keep my tex code as simple as possible. If for some reason I need to post things to the web, pandoc usually gets me 97%, if not 100%, of the way there, but I 95% of my stuff is print only. If you need to go to multiple publishing mediums (i.e. print, web, etc) you might consider a meta-format, such as markdown, multimarkdown, restructured text, or something similar. Wikipedia has a summary of such things here: http://en.wikipedia.org/wiki/Lightweight_markup_language. I find markdown the easiest to use, but it lacks support for tables and such, and I find that restructured text has the most features.

That being said, I am very happy using latex + pandoc. the results from latex are beautiful.

Mica
By HTML, I meant something like a PHP page that reads our shared text areas from a database or uses a template library like Smarty. Thanks for the LaTeX tips! We are looking for print-only at this time, so this does seem like a feasible solution. Will it be friendly to all of the tables and weird things like you see on the example page?
Ricket
Unfortunately I can't see the example page, I think it's been weeded out by the firewall. TeX will handle tables though, just fine.One more thing: If you do decide to use TeX, be it latex or context, be sure to use a version control system. I use git, but anything your comfortable with will do.
Mica
@Ricket: Putting together Latex that outputs exactly your input document will be really hard work.
Charles Stewart
A: 

LaTeX can do something like that. Which is not to say that it is necessarily the easiest way.

It is what I would use, because I've been using it for nearly two decades now.

If you are going to try latex, take note of the \input and \include macros, and be prepared to spend some time with CTAN finding the places where other people have already solved your problems.

dmckee
+5  A: 

If you consider something from the TEX area, I'd strongly suggest looking at ConTEXt, since it is much less aimed at scientific papers and much more at creating pretty free-form layout. As dmckee said, you could use LaTeX for that and if you have someone in-house who already has the required expertise, great. But if not, well, the number of books on LaTeX is way higher, but last time I looked, most of them did not really present any advice I'd be willing to follow. (I could do things like what you presented in LaTeX or ConTeXt, although it's been a while.)

Christopher Creutzig
I would advise something form the TeX area. As for the choice, all LaTeX alternatives have a smaller documentation base and a smaller community than LaTeX itself. This is really something to be considered if you're starting from scratch.
FX
+1: Context would be my recommendation. Note that Context is not pure Tex: it's basically a synthesis of Tex-based and Metapost-based page layout.
Charles Stewart
Hm. Their showcase PDF is pretty lame.... 2 pages, broken links.... No content...
Joe Koberg
@FX: I agree that there is way more LaTeX documentation than for anything else, but as I said, there is preciously little really good ones. Mittelbach/Goossens, Kohm, and Voß are the only ones I could recommend off the top of my head. Certainly not Kopka, although it's been very popular.@joe: The pdf showcase is a bit weird, I agree. There are probably computers where the links are working fine, I just don't happen to have one of them either. Starting from `http://pragma-ade.com/show-dem-1.htm` is probably going to work a lot better.
Christopher Creutzig
A: 

You could do it either way. In the past, I have had success with both HTML, LaTeX, Word and Excel documents.

Whichever you choose, you would need to create a template which you can fill in to accommodate changes in the presentation independently of the content.

Perl's HTML::Template would be helpful in filling in the blanks.

There is a primitive HTML example below. To do it right, read about paged media.

<!DOCTYPE HTML>
<html>
<head>
<title>Test</title>

<link id="screen-reset" rel="stylesheet" type="text/css"
href="http://yui.yahooapis.com/3.0.0/build/cssreset/reset-min.css"
media="screen">

<link id="print-reset" rel="stylesheet" type="text/css"
href="http://yui.yahooapis.com/3.0.0/build/cssreset/reset-min.css"
media="print">

<style type="text/css" media="print,screen">
    html { width:8.5in; font-size:16px; font-family:Arial; }
    body { margin: 0 auto; }
    @page {margin:1in }
    .page { page-break-after:always}
    .title { background: #911; height:1in; }
    .title h1 { 
        color:#fff; 
        background:transparent;
        display:inline-block;
        font-size:1.75em;
        font-weight:bold;
        height:1in; 
        line-height:0.5in;
        position:relative;
        top:0.125in;
        left:0.125in;
        text-decoration:underline;
        text-transform:uppercase;
        vertical-align:middle;
        width:75%;
    }

    .title h2 { 
        background:#fff;
        border:solid 1px #000;
        color:#000;
        font-size:0.75em;
        height:0.75in; 
        position:relative; top:0.125; left:0.125in; display:inline-block;
        text-align:center;
        vertical-align:middle;
        width:1in; 
    }

    .category {
        background:#bbb;
        color:#fff;
        font-size:1.25em;
        font-weight:bold;
        height:0.5in;
        padding:1%;
        width:98%;
        text-transform:uppercase;
    }


</style>

</head>
<body>
<div class="page">
<div class="title">
<h1>Job Instruction Breakdown Sheet</h1>
<h2>Revision Code</h2>
</div>

<h2 class="category">
13 - Attic Critical Detail: Flue, Combustion Vents &amp; Chimneys
</h2>
</div>

<div class="page">
<div class="title">
<h1>Some other Sheet</h1>
<h2>Revision Code</h2>
</div>

<h2 class="category">
14 - Other Details
</h2>
</div>

</body>
</html>

Use the print preview function of your browser (you might have to to settle on a specific browser to generate the output) and set "Print background images & colors" or whatever that option is called in your favorite browser.

Sinan Ünür
Ricket
Don't bother with that above link; it is a different HTML page now.
Ricket