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
What doth I be?
Does detail obscure or enhance action?
Cross compiling for RPi - error while loading shared libraries
Arrow those variables!
How does one intimidate enemies without having the capacity for violence?
Replacing matching entries in one column of a file by another column from a different file
Maximum likelihood parameters deviate from posterior distributions
Approximately how much travel time was saved by the opening of the Suez Canal in 1869?
Is it inappropriate for a student to attend their mentor's dissertation defense?
What's the output of a record needle playing an out-of-speed record
Perform and show arithmetic with LuaLaTeX
What does "Puller Prush Person" mean?
How do I deal with an unproductive colleague in a small company?
High voltage LED indicator 40-1000 VDC without additional power supply
How to determine what difficulty is right for the game?
What are these boxed doors outside store fronts in New York?
Is it possible to run Internet Explorer on OS X El Capitan?
Convert two switches to a dual stack, and add outlet - possible here?
Was any UN Security Council vote triple-vetoed?
What is a clear way to write a bar that has an extra beat?
Rock identification in KY
Did Shadowfax go to Valinor?
Modeling an IP Address
Paid for article while in US on F-1 visa?
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
|
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
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
Mar 21 at 14:10
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
Mar 21 at 14:11
3
Do NOT call your document article.tex
– Johannes_B
Mar 21 at 14:15
1
In situations like this a look at the.log
file should tell us which file is problematic. And even if this was not the cause of the error, the.log
file can give us vital information about what went wrong because it will contain the full error message with line numbers.
– moewe
Mar 21 at 14:22
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
Mar 21 at 14:25
|
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
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
edited Mar 21 at 14:23
Martín-Blas Pérez Pinilla
asked Mar 21 at 14:09
Martín-Blas Pérez PinillaMartín-Blas Pérez Pinilla
1184
1184
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
Mar 21 at 14:10
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
Mar 21 at 14:11
3
Do NOT call your document article.tex
– Johannes_B
Mar 21 at 14:15
1
In situations like this a look at the.log
file should tell us which file is problematic. And even if this was not the cause of the error, the.log
file can give us vital information about what went wrong because it will contain the full error message with line numbers.
– moewe
Mar 21 at 14:22
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
Mar 21 at 14:25
|
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
Mar 21 at 14:10
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
Mar 21 at 14:11
3
Do NOT call your document article.tex
– Johannes_B
Mar 21 at 14:15
1
In situations like this a look at the.log
file should tell us which file is problematic. And even if this was not the cause of the error, the.log
file can give us vital information about what went wrong because it will contain the full error message with line numbers.
– moewe
Mar 21 at 14:22
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
Mar 21 at 14:25
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
Mar 21 at 14:10
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
Mar 21 at 14:10
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
Mar 21 at 14:11
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
Mar 21 at 14:11
3
3
Do NOT call your document article.tex
– Johannes_B
Mar 21 at 14:15
Do NOT call your document article.tex
– Johannes_B
Mar 21 at 14:15
1
1
In situations like this a look at the
.log
file should tell us which file is problematic. And even if this was not the cause of the error, the .log
file can give us vital information about what went wrong because it will contain the full error message with line numbers.– moewe
Mar 21 at 14:22
In situations like this a look at the
.log
file should tell us which file is problematic. And even if this was not the cause of the error, the .log
file can give us vital information about what went wrong because it will contain the full error message with line numbers.– moewe
Mar 21 at 14:22
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
Mar 21 at 14:25
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
Mar 21 at 14:25
|
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
);
);
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 Mar 21 at 16:45
answered Mar 21 at 16:33
moewemoewe
96.2k10117360
96.2k10117360
add a comment |
add a comment |
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
Mar 21 at 14:10
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
Mar 21 at 14:11
3
Do NOT call your document article.tex
– Johannes_B
Mar 21 at 14:15
1
In situations like this a look at the
.log
file should tell us which file is problematic. And even if this was not the cause of the error, the.log
file can give us vital information about what went wrong because it will contain the full error message with line numbers.– moewe
Mar 21 at 14:22
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
Mar 21 at 14:25