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.

This question already has an answer here:

So I'm trying my hand at creating some packages (on WriteLaTeX, because my Surface can't run TeX1), and have run into a rather fascinating problem. My packages just won't load; they complain about \ifnum instead. Here's a minimal test case:

test.sty

\NeedsTeXFormat{LaTeX2e}[1994-06-01]
\ProvidesPackage{test}[2014-08-04 Hello, World!]
\endinput

main.tex

\documentclass{article}
\title{LaTeX Testing}
\usepackage{test}

\begin{document}
Hello, World!
\end{document}

Compile error

Missing = inserted for \ifnum.
<to be read again> 
                   -
l.4 

And I'm thinking, when did \ifnum come into this?! (The error occurs on the 'token' after \usepackage, whether that's a newline or a \show or whatever else.) There's plenty on the internet about \ifnum errors, but nothing on just after \usepackage. I have no idea where to even start debugging this, and my options are rather limited due to being stuck with an online service... Some help?


1 Surface RT is a pain sometimes. I do have a proper machine, with LaTeX on it; however, it's not quite as portable, and therefore isn't on hand at the moment.

share|improve this question

marked as duplicate by egreg, Mico, cgnieder, Jesse, Malipivo Aug 4 at 10:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

up vote 6 down vote accepted

The date specification has to be of the format YYYY/MM/DD and not YYYY-MM-DD. The following minimal example works as expected:

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{test.sty}
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{test}[2014/08/04 Hello, World!]
\endinput
\end{filecontents*}
\title{LaTeX Testing}
\usepackage{test}

\begin{document}
Hello, World!
\end{document}
share|improve this answer
    
*double facepalm* –  michaelb958 Aug 4 at 7:05

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