When I open a PDF file and I want to know if it was created via LaTeX or XeLaTeX or LuaLaTeX and so on, because some PDF files were converted from Word. How can I do that?
-
1Have you checked the pdf properties? – daleif Jun 27 '19 at 11:40
-
@daleif, Yes I did – Ali Jun 27 '19 at 11:41
-
And what do you get? I know at least pdflatex is saying it is produced by pdftex, and it is not used by the others – daleif Jun 27 '19 at 11:42
-
As long as I know nothing which indicate the source of the file if it is converted from Word or others – Ali Jun 27 '19 at 11:44
-
Most converters mention the producer in the pdf properties. Sorry cannot help you more that that, you probably need to give us more information on what exactly you are asking – daleif Jun 27 '19 at 11:46
-
@daleif, can you please print screen the properties since I have not seen what you have said ? – Ali Jun 27 '19 at 11:48
-
Let us continue this discussion in chat. – Ali Jun 27 '19 at 11:49
-
I don't understand the reference to Word in a question that asks about flavours of TeX. To me the question could read 'how do I tell TeX apart from Word', in which case the answer is 'if it looks nice then it's TeX'. – Jessica B Jun 28 '19 at 07:53
5 Answers
For example, pdfinfo (part of poppler) can show you Creator and Producer. I get the following, for a PDF file created by XeTeX (with the xelatex command):
Creator: XeTeX output 2019.06.27:0505
Producer: xdvipdfmx (20180217)
Created by LuaTeX (with lualatex):
Creator: TeX
Producer: LuaTeX-1.07.0
Created by pdfTeX, with latex followed by dvipdfm:
Creator: TeX output 2019.06.27:0505
Producer: dvipdfmx (20180217)
For a file created by TextEdit on macOS with “Export as PDF”:
Creator: TextEdit
Producer: macOS Version 10.14.5 (Build 18F132) Quartz PDFContext
For a file created with my browser's Print as PDF:
Creator: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36
Producer: Skia/PDF m75
Etc.
You don't have to use pdfinfo; other tools that show PDF properties should show the same data.
Also note that these are only the defaults; if someone wishes and knows how, they can set the properties to anything.
- 45,428
- 10
- 117
- 149
-
You can also just open the PDF in a text viewer, e.g. Notepad++, and then search for
latex. You will see something like/Author()/Title()/Subject()/Creator(LaTeX with hyperref)/Producer(pdfTeX-1.40.19)/Keywords(). – ComFreek Jun 28 '19 at 07:49
On the Mac, you can click on your pdf file in the Finder, and then do "Get Info" from the Finder menu (which is also the Command + "i" key).
You will see in the Get Info if it is created by pdfTeX. For instance, I just checked such a file, and it says:
Content Creator: TeX Encoding software: pdfTeX-1.40.20
- 145
Defaults for MiKTeX all outputs are PDF Version: 1.5
Created by PdfLaTeX:
Application: TeX
PDF Producer: MiKTeX pdfTeX-1.40.20
Created by LuaLaTeX:
Application: TeX
PDF Producer: LuaTeX-1.10.0
Created by XeLaTeX
Application: XeTeX output 2019...
PDF Producer: MiKTeX-xdvipdfmx (20190503)
pdfinfo would work, but just for the information Firefox's integrated pdf viewer also shows the creater info, click on the >> button on the top-right corner, and then click Document Properties.
If someone has changed or wiped the PDF info—which you will find is often the case on the arXiv, to get around its auto-detection and allow submitting files without source—the biggest dead giveaway is usually the font families. You can check these with pdffonts, although it would be possible to rename these to random gibberish too.
A document compiled in PDFTeX will embed the 8-bit fonts that LaTeX used to create it, with their distinctive family names, such as cmr19 for 19-point Computer Modern Roman. or lmr for Latin Modern Roman, qpl for TeX Gyre Pagella, etc. The 8-bit math fonts will also be embedded with their LaTeX family names.
A document made with unicode-math will instead embed OpenType fonts, such as LatinModernMath. One created with fontspec plus 8-bit math packages will have a mixture of OpenType text fonts and 8-bit symbol fonts, which will tell you what math packages it used.
There’s other software that uses OpenType fonts, but for example Microsoft Office typesets equations in Cambria Math by default, and LaTeX documents rarely use it.
- 44,045