0

I have a complex .tex file that I use as template for a particular type of document we use. Within the preamble, I define a variable for the name of the final document using something like the following:

\usepackage{mVersion}
\setVersion{1.0.5}
\increaseBuild
\renewcommand{\version}{v\versionnumber (\thebuildcounter)}
\newcommand{\FileName}{Some\_File\_Name\_\version.pdf}

This \FileName variable is used within the header of the document to list the expected name of the final pdf, which in this example would be Some_File_Name_v1.0.5(12345), assuming that the build number is 12345.

What I would like to do is to use this string to dynamically set the actual output file name as well. I can partly control the output name simply by naming the .tex to Some_File_Name.tex, but this doesn't append the version number, and I have to go back after the build completes and add the version and build numbers in windows.

Is it possible to configure TeXMaker to do this renaming for me automatically? My quick build command for these files is currently set to "PdfLaTeX + Bib(la)tex + PdfLaTeX (x2) + View Pdf" in the TeXMaker configuration window.

I'm ok with using a custom build command if necessary, as long as I don't have to do anything manually in the terminal. I have coworkers who need to build these documents on occasion, and I don't want them to have to muck with the command line, but I can set them up with a custom quick build command.

4
  • 1
    Possibly related question: tex.stackexchange.com/q/19182/237192 Feb 23, 2023 at 18:23
  • 1
    You can do this fairly easily with arara.
    – Alan Munn
    Feb 23, 2023 at 18:42
  • @Οὖτις I did see that question when I was first looking into this. It seems that there's no functionality built into (PDF)LaTeX itself. However some of the results I found did indicate that some editors have the ability to do it. I haven't been able to find any explicit examples with TeXMaker yet though, hence this post. Thank you for linking that question though, as it may be helpful for someone else.
    – PTTHomps
    Feb 28, 2023 at 17:00
  • @AlanMunn thanks for this. I'll check out arara and see if it's what I'm looking for.
    – PTTHomps
    Feb 28, 2023 at 17:01

0

You must log in to answer this question.

Browse other questions tagged .