I have calibration data in excel format, and I need to produce calibration certificates from it. Currently, we just use a separate sheet in the excel file to pull values from the data sheet and then pretty it up and export to pdf. This is janky and prone to failure because excel, so I would like to find a better way.

Tools I have available:

  • TeXMaker and TeXLive
  • Anaconda Python distribution
  • Excel (obviously)
  • VisualStudio with C/C++

What I'd like to do is create a template in LaTeX, then pull data from the excel or csv file to fill it in. The twist is that I may need multiple sections, so I can't just copy and paste. For example, for a current meter, it is calibrated both in AC mode over one range, and in DC mode over another range. Conversely, a temperature sensor would have just one range over which it's calibrated. The data I need to display on the certificate, for each range, includes reference datapoints (known values), measured datapoints (values the instrument displays for each respective reference point), and the results of statistical calculations on those data.

So my thought is use Python to pull the data from the xlsx and output a .tex file. However, most of my team doesn't know python or LaTeX, so I'm hesitant to do that. I suppose I could build a standalone python app that would handle the creation of the .tex, but that still leaves the compilation of the document (and hence a local install of latex, since we can't use cloud based tools because reasons). What other toolchains could be used for this? How can users be insulated from the document compilation process?

  • 1
    Why can't the Python script just call latex as an external command on the .tex it generates? Yes, they'd need to have a TeX installation, but since you can't use cloud based tools, the only other alternative is just not to use LaTeX, isn't it? They wouldn't have to know how to use it. If you do decide against LaTeX, and know any html/css, the weasyprint library for Python is decent at making PDFs from that.
    – frabjous
    Commented Jul 7, 2022 at 17:05
  • Please give a complicated enough example of both Excel-structure, data, and desired prettified output. Please add to your question, e.g. as screenshots. // I have a generic solution in mind, but it depends on your data and reporting situation.
    – MS-SPO
    Commented Jul 7, 2022 at 18:40
  • You can compile a .tex file from a command line or terminal. So you can start this e.g. from a python script, too.
    – MS-SPO
    Commented Jul 7, 2022 at 19:49
  • @MS-SPO The data structure is just a few tables, and the end format of the certificate is somewhat arbitrary. The one specific I have in mind is to use a \section{} for each range, and inside of that there will be a table with the reference and measured datapoints side by side (ten rows), and a second table with the statistics and a PASS/FAIL field.
    – PTTHomps
    Commented Jul 7, 2022 at 19:50
  • Ok, we are on the road to chit-chat, which we try to avoid here. The better alternative is to post a relevant example. I‘d approach your problem like this. 1. have a few, at least one, set of data (types of instr.). 2. Manually create a .tex which present results nicely. 3. Separate constant (latex snippets) from variable (data varying with calibrations). 4. Code it.
    – MS-SPO
    Commented Jul 7, 2022 at 19:56


You must log in to answer this question.

Browse other questions tagged .