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.

closed as too broad by Joseph Wright Mar 8 '15 at 17:58

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    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
  • 2
    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
  • As it stands this feels rather broad to me. – Joseph Wright Mar 8 '15 at 17:59