Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am looking into the feasibility of using Latex to write reports. The reports which I generally write are quite repetitive and only really include small changes, such as an address, zone rules, predictions, etc.

What I was hoping to do was basically hoping to achieve is the ability to do something along the lines of defining a class (which has rather set wording and structure) and then input the necessary information such as address, etc. So I imagine it would looks something along the lines of...


\address(123 some st)



There would be a rather large number inputs, but the basic idea is the wording would be change within the template at the relevant places.... ie.

Text text text blah blah blah [address]. blah blah blah text [zone].

New section(thiszone)

if(thiszone) text text text, image, table, etc.

if(thatzone) text text text, image, etc.

Hopefully that makes sense, I am just having trouble finding a tutorial for achieving this, and I may be going down the wrong path in trying to define a class for this, rather than perhaps just utilising an existing class and creating functions with the required inputs?

Any help pointing me in the right direction would be much appreciated.

share|improve this question
If you've never designed a class before, it might be simpler to use an existing class and make a package instead, although you can also make a new class that loads an existing class. For a completely worked out example that is similar but not identical to what you might need, see Making a class to generate colored tables with a predefined layout. –  Alan Munn Jan 13 '14 at 1:09
Thanks a lot Alan, I believe this is right in line with what I am trying to achieve and should be a perfect starting point. –  Daniel Jan 13 '14 at 1:33
You could also consider merging a data file with a template. The template in this case is a standard (la)tex document which has code to merge in your data file. This is normally done when you want to create many versions of a document (e.g. a module assessment for every student in your class or a bunch of similar letters to different places). So you could even create multiple reports in a single run, if you wanted to. –  cfr Jan 13 '14 at 1:43
Are there any news here? Did you go with one of the solutions? Can you provide a self-answer? –  Johannes_B Feb 9 at 22:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.