I work as a statistican for a high school. One of my responsibilities is to generate performance reports for every teacher in the school, based on how well students evaluate them. I use LaTeX to generate the reports. There are 31 teachers in this high school, and for each of them the report is exactly the same except for two things:

1) Their names, and 2) their personal results.

As one can imagine, going through 31 LaTeX files and manually substituting names throughout 5 page documents is annoying, boring, and time-consuming. SO what I'm really looking for is a LaTeX "function" that does step 1 for me. Sort of like a macro.

Something that looks like this


And then the names would be substituted throughout the entire document. So I'd do this 31 times, generate 31 LaTeX code files corresponding to 31 teachers, and then only substitute each teacher's personal results

  • 3
    Hello, welcome to TeX.SE. How to do that highly depends on the format of your input data. If this format is CSV, the datatool package can help. – frougon May 9 '19 at 15:44
  • 2
    Welcome to TeX.SX! This is certainly possible but without more detail about these reports there is no way that we can help you. Can you give a minimal working example that shows a mock report and some idea of what the results look like and what you want done with them. It should be possible to make latex automatically generate all reports from the data but to say how we need some idea of what you want to do. – Andrew May 9 '19 at 15:44
  • 2
    If you just want a macro for the names then you could use something like \newcommand\name{Victor S.} in the preamble and then \name in the report. – Andrew May 9 '19 at 15:53
  • 1
    See tex.stackexchange.com/questions/344345/datatool-and-longtable for a simple example of datatool. – Marijn May 9 '19 at 15:55
  • 4
    I'm voting to close this question as off-topic because OP found out the solution by himself (with no further comments). – Phelype Oleinik Sep 25 '19 at 3:01

Browse other questions tagged or ask your own question.