0

We have this latex file which we change frequently. What we usually do is:

  • go to line 51 and replace bio 101 with bio 102

  • go to line 103 and replace midterm with final

  • go to line 184 and replace summer 2016 with fall 2016

and etc. So, I was wondering, instead of doing that, is it possible to make an .exe file (possibly in c) asking:

  • Class?
  • Press M for midterm, F for final.
  • Year?
  • Semester? Press 1 for fall, 2 for spring, 3 for summer.

then creating a pdf output.

1 Answers1

2

You don't need an .exe or some external processor, latex can also run interactively.

But I would simply put a \newcommand\class{bio 102} in the preamble, and use \class in the document and so on. Then all changes can be done in the preamble.

Ulrike Fischer
  • 327,261
  • a related approach, requiring some rewriting now, is to remove the \documentclass line, place it in a separate file, add the \class (and related) definition(s), followed by an \input of the file with the text. then only the small "driver" file needs to be touched unless there's a real change to the main text. – barbara beeton Aug 08 '16 at 13:26
  • @barbarabeeton: I can think of many approaches, one can also put the data in some csv-file, or calculate it, or ... But as the question is quite vage, I don't intent to elaborate. I wouldn't have answered anyway if touhami hadn't pinged me. – Ulrike Fischer Aug 08 '16 at 13:30