Text Formattingxstring | Two Document Classes

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
eleanor
Posts: 19
Joined: Sat Oct 03, 2009 6:03 pm

xstring | Two Document Classes

Post by eleanor »

Hi.

I'm trying to compile the next usecase:

Code: Select all

\documentclass{article}
\usepackage{xstring}

\begin{document}
  Test.
\end{document}
I'm compiling with the "pdflatex xstring.tex" (I named my document xstring).

Then I'm getting the following error:
$ pdflatex xstring.tex
This is pdfTeX, Version 3.1415926-1.40.10 (Web2C 2009)
restricted \write18 enabled.
entering extended mode
(./xstring.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, dumylang, nohyphenation, lo
aded.
(/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texmf-dist/tex/generic/xstring/xstring.sty (./xstring.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{
article}
?
(./xstring.aux) [1{//var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}]
(./xstring.aux) ) ) )</usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmr1
0.pfb>
Output written on xstring.pdf (1 page, 11055 bytes).
Transcript written on xstring.log.

A little more info about the xstring package:
# ls -l /usr/share/texmf-dist/tex/generic/xstring/
-rw-r--r-- 1 root root 144 Mar 28 2010 xstring.sty
-rw-r--r-- 1 root root 51634 Mar 28 2010 xstring.tex
And the version number:
\def\xstringversion {1.5d}
\def\xstringdate {2010/03/28}
\def\xstringfrenchdate {28 mars 2010}
\def\xstringenglishdate {March $28^{\mathrm{th}}$ 2010}
\edef\CurrentAtCatcode {\the\catcode`\@}
\catcode`\@=11
\newwrite\@xs@message% canal pour les messages
\newcount\integerpart\newcount\decimalpart% compteurs utilis\'es par xstring
\newif\if@xs@empty
If I uncomment the \usepackage{xstring} line then I don't get the error anymore. Let me just mention that I'm using gentoo linux.

Does anybody have any idea why this is happening?
Last edited by eleanor on Thu Jul 21, 2011 9:10 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

xstring | Two Document Classes

Post by localghost »

eleanor wrote:[…] I'm compiling with the "pdflatex xstring.tex" (I named my document xstring). […]
You mustn't do so. Never give a source file the name of a package you are loading. Assign another name to your document.


Thorsten
eleanor
Posts: 19
Joined: Sat Oct 03, 2009 6:03 pm

Re: xstring | Two Document Classes

Post by eleanor »

Thanks for the reply. That solved my problem.
Post Reply