General ⇒ Changing the output file name
Changing the output file name
I'm making an exam with the exam class, and have it set up to make two version by just changing one line, one with answers, and one without answers. However, it's sort of a pain right now since they both write to the same file name, so I have to do one, then rename the file by hand then make the next one. It would be very convenient if there was a way to automate this (the exam class has a nice conditional command for when answers are printed that I could use if there was a rename output command).
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Changing the output file name
Code: Select all
pdflatex -job-name=name
I'm not familiar with LEd. Perhaps it offers to create an own build profile similar to TeXnicCenter.
[1] pdftex
Best regards
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Changing the output file name
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Changing the output file name
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Changing the output file name
If you don't like the command line approach, you can use the very first line of your master document to pass additional switches to latex:dmt wrote:I just press a button on LEd to generate the pdf ... I don't deal with command lines at all. If that is the only way to do it then it is probably easier to just keep renaming the file.
Code: Select all
%& -job-name=somename
Tomek
Re: Changing the output file name
If I put an extra % in front of the that line will it be ignored?
Changing the output file name
Code: Select all
%&
Can you post some code (like minimal example)? I don't see why this would be a problem.dmt wrote:The problem is if I have to put that in the first line I don't have access to the conditional statement from the exam class.
Cheers,
Tomek
Re: Changing the output file name
---
Yeah, it didn't work .... doesn't matter so much it's not a big deal to just comment or uncomment the first two lines depending on which version I'm running. Thanks.
Re: Changing the output file name
Cheers,
Tomek