Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this questionWe 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开发者_StackOverflow中文版 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.
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.)
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.
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.
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.
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.
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.
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 & 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.
精彩评论