Questions tagged [jobname]
This is the base name used by a TeX run to identify itself.
70
questions
5
votes
1
answer
160
views
Generate a pdf for each language
I have this document:
\documentclass{report}
\usepackage[english, spanish]{babel}
\begin{document}
\selectlanguage{english}
\section*{Hello, world!}
This is a document written in English.
\...
5
votes
1
answer
120
views
jobname, ifdefstring, IfSubStringInString, detokenize
My question is originally the same as
use jobname to "pass parameters"?
But that particular question doesn't seem to have a complete answer. (I'm sure that in the minds of experts who deeply ...
1
vote
1
answer
64
views
Magic comment root document \jobname
I want to use \jobname as input for a magic comment % !TeX root = \jobname.tex, but it doesn't work. There are two files, one *.tikz and one *.tex.
MWE Tex:
\documentclass{article}
\usepackage{tikz}
\...
3
votes
2
answers
567
views
Using \jobname in Overleaf to get the tex file name
I use Overleaf and the \jobname macro becomes useless because it always expands to "output". Is there any workaround?
1
vote
0
answers
98
views
Getting input filename in lualatex
As in title; I know status.filename gets the name of the exact file being currently compiled, but I want to know the one given as argument to lualatex. \jobname is also unhelpful because it may be ...
0
votes
1
answer
75
views
Externalise tikz figures and LaTeX output in different directories
I have the following tree:
.
├── main.tex
├── output
└── tikz
I would like to compile main.tex using output for LaTeX output, but having the tikz PDFs externalised in the tikz directory, which would ...
1
vote
1
answer
137
views
How to extract multiple information from the \jobname
I use one .tex file to create multiple CV depending on the \jobname.
For that I use the ifthen package and for each type of CV I create a Boolean value that I use to conditionally include some text.
...
0
votes
1
answer
67
views
tikzlibrary: external file names with spaces issue
Hello there
Currently trying to implement tikz's external library to a file named stack q.tex
MWE:
\newcommand\subfilename{"./stack q.tex"}
\documentclass{article}
% pgfplots
\usepackage{...
1
vote
1
answer
51
views
Why This Code Eliminating Index Commas Works for \jobname.mst and Not for \jobname.ist
This post is an addendum to How to Universally Remove the Comma from Each Index Entry.
In the link, I was looking for a universal way to remove the comma in each index entry.
Werner advised to include ...
1
vote
1
answer
428
views
TeX \ifx conditional not working for string comparison
I would like a LaTeX source file to compile in different ways depending on the job name. However, when I run pdflatex mwe with mwe.tex containing
\documentclass{article}
\begin{document}
\ifx{mwe}\...
0
votes
0
answers
176
views
Print file name of \include{} in the output
How to print file name that contains word in the \include{ABC-2100011} in the PDF output?
Print File name: \filename ---> Output should be Print File name: ABC-2100011
Please find MWE file as ...
0
votes
0
answers
41
views
How can I change PDF output name? [duplicate]
Question 1
How can we change the name of the generated pdf file, automatically on the main.tex file?
Question 2
Is it possible not to change the generated files each time I change this name?
5
votes
2
answers
3k
views
Overleaf dynamic PDF filenames
I have an Overleaf project that contains multiple .tex files to create different PDF documents.
If I compile one of the .tex files and download it, it is named after the Overleaf project.
Currently, ...
1
vote
1
answer
176
views
Conditional naming of the output PDF file
My target is to have an output Solved Exam.pdf when \ifSolution is true, and The Exam.pdf when \ifSolution is false.
However, I don't know if this answer is relevant here to change the \jobname and ...
1
vote
2
answers
301
views
Weird behavior of \jobname
Assume I have a file named G1 (SK).tex containing
\def\SK{SK}
\def\parse"#1 (#2)"{\def\language{#2}}
\expandafter\parse\jobname
\ifx\SK\language equal\else distinct\fi
\bye
When I run ...
1
vote
1
answer
265
views
Adding a macro to the -jobname section of the PDFLaTeX compiler (i.e., how to add dates to the PDF filename)
I would like to add a macro, and/or a user-defined command, to the "jobname" section of my compilation command. My ultimate goal is to add the current date (e.g., YYYY_MM_DD) to the PDF ...
0
votes
1
answer
301
views
How to get ride of the file extension in \currfilename
How to get ride of the file extension in \currfilename?
The \jobname would only give me the name without the .tex, which is fine. But that's not what I want if I am using \input or \include.
So \...
4
votes
1
answer
490
views
exam: Change the name of the output PDF file when answers option is enabled
If I have a document whose name is my exam.tex, is it possible to make its output PDF file have a name of my exam [solved].pdf by appending the word [solved] only when the answers class option is ...
1
vote
1
answer
72
views
Problem with testing suffix of \jobname, \c_sys_jobname_str
I have latex files with file names T-BA-DEC-de-0001_Title1.tex and T-BA-DEC-de-0002_Text2.tex. I would like to switch code depending on these file names. Up to now I tried to solve the problem using \...
7
votes
2
answers
360
views
Pulling numbers out of a file name
A long time ago, I wanted to solve the problem where I would typeset my homework assignments, but copy the file "hw1.tex" to make "hw2.tex", and forget to change the title "Homework 1" at the top of ...
4
votes
1
answer
331
views
`\jobname` doesn't handle underscores properly
In this thread, @DavidCarlisle asked for an example showing that \jobname doesn't handle underscores properly. Here's an example
\documentclass[11pt]{article}
\begin{document}
\begin{center}
\...
1
vote
0
answers
52
views
How to pass jobname info to `latexmk -C`? [duplicate]
I created a Makefile which uses latexmk.
Example main.tex:
\documentclass{article}
\begin{document}
Hello World!
\end{document}
Makefile:
FILE := FOOO
.PHONY: $(FILE).pdf
all: $(FILE).pdf
$(...
1
vote
1
answer
1k
views
How to write the filename on top left corner of the title page?
I tried the below-mentioned minimum working example. The difference from my earlier question on StackExchange (click here) is that we have now a title page.
How to write the document's filename on ...
5
votes
2
answers
1k
views
How to write the filename on top-left corner of each page of documentclass article
How to add the document's filename at the top left corner of each page in the following minimum working example:
\documentclass{article}
\begin{document}
% \markboth{\jobname}{\jobname}
Hello!...
4
votes
1
answer
523
views
Avoid quotation marks when using \jobname or \currfilename
When typesetting a file (using TeXworks on a Windows machine) which includes white spaces, then the jobname will contain the file name enclosed with double quotes. pdflatex Local\ Guide.tex will set ...
5
votes
1
answer
93
views
Using the document title to get the correct date
I create a lot of handouts and the like for my students using LaTeX. I find that I forget to update the date field, and so I often give out handouts with the incorrect date on the top. This is a bit ...
2
votes
0
answers
172
views
Specify output PDF based on latex condition
I am using the exam class and miktex for homework assignments. I regularly switch between "\noprintanswers", for the assignment, and "\printanswers", for the solution. I would love to be able to ...
2
votes
1
answer
358
views
MWEB: Doesn't recognise content of \jobname.bib [closed]
For another issue I have, I want to make a MWEB, but it (LaTeX/TexStudio) fails to recognise the content of the \jobname.bib. I need help to figure out, what is the problem. Here is my code for it:
%...
3
votes
1
answer
174
views
Is there a simple way to build two pdfs from the same tex file?
I'm trying to hack together a way to generate solutions files to my quizzes and exams. Here is my current workflow.
I have a file quiz.tex:
\documentclass[12pt]{article}
\newcommand{\solutionscolor}...
2
votes
1
answer
57
views
varsfromjobname isn't working in a test
I am trying to give a command depending on some information in the filename. So I use gettwofromjobname in a etoolbox-test in a file named test-a.tex, but it isn't giving me the true. Any idea why? ...
9
votes
6
answers
1k
views
How to replace characters from jobname?
I have a tex file with name Chap-Name_of_Section.tex and I running pdflatex on it. I want to set the title of my document automatically according to the file name. This could be done using \jobname.
...
5
votes
1
answer
1k
views
Add date in output name
pdflatex command allows to specify an output name through --job-name= option. But can't insert the date and time automatically.
Emacs could do it:
(compile-command "pdflatex --job-name=myoutputname....
3
votes
1
answer
236
views
Condition on whether filename belongs to a list of filenames
From this site, I've learned how to condition on the name of my latex file. This code below returns the first line of the conditional iff the file is called test.tex
\begin{document}
\...
1
vote
1
answer
721
views
Automatically escape special characters
I have a document where I would like to put the jobname into the footer with the \jobname macro. However, if my main file has underscores in its file name, the jobname cannot be printed properly due ...
3
votes
1
answer
269
views
Get `\jobname` with normal catcodes
I would like to create a macro \myjob that has the same value as \jobname, but with letters having catcode 11 instead of 12. The goal is to be able to do something like
\documentclass{article}
\edef\...
3
votes
2
answers
515
views
inside an \input file, how to determine the name "\input"ing file?
I have two tex files
% file1.tex (this is the inputing file)
\input file2
\bye
and
% file2.tex (this is the file input into file1.tex)
\printTheNameOfWhateverFileInputMe
What is working to show ...
3
votes
1
answer
150
views
File Name not exactly shown
MWE
\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{currfile}
\begin{document}
%File Name: ÖüğşiÇ.tex
\jobname
\...
6
votes
2
answers
2k
views
Defining the pdf output file within the document file using %& -job-name
My understanding is that if I create a file called noName.tex with the first line
%& -jobname=myName
then when I run pdflatex on that file, the output file will be named myName.pdf rather than ...
3
votes
3
answers
284
views
Generalized File Name Parsing
In Parse filename and extract revision from name, the OP wanted to parse a file name of the format cv3.01 to extract the revision number 3.01.
@egreg posted the following solution for a file name ...
4
votes
2
answers
7k
views
Latex (LyX) /pdftex - Change file name based on file content
When compile a LaTeX document with pdftex it usually has the name newfile.pdf. Is it possible to change the name of my document based on the content in the LaTeX source I'm about to compile ? More ...
1
vote
0
answers
171
views
Using external pdfviewer when the pdf name is changed using -job-name
I am using TexMaker and SumatraPDF for a viewer. Everything works fine. I then wanted to change the pdf name when compiling using the following command:
%& -job-name=SLR-Review
This placed on ...
2
votes
0
answers
208
views
Why can't I use \ifstrequal to check the \jobname? [duplicate]
I want to use the same source file to compile various target files using the -jobname option. I want to ensure that the option is not forgotten, so my approach was to check whether the \jobname is ...
13
votes
2
answers
2k
views
How can I check if the filename of a LaTeX document contains a string?
I am preparing a LaTeX beamer presentation for students. I am looking for a simple way to create two versions of my presentation.
One version for the Students, which just contains the text of the ...
13
votes
1
answer
248
views
Determine File Name and Line Number Where a Macro is Invoked From
Wondering if there is any way to print out (for debugging purposes) the file name and the line number from where a macro is invoked (not where it is defined). My attempt to use the currfile package ...
7
votes
1
answer
3k
views
Multiple PDF generation with one tex file
I'm writing my cv using moderncv, and I want to make it in 2 languages. I wrote a common part, which both languages will have, and specific ones, where I put the translated content. I also want to ...
3
votes
1
answer
660
views
How can i use eclipse to use the date and version in my output filename
This is less a direct LaTeX question than it is about compiling LaTeX.
I am using eclipse and in my project properties i set Output File = document.pdf . My demoproject compiles and outputs the File.
...
4
votes
1
answer
521
views
The attachfile2 package doesn't work when using \jobname
I'm using MiKTeX 2.9 on a Windows 7 Home Premium 64-bit computer.
I have been experimenting with using attachfile2 to make a link to an embedded LaTeX file. When I compile the following document, ...
4
votes
1
answer
386
views
Line-break \jobname
Imagine I have a file called
My_very_long_document_name_that_does_not_fit_in_the_left_footer.tex
Now I would like to include this long string in the left footer of my document. For this, I use \...
3
votes
1
answer
1k
views
-job-name and BibTeX do not work together?
I have a problem using the %& -job-name= command together with the bibliography.
If I compile the file without the -job-name command, the bibliography appears normally, with that command, instead,...
6
votes
2
answers
2k
views
Timestamp in document / pdf name
Let's assume my document is called test.tex. Instead of creating a test.pdf I would like to add a suffix date stamp to the filename, e.g. test_2013_05_29 (test_yyyy_mm_dd). I am compiling with ...