Mysterious “Two documentclass or documentstyle commands.”documentclasstikz-qtree Error Two documentclass or documentstyle commandsEnumerate and itemize undefined + captions not workingdocumentclass not being recognizedMultiple mysterious compilation errorsMysterious Undefined control sequence errorsUndefined control sequence in documentclass?Why doesn't “/documentclassarticle” work (forward slash vs. backslash)documentclasstikz-qtree Error Two documentclass or documentstyle commandsproposal documentclass problemBeginning commandsMysterious tufte-book error
Biological Blimps: Propulsion
How to make money from a browser who sees 5 seconds into the future of any web page?
How can ping know if my host is down
The IT department bottlenecks progress, how should I handle this?
How to explain what's wrong with this application of the chain rule?
What is the highest possible scrabble score for placing a single tile
Why is the "ls" command showing permissions of files in a FAT32 partition?
Is this toilet slogan correct usage of the English language?
How can I write humor as character trait?
Can I cause damage to electrical appliances by unplugging them when they are turned on?
Which Article Helped Get Rid of Technobabble in RPGs?
A variation to the phrase "hanging over my shoulders"
What fields between the rationals and the reals allow a good notion of 2D distance?
Has the laser at Magurele, Romania reached a tenth of the Sun's power?
What (the heck) is a Super Worm Equinox Moon?
Is there any evidence that Cleopatra and Caesarion considered fleeing to India to escape the Romans?
C++ check if statement can be evaluated constexpr
Why does AES have exactly 10 rounds for a 128-bit key, 12 for 192 bits and 14 for a 256-bit key size?
Pre-mixing cryogenic fuels and using only one fuel tank
Is this part of the description of the Archfey warlock's Misty Escape feature redundant?
Non-trope happy ending?
Microchip documentation does not label CAN buss pins on micro controller pinout diagram
Why do Radio Buttons not fill the entire outer circle?
Can you use Vicious Mockery to win an argument or gain favours?
Mysterious “Two documentclass or documentstyle commands.”
documentclasstikz-qtree Error Two documentclass or documentstyle commandsEnumerate and itemize undefined + captions not workingdocumentclass not being recognizedMultiple mysterious compilation errorsMysterious Undefined control sequence errorsUndefined control sequence in documentclass?Why doesn't “/documentclassarticle” work (forward slash vs. backslash)documentclasstikz-qtree Error Two documentclass or documentstyle commandsproposal documentclass problemBeginning commandsMysterious tufte-book error
The LaTeX code
documentclass[12pt,a4paper]article
usepackageamsmath
usepackageamsfonts
usepackagepstricks
begindocument
zzz
enddocument
causes in latex and pdflatex the mysterious error "Two documentclass or documentstyle commands." Why??? Not actually two documentclass like in the (original) question documentclasstikz-qtree Error Two documentclass or documentstyle commands.
Probably irrelevant, but I'm using texlive (2018 version) in a Debian system.
The .log as asked by moewe: https://pastebin.com/BGcHs3Rz.
Answering other comment: the filename is psttest.tex.
errors
New contributor
|
show 6 more comments
The LaTeX code
documentclass[12pt,a4paper]article
usepackageamsmath
usepackageamsfonts
usepackagepstricks
begindocument
zzz
enddocument
causes in latex and pdflatex the mysterious error "Two documentclass or documentstyle commands." Why??? Not actually two documentclass like in the (original) question documentclasstikz-qtree Error Two documentclass or documentstyle commands.
Probably irrelevant, but I'm using texlive (2018 version) in a Debian system.
The .log as asked by moewe: https://pastebin.com/BGcHs3Rz.
Answering other comment: the filename is psttest.tex.
errors
New contributor
Welcome to TeX.SX! For me the code works fine (as it should)... I'm also using TeXLive 2018, so I guess there is something else causing that problem. The error message should show in which line the problem happened. Can you show us the log, please?
– Phelype Oleinik
12 hours ago
Can you share the full.log
file of the LaTeX run on that file? If it is too long to be shared here, you can upload it to a text-sharing website like pastebin.com
– moewe
12 hours ago
@PhelypeOleinik, then the concrete compiler can be relevant... Thanks.
– Martín-Blas Pérez Pinilla
12 hours ago
3
Do NOT call your document article.tex
– Johannes_B
12 hours ago
5
As Johannes guessed: You have a file calledpstricks.tex
in the same folder as this file. Butpstricks
is the name of a package you load. TeX picks up the wrong file and chaos ensues. Renamepstricks.tex
and you should be good.
– moewe
12 hours ago
|
show 6 more comments
The LaTeX code
documentclass[12pt,a4paper]article
usepackageamsmath
usepackageamsfonts
usepackagepstricks
begindocument
zzz
enddocument
causes in latex and pdflatex the mysterious error "Two documentclass or documentstyle commands." Why??? Not actually two documentclass like in the (original) question documentclasstikz-qtree Error Two documentclass or documentstyle commands.
Probably irrelevant, but I'm using texlive (2018 version) in a Debian system.
The .log as asked by moewe: https://pastebin.com/BGcHs3Rz.
Answering other comment: the filename is psttest.tex.
errors
New contributor
The LaTeX code
documentclass[12pt,a4paper]article
usepackageamsmath
usepackageamsfonts
usepackagepstricks
begindocument
zzz
enddocument
causes in latex and pdflatex the mysterious error "Two documentclass or documentstyle commands." Why??? Not actually two documentclass like in the (original) question documentclasstikz-qtree Error Two documentclass or documentstyle commands.
Probably irrelevant, but I'm using texlive (2018 version) in a Debian system.
The .log as asked by moewe: https://pastebin.com/BGcHs3Rz.
Answering other comment: the filename is psttest.tex.
errors
errors
New contributor
New contributor
edited 12 hours ago
Martín-Blas Pérez Pinilla
New contributor
asked 12 hours ago
Martín-Blas Pérez PinillaMartín-Blas Pérez Pinilla
1184
1184
New contributor
New contributor
Welcome to TeX.SX! For me the code works fine (as it should)... I'm also using TeXLive 2018, so I guess there is something else causing that problem. The error message should show in which line the problem happened. Can you show us the log, please?
– Phelype Oleinik
12 hours ago
Can you share the full.log
file of the LaTeX run on that file? If it is too long to be shared here, you can upload it to a text-sharing website like pastebin.com
– moewe
12 hours ago
@PhelypeOleinik, then the concrete compiler can be relevant... Thanks.
– Martín-Blas Pérez Pinilla
12 hours ago
3
Do NOT call your document article.tex
– Johannes_B
12 hours ago
5
As Johannes guessed: You have a file calledpstricks.tex
in the same folder as this file. Butpstricks
is the name of a package you load. TeX picks up the wrong file and chaos ensues. Renamepstricks.tex
and you should be good.
– moewe
12 hours ago
|
show 6 more comments
Welcome to TeX.SX! For me the code works fine (as it should)... I'm also using TeXLive 2018, so I guess there is something else causing that problem. The error message should show in which line the problem happened. Can you show us the log, please?
– Phelype Oleinik
12 hours ago
Can you share the full.log
file of the LaTeX run on that file? If it is too long to be shared here, you can upload it to a text-sharing website like pastebin.com
– moewe
12 hours ago
@PhelypeOleinik, then the concrete compiler can be relevant... Thanks.
– Martín-Blas Pérez Pinilla
12 hours ago
3
Do NOT call your document article.tex
– Johannes_B
12 hours ago
5
As Johannes guessed: You have a file calledpstricks.tex
in the same folder as this file. Butpstricks
is the name of a package you load. TeX picks up the wrong file and chaos ensues. Renamepstricks.tex
and you should be good.
– moewe
12 hours ago
Welcome to TeX.SX! For me the code works fine (as it should)... I'm also using TeXLive 2018, so I guess there is something else causing that problem. The error message should show in which line the problem happened. Can you show us the log, please?
– Phelype Oleinik
12 hours ago
Welcome to TeX.SX! For me the code works fine (as it should)... I'm also using TeXLive 2018, so I guess there is something else causing that problem. The error message should show in which line the problem happened. Can you show us the log, please?
– Phelype Oleinik
12 hours ago
Can you share the full
.log
file of the LaTeX run on that file? If it is too long to be shared here, you can upload it to a text-sharing website like pastebin.com– moewe
12 hours ago
Can you share the full
.log
file of the LaTeX run on that file? If it is too long to be shared here, you can upload it to a text-sharing website like pastebin.com– moewe
12 hours ago
@PhelypeOleinik, then the concrete compiler can be relevant... Thanks.
– Martín-Blas Pérez Pinilla
12 hours ago
@PhelypeOleinik, then the concrete compiler can be relevant... Thanks.
– Martín-Blas Pérez Pinilla
12 hours ago
3
3
Do NOT call your document article.tex
– Johannes_B
12 hours ago
Do NOT call your document article.tex
– Johannes_B
12 hours ago
5
5
As Johannes guessed: You have a file called
pstricks.tex
in the same folder as this file. But pstricks
is the name of a package you load. TeX picks up the wrong file and chaos ensues. Rename pstricks.tex
and you should be good.– moewe
12 hours ago
As Johannes guessed: You have a file called
pstricks.tex
in the same folder as this file. But pstricks
is the name of a package you load. TeX picks up the wrong file and chaos ensues. Rename pstricks.tex
and you should be good.– moewe
12 hours ago
|
show 6 more comments
1 Answer
1
active
oldest
votes
The crucial piece of information to understand this error is the line in the .log
before the actual error message starts. It reads
(./pstricks.tex
! LaTeX Error: Two documentclass or documentstyle commands.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.1 documentclass[12pt]
article
?
! Emergency stop.
...
l.1 documentclass[12pt]
article
The document may only declare one class.
The (./pstricks.tex
means that TeX has opened a file called ./pstricks.tex
(i.e. a file in the same directory as your main TeX file called pstricks.tex
). As soon as that file is loaded the error occurs in the documentclass
in line 1.
A part of the code of the package pstricks
lives in a file called pstricks.tex
and that file is loaded by the package. (pstricks.sty
has the line inputpstricks%
, which reads pstricks.tex
.)
The way TeX loads files means that files in your current working directory are given preference over files installed by your TeX distribution. In general that is a very useful feature because you can easily override some things locally without changing system files.
But in this case that means that a totally unrelated file called pstricks.tex
in the document directory is loaded instead of the package code in pstricks.tex
.
The easiest way to avoid that is by renaming your local file to something other than pstricks.tex
. In general you should avoid giving files the same name as a class or package, but you can never be entirely sure which names are problematic as packages could load additional .tex
files with different names. The only way to be sure is by checking the .log
thoroughly if similar issues occur.
Note that the error might have been much more cryptic and might have occurred at a different stage if your pstricks.tex
had not contained a documentclass
, for example if it had been only a chapter of your paper that you load in a bigger document with input
or include
.
This is what Johannes_B hinted at in his comment
Do NOT call your document article.tex
Though, incidentally, acrticle.tex
would have probably been fine, since article.cls
does not attempt to load article.tex
.
A similar issue was discussed a few days ago in the German goLaTeX forum https://golatex.de/markdown-in-latex-einbinden-t21651.html where the issue appeared with the markdown
package, which loads markdown.tex
, when a user called their document Markdown.tex
(on a Windows system, which is case insensitive).
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Martín-Blas Pérez Pinilla is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480682%2fmysterious-two-documentclass-or-documentstyle-commands%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The crucial piece of information to understand this error is the line in the .log
before the actual error message starts. It reads
(./pstricks.tex
! LaTeX Error: Two documentclass or documentstyle commands.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.1 documentclass[12pt]
article
?
! Emergency stop.
...
l.1 documentclass[12pt]
article
The document may only declare one class.
The (./pstricks.tex
means that TeX has opened a file called ./pstricks.tex
(i.e. a file in the same directory as your main TeX file called pstricks.tex
). As soon as that file is loaded the error occurs in the documentclass
in line 1.
A part of the code of the package pstricks
lives in a file called pstricks.tex
and that file is loaded by the package. (pstricks.sty
has the line inputpstricks%
, which reads pstricks.tex
.)
The way TeX loads files means that files in your current working directory are given preference over files installed by your TeX distribution. In general that is a very useful feature because you can easily override some things locally without changing system files.
But in this case that means that a totally unrelated file called pstricks.tex
in the document directory is loaded instead of the package code in pstricks.tex
.
The easiest way to avoid that is by renaming your local file to something other than pstricks.tex
. In general you should avoid giving files the same name as a class or package, but you can never be entirely sure which names are problematic as packages could load additional .tex
files with different names. The only way to be sure is by checking the .log
thoroughly if similar issues occur.
Note that the error might have been much more cryptic and might have occurred at a different stage if your pstricks.tex
had not contained a documentclass
, for example if it had been only a chapter of your paper that you load in a bigger document with input
or include
.
This is what Johannes_B hinted at in his comment
Do NOT call your document article.tex
Though, incidentally, acrticle.tex
would have probably been fine, since article.cls
does not attempt to load article.tex
.
A similar issue was discussed a few days ago in the German goLaTeX forum https://golatex.de/markdown-in-latex-einbinden-t21651.html where the issue appeared with the markdown
package, which loads markdown.tex
, when a user called their document Markdown.tex
(on a Windows system, which is case insensitive).
add a comment |
The crucial piece of information to understand this error is the line in the .log
before the actual error message starts. It reads
(./pstricks.tex
! LaTeX Error: Two documentclass or documentstyle commands.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.1 documentclass[12pt]
article
?
! Emergency stop.
...
l.1 documentclass[12pt]
article
The document may only declare one class.
The (./pstricks.tex
means that TeX has opened a file called ./pstricks.tex
(i.e. a file in the same directory as your main TeX file called pstricks.tex
). As soon as that file is loaded the error occurs in the documentclass
in line 1.
A part of the code of the package pstricks
lives in a file called pstricks.tex
and that file is loaded by the package. (pstricks.sty
has the line inputpstricks%
, which reads pstricks.tex
.)
The way TeX loads files means that files in your current working directory are given preference over files installed by your TeX distribution. In general that is a very useful feature because you can easily override some things locally without changing system files.
But in this case that means that a totally unrelated file called pstricks.tex
in the document directory is loaded instead of the package code in pstricks.tex
.
The easiest way to avoid that is by renaming your local file to something other than pstricks.tex
. In general you should avoid giving files the same name as a class or package, but you can never be entirely sure which names are problematic as packages could load additional .tex
files with different names. The only way to be sure is by checking the .log
thoroughly if similar issues occur.
Note that the error might have been much more cryptic and might have occurred at a different stage if your pstricks.tex
had not contained a documentclass
, for example if it had been only a chapter of your paper that you load in a bigger document with input
or include
.
This is what Johannes_B hinted at in his comment
Do NOT call your document article.tex
Though, incidentally, acrticle.tex
would have probably been fine, since article.cls
does not attempt to load article.tex
.
A similar issue was discussed a few days ago in the German goLaTeX forum https://golatex.de/markdown-in-latex-einbinden-t21651.html where the issue appeared with the markdown
package, which loads markdown.tex
, when a user called their document Markdown.tex
(on a Windows system, which is case insensitive).
add a comment |
The crucial piece of information to understand this error is the line in the .log
before the actual error message starts. It reads
(./pstricks.tex
! LaTeX Error: Two documentclass or documentstyle commands.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.1 documentclass[12pt]
article
?
! Emergency stop.
...
l.1 documentclass[12pt]
article
The document may only declare one class.
The (./pstricks.tex
means that TeX has opened a file called ./pstricks.tex
(i.e. a file in the same directory as your main TeX file called pstricks.tex
). As soon as that file is loaded the error occurs in the documentclass
in line 1.
A part of the code of the package pstricks
lives in a file called pstricks.tex
and that file is loaded by the package. (pstricks.sty
has the line inputpstricks%
, which reads pstricks.tex
.)
The way TeX loads files means that files in your current working directory are given preference over files installed by your TeX distribution. In general that is a very useful feature because you can easily override some things locally without changing system files.
But in this case that means that a totally unrelated file called pstricks.tex
in the document directory is loaded instead of the package code in pstricks.tex
.
The easiest way to avoid that is by renaming your local file to something other than pstricks.tex
. In general you should avoid giving files the same name as a class or package, but you can never be entirely sure which names are problematic as packages could load additional .tex
files with different names. The only way to be sure is by checking the .log
thoroughly if similar issues occur.
Note that the error might have been much more cryptic and might have occurred at a different stage if your pstricks.tex
had not contained a documentclass
, for example if it had been only a chapter of your paper that you load in a bigger document with input
or include
.
This is what Johannes_B hinted at in his comment
Do NOT call your document article.tex
Though, incidentally, acrticle.tex
would have probably been fine, since article.cls
does not attempt to load article.tex
.
A similar issue was discussed a few days ago in the German goLaTeX forum https://golatex.de/markdown-in-latex-einbinden-t21651.html where the issue appeared with the markdown
package, which loads markdown.tex
, when a user called their document Markdown.tex
(on a Windows system, which is case insensitive).
The crucial piece of information to understand this error is the line in the .log
before the actual error message starts. It reads
(./pstricks.tex
! LaTeX Error: Two documentclass or documentstyle commands.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.1 documentclass[12pt]
article
?
! Emergency stop.
...
l.1 documentclass[12pt]
article
The document may only declare one class.
The (./pstricks.tex
means that TeX has opened a file called ./pstricks.tex
(i.e. a file in the same directory as your main TeX file called pstricks.tex
). As soon as that file is loaded the error occurs in the documentclass
in line 1.
A part of the code of the package pstricks
lives in a file called pstricks.tex
and that file is loaded by the package. (pstricks.sty
has the line inputpstricks%
, which reads pstricks.tex
.)
The way TeX loads files means that files in your current working directory are given preference over files installed by your TeX distribution. In general that is a very useful feature because you can easily override some things locally without changing system files.
But in this case that means that a totally unrelated file called pstricks.tex
in the document directory is loaded instead of the package code in pstricks.tex
.
The easiest way to avoid that is by renaming your local file to something other than pstricks.tex
. In general you should avoid giving files the same name as a class or package, but you can never be entirely sure which names are problematic as packages could load additional .tex
files with different names. The only way to be sure is by checking the .log
thoroughly if similar issues occur.
Note that the error might have been much more cryptic and might have occurred at a different stage if your pstricks.tex
had not contained a documentclass
, for example if it had been only a chapter of your paper that you load in a bigger document with input
or include
.
This is what Johannes_B hinted at in his comment
Do NOT call your document article.tex
Though, incidentally, acrticle.tex
would have probably been fine, since article.cls
does not attempt to load article.tex
.
A similar issue was discussed a few days ago in the German goLaTeX forum https://golatex.de/markdown-in-latex-einbinden-t21651.html where the issue appeared with the markdown
package, which loads markdown.tex
, when a user called their document Markdown.tex
(on a Windows system, which is case insensitive).
edited 9 hours ago
answered 9 hours ago
moewemoewe
94.7k10115356
94.7k10115356
add a comment |
add a comment |
Martín-Blas Pérez Pinilla is a new contributor. Be nice, and check out our Code of Conduct.
Martín-Blas Pérez Pinilla is a new contributor. Be nice, and check out our Code of Conduct.
Martín-Blas Pérez Pinilla is a new contributor. Be nice, and check out our Code of Conduct.
Martín-Blas Pérez Pinilla is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480682%2fmysterious-two-documentclass-or-documentstyle-commands%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Welcome to TeX.SX! For me the code works fine (as it should)... I'm also using TeXLive 2018, so I guess there is something else causing that problem. The error message should show in which line the problem happened. Can you show us the log, please?
– Phelype Oleinik
12 hours ago
Can you share the full
.log
file of the LaTeX run on that file? If it is too long to be shared here, you can upload it to a text-sharing website like pastebin.com– moewe
12 hours ago
@PhelypeOleinik, then the concrete compiler can be relevant... Thanks.
– Martín-Blas Pérez Pinilla
12 hours ago
3
Do NOT call your document article.tex
– Johannes_B
12 hours ago
5
As Johannes guessed: You have a file called
pstricks.tex
in the same folder as this file. Butpstricks
is the name of a package you load. TeX picks up the wrong file and chaos ensues. Renamepstricks.tex
and you should be good.– moewe
12 hours ago