Questions tagged [jobname]

This is the base name used by a TeX run to identify itself.

Filter by
Sorted by
Tagged with
1
vote
1answer
73 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
2answers
251 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
1answer
77 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
0answers
36 views

class options from file name with xstring

I am trying to have several different versions of a document, differing only in the class options, with the options given by the file name. So I will have, e.g., notes.draft.tex, notes.final.tex, etc.,...
0
votes
1answer
96 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 \...
3
votes
1answer
155 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
1answer
45 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 \...
6
votes
2answers
234 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
1answer
202 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
0answers
46 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
1answer
425 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
2answers
586 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
1answer
327 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
1answer
72 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
0answers
149 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
1answer
171 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
1answer
148 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
1answer
56 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
6answers
813 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
1answer
887 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
1answer
108 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} \...
2
votes
1answer
492 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
1answer
218 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
2answers
283 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
1answer
95 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 \...
3
votes
2answers
1k 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
3answers
235 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 ...
2
votes
2answers
5k 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
0answers
150 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 ...
1
vote
0answers
153 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 ...
12
votes
2answers
1k 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
1answer
203 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
1answer
2k 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
1answer
502 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. ...
3
votes
1answer
367 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
1answer
339 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
1answer
814 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
2answers
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 ...
9
votes
2answers
777 views

How to pass \jobname with whitespace to external shell command

I need to pass \jobname to some external shell command and read back its input using the \input{|"<shell command>"} syntax. However \jobname may contain whitespaces. So how to quote it for the ...
14
votes
1answer
700 views

Encoding of non-ASCII characters (Umlauts) in \jobname

I need to parse \jobname to extract some metadata (such as the subject of a letter) that is encoded in the filename of the .tex file. The filenames are not restricted to ASCII, but maybe any UTF8 ...
14
votes
1answer
8k views

Output Filename

I'm using texmaker and PdfLaTeX. With the exception of changing the .tex filename, does anyone know how to modify the output file name based on a parameter? I am aware that the following line... %&...
24
votes
1answer
2k views

Can/Should I use '\jobname' to pass information from outside LaTeX?

I'm creating a parameterized document. I want to pass a string into the document from outside at 'compile time'. In particular: a comma-separated list. This list will then be used by LaTeX to resolve ...
20
votes
5answers
8k views

Comment out lines without using % and comment enviroment

I would like to ask something which will greatly facilitate my work. But before, I introduce you to the problem I face. In my attempt to gather my notes for my students and give them something more ...
9
votes
6answers
5k views

Automatically create two PDF output files from one tex file [duplicate]

Possible Duplicate: Can one TeX file output to multiple PDF files? Let's say I have a tex file foo.tex. Now, I want to achieve that pdflatex does not only create a file foo.pdf but simultaneously ...
3
votes
2answers
631 views

\jobname in Gummi

The command \jobname usually print the file name without the path and extension, so inside a file called foo.tex will print just foo. With pdflatex foo.test or compiling from LaTeXila certainly I ...
21
votes
2answers
3k views

What are the allowed characters in filenames?

What characters can be used in filenames for the main document and input files, both .tex and images etc.? I'm not asking about which are recommended to be used, but about a list of all possible ...
1
vote
0answers
1k views

tikz externalize optimizes pictures away although jobname complies [closed]

I used tikz externalize successfully for a time now. But since my pc crashed once the externalized pictures are instantly deleted. Reading the manual I found out, that they are "optimized away" ...
10
votes
2answers
2k views

How to test --jobname compilation option within latex file

Due to some commands in my preamble (\synctex=1,\makenomenclature,\settocdepth{subsection}) which are not fully compatible with --jobname procedure, I would like to add a test before these three line ...
2
votes
1answer
1k views

using texlive:latex/pdflatex/xelatex and shebang (jobname)

I'm wondering, why my minimal example (in file shebang.tex) %& -job-name=test \listfiles \documentclass{article} \begin{document} Hidiho \end{document} will always (no matter if using latex, ...
6
votes
3answers
538 views

Reparing the \jobname for use in titlehead

If I name a LaTeX file hw1, I want to print Homework 1. How can I do this? I can print the string hw1 directly using \jobname, but I don't want spaces in my file name or have to type that out each ...