Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

There is some conflict or error I don't understand. I can skip it and nothing visible happens. The output is okay and everything seems to be fine. Still I would like to get rid of the error message. If I run the following minimal example:

\documentclass[]{scrbook}

\usepackage[applemac, grafiken]{tahbiblatex}
\usepackage[ngerman]{babel}


\begin{document}

Testing äüöaüä.

\end{document}

I get the error message:

   ! Missing = inserted for \ifnum.
<to be read again> 
                   ,
l.4 \usepackage
               [ngerman]{babel}
? 
! Missing number, treated as zero.
<to be read again> 
                   ,
l.4 \usepackage
               [ngerman]{babel}

Here is my .sty file:

\NeedsTeXFormat{LaTeX2e}\relax
\ProvidesPackage{tahbiblatex}[2012, by tah modified by sm]

\RequirePackage{ifthen}

\DeclareOption{latin1}{\PassOptionsToPackage{\CurrentOption}{inputenc}}
\DeclareOption{applemac}{\PassOptionsToPackage{\CurrentOption}{inputenc}}
\DeclareOption{cp850}{\PassOptionsToPackage{\CurrentOption}{inputenc}}
\DeclareOption{utf8}{\PassOptionsToPackage{\CurrentOption}{inputenc}}

\DeclareOption{dvi}{%
\newif\ifpdf
\ifx\pdfoutput\undefined
    \pdffalse
\else
    \pdfoutput=0
    \pdftrue
\fi}

\newcounter{Grafiken}\setcounter{Grafiken}{0}
\DeclareOption{grafiken}{\setcounter{Grafiken}{1}}

\newcounter{Randausgleich}\setcounter{Randausgleich}{0}
\DeclareOption{randausgleich}{\setcounter{Randausgleich}{1}}

\newcounter{Tabellen}\setcounter{Tabellen}{0}
\DeclareOption{tabellen}{\setcounter{Tabellen}{1}}

\newcounter{Sync}\setcounter{Sync}{0}
\DeclareOption{sync}{\setcounter{Sync}{1}}

\ProcessOptions

