Tell me more ×
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.

How to typeset range expressed with dash of two ISO8601 dates ?

2010-01--2012-03

or

2010-01---2012-03

or another option ?

share|improve this question

3 Answers

up vote 20 down vote accepted

Of the two possibilities you offer, the first one — the one with the "en-dash" — is the (much) better one. In good typography, en-dashes are used (inter alia) to denote ranges of numbers, dates, years, etc. In contrast, em-dashes are frequently used to offset auxilliary, explanatory, or parenthetical thoughts. For much more on this subject, check out the question Dashes: - vs. – vs. — and the associated answers.

By the way, to streamline the typesetting of dates in various formats, including ISO 8601, check out the datetime package. For instance, the following MWE

\documentclass{article}
\usepackage{datetime} % http://www.ctan.org/tex-archive/macros/latex/contrib/datetime
\renewcommand{\dateseparator}{-}
\yyyymmdddate % instruction to typeset dates in ISO 8601 format
\begin{document}
\today
\end{document}

will typeset system dates automatically in ISO 8601 format:

enter image description here

share|improve this answer
Wow, one of the upvotes just put my reputation score on this site over the 20K mark. Many thanks for your expressions of confidence! – Mico May 8 '12 at 13:13

This is another method using isodate package. You don't have to worry about things much here.

\documentclass{article}
\usepackage[english,printdayoff]{isodate}
\begin{document}

\isodash{-}%
\noindent
{\isodate
\daterange{1999-05-03}{1999-05-31} \\
\daterange{1999-05-03}{1999-11-03} \\
\daterange{1999-05-03}{2000-04-07}\\
\daterange{2010-01-01}{2012-03-01} 
}
\vspace{1cm}

\noindent
{\origdate
\daterange{1999-05-03}{1999-05-31} \\
\daterange{1999-05-03}{1999-11-03} \\
\daterange{1999-05-03}{2000-04-07} \\
\daterange{2010-01-01}{2012-03-01}
}
\end{document}

enter image description here

share|improve this answer

The usage specified in ISO 8601 is 2010-01/2012-03 for your example. The standard gives the example 1985-04-12/06-25 for a time interval starting at 12 April 1985 and ending on 25 June 1985.

share|improve this answer
Thank you for clarification. I assume question needs clarification. I needed range written with '--' of two dates in ISO8601. However knowledge about proper ISO8601 ranging is important and relevant to topic. – Grzegorz Wierzowiecki May 13 '12 at 19:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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