Changes

Jump to navigation Jump to search
1,781 bytes added ,  16:02, 21 May 2012
Create jobname page
{{Reference
|name=jobname
|attributes=
}}

== [[Help:Reference|Syntax]] ==

<table cellspacing="4" cellpadding="2" class="cmd">
<tr>
<td colspan="2" class="cmd">\jobname</td>
</tr>
</table>

== Description ==

The command <code>\jobname</code> prints the basename (the name without the <code>.tex</code> extension) of the TeX file on which ConTeXt was invoked. E.g. in the simple case of <code>mydocument.tex</code>, <code>\jobname</code> will produce <code>mydocument</code>. If one is using products and components, then <code>\jobname</code> will resolve to the basename of whatever product (or component) the <code>context</code> or <code>texexec</code> command was invoked on.

== Example ==

With a single file:
<context source="yes">
Job name: \jobname
</context>

Multi-file example: a product and a component.
<texcode>
% myproduct.tex
\startproduct
\component c_mycomponent
\stopproduct
</texcode>
and
<texcode>
% mycomponent.tex
\startcomponent c_mycomponent % not required, but good for clarity
\jobname
\stopcomponent
</texcode>

Compiling this with <code>context myproduct.tex</context> means <code>\jobname</code> in <code>mycompnent.tex</code> resolves to <code>myproduct</code>. (Same with <code>texexec</code>, naturally.)

== See also ==
* {{cmd|texenginename}} gives the name of the engine (e.g. LuaTeX, or XeTeX).
* {{cmd|texengineversion}} gives the version number of the engine (e.g. 0.64).
* {{cmd|contextversion}} gives the timestamp of the ConTeXt version in use
* {{cmd|contextmark}} gives MKII or MKIV, the ConTeXt major release marker
* {{cmd|contextversionnumber}} gives the ConTeXt version followed by the mark.

== Help from ConTeXt-Mailinglist/Forum ==
All issues with:
{{Forum|{{SUBPAGENAME}}}}

[[Category:Command/Internals|jobname]]

Navigation menu