\RequirePackage{fixltx2e}
\RequirePackage{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage[T1]{url}
\RequirePackage{setspace}
%\RequirePackage[german]{varioref}
\RequirePackage{textcomp}

\newcommand{\urlangabe}[2]{%
$\langle$\url{#1}$\rangle$ -- Zugriff am #2}

\def\hierlockern {\begingroup \def\par{\endgraf\endgroup}%
  \tolerance 1414%
  \hbadness 1414%
  \emergencystretch 1.5em%
  \hfuzz 0.3pt%
  \vfuzz \hfuzz%
  \raggedbottom%
}

\newcommand{\alleslockern}{%
  \tolerance 1414%
  \hbadness 1414%
  \emergencystretch 1.5em%
  \hfuzz 0.3pt%
  \vfuzz \hfuzz%
  \raggedbottom%
}
\ifthenelse{\value{Grafiken}=1}
  {
  \ifx\pdfoutput\undefined \newcount\pdfoutput \fi
  \ifcase\pdfoutput
      \RequirePackage[dvips]{graphicx}
      \DeclareGraphicsExtensions{.eps}
      \typeout{Paket tah Meldung: Die Option `grafiken' fuer DVI wurde gewaehlt.}%
\else
    \RequirePackage[pdftex]{graphicx}
    \DeclareGraphicsExtensions{.jpg,.tif,.png,.pdf}
    \typeout{Paket tah Meldung: Die Option `grafiken' fuer PDF wurde gewaehlt.}%
  \fi}
  {}

\ifthenelse{\value{Sync}=1}
  {
    \ifx\pdfoutput\undefined \newcount\pdfoutput \fi
    \ifcase\pdfoutput
    \RequirePackage{srcltx}
    \typeout{Paket tah Meldung: Die Option `sync' fuer DVI wurde gewaehlt.}%
    \else
    \RequirePackage{pdfsync}
    \typeout{Paket tah Meldung: Die Option `sync' fuer PDF wurde gewaehlt.}%
    \fi
}
  {}


\ifthenelse{\value{Randausgleich}=1}
  {\typeout{Paket tah Meldung: Die Option `randausgleich' wurde gewaehlt.}%
  \RequirePackage[activate]{pdfcprot}}
  {}

\ifthenelse{\value{Tabellen}=1}
  {\typeout{Paket tah Meldung: Die Option `tabellen' wurde gewaehlt.}%
  \RequirePackage{tabularx}
  \RequirePackage{ragged2e}
  \RequirePackage{dcolumn}
  \RequirePackage{booktabs}
  \newcolumntype{L}{>{\RaggedRight\hspace{0pt}\arraybackslash}l}
  \newcolumntype{Y}{>{\RaggedRight\hspace{0pt}\arraybackslash}X}
  \newcolumntype{d}[1]{>{\DC@{.}{,}{#1}}l<{\DC@end}}
  }
  {}



\endinput

I also don't really need all the features. So it would be nice to reduce it to minimal features, which are needed..

share|improve this question

closed as too localized by doncherry, Werner, Claudio Fiandrino, lockstep, Stephen Jan 2 '13 at 20:09

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

4  
This is a lot of code. In order to help people who'll help you, please remove everything from the code that's not related to your problem in order to get a true minimal working example (MWE), that people can copy and compile to reproduce your problem. In your case, I'd recommend making a local copy of your .sty file to mess around in, and begin removing lines of code from it and compiling, and over again until the error disappears, thus figuring out what's relevant. –  doncherry Apr 10 '12 at 21:09
add comment

1 Answer 1

up vote 10 down vote accepted

The optional argument to \ProvidesPackage must be of the form

[yyyy/mm/dd Additional info]

for instance

\ProvidesPackage{tahbiblatex}[2012/04/10, by tah modified by sm and egreg]

In particular, one digit numbers of days or months must be prefixed by 0 and the year must be in four digit form. So January 2nd, 2013 has to be expressed as

2013/01/02

Turning to the package's contents, all which regards \pdfoutput is wrong: require the package ifpdf and use the \ifpdf conditional it provides. Here's an amended version; notice that allocating a counter for each option is wasting resources:

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tahbiblatex}[2012/04/10, by tah modified by sm]

\RequirePackage{ifpdf}

\DeclareOption{latin1}{\PassOptionsToPackage{\CurrentOption}{inputenc}}
\DeclareOption{applemac}{\PassOptionsToPackage{\CurrentOption}{inputenc}}
\DeclareOption{cp850}{\PassOptionsToPackage{\CurrentOption}{inputenc}}
\DeclareOption{utf8}{\PassOptionsToPackage{\CurrentOption}{inputenc}}

\DeclareOption{dvi}{\pdfoutput=\z@\pdffalse}
\DeclareOption{grafiken}{\let\tah@grafiken=T}
\DeclareOption{randausgleich}{\let\tah@randausgleich=T}
\DeclareOption{tabellen}{\let\tah@tabellen=T}
\DeclareOption{sync}{\let\tah@sync=T}

\ProcessOptions\relax

\RequirePackage{fixltx2e}
\RequirePackage{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage[T1]{url}
\RequirePackage{setspace}
\RequirePackage{textcomp}

\newcommand{\urlangabe}[2]{%
  $\langle$\url{#1}$\rangle$ -- Zugriff am #2}

\def\hierlockern {\begingroup \def\par{\endgraf\endgroup}%
  \tolerance 1414
  \hbadness 1414
  \emergencystretch 1.5em
  \hfuzz 0.3pt
  \vfuzz \hfuzz
  \raggedbottom
}

\newcommand{\alleslockern}{%
  \tolerance 1414
  \hbadness 1414
  \emergencystretch 1.5em
  \hfuzz 0.3pt
  \vfuzz \hfuzz
  \raggedbottom
}

\ifdefined\tah@grafiken
  \typeout{Paket tah Meldung: Die Option `grafiken' fuer 
    \ifpdf PDF\else DVI\fi\space wurde gewaehlt.}
\fi

\ifdefined\tah@sync
  \ifpdf
    \RequirePackage{pdfsync}
    \typeout{Paket tah Meldung: Die Option `sync' fuer PDF wurde gewaehlt.}
  \else
    \RequirePackage{srcltx}
    \typeout{Paket tah Meldung: Die Option `sync' fuer DVI wurde gewaehlt.}%
  \fi
\fi

\ifdefined\tah@randausgleich
  \typeout{Paket tah Meldung: Die Option `randausgleich' wurde gewaehlt.}
  \RequirePackage{microtype}
\fi

\ifdefined\tah@tabellen
  \typeout{Paket tah Meldung: Die Option `tabellen' wurde gewaehlt.}
  \RequirePackage{tabularx}
  \RequirePackage{ragged2e}
  \RequirePackage{dcolumn}
  \RequirePackage{booktabs}
  \newcolumntype{L}{>{\RaggedRight\hspace{0pt}\arraybackslash}l}
  \newcolumntype{Y}{>{\RaggedRight\hspace{0pt}\arraybackslash}X}
  \newcolumntype{d}[1]{>{\DC@{.}{,}{#1}}l<{\DC@end}}
\fi

\endinput

I don't recommend loading the pdfsync package: the SyncTeX technology is way better, nowadays. Instead of pdfcprot the more powerful microtype package is preferable.

share|improve this answer
    
The error is gone. Thanks! –  algomachine Apr 10 '12 at 22:08
    
What was it exactly? I still don't understand. –  algomachine Apr 10 '12 at 22:22
    
@smiyazaki The \ProvidesPackage line was wrong: check my second line against yours. The rest is just tidying up. –  egreg Apr 10 '12 at 22:24
    
I thought, that egreg was to modest, and decided to add him as modifier/contributor. –  Speravir Apr 11 '12 at 0:13
    
@algomachine: While ", by tah modified by sm and egreg" as Additional info is possible, " v2.0 by tah modified by sm and egreg" (where v2.0 is the version info, preceded and followed by a space character) would be a more common notation and also compatible with longfilelist/nicefilelist. –  Stephen Apr 11 '12 at 18:49
show 3 more comments

Not the answer you're looking for? Browse other questions tagged or ask your own question.