diff options
author | Karl Berry <karl@freefriends.org> | 2013-05-28 00:19:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-05-28 00:19:26 +0000 |
commit | 087037d946928765bc5098fe2b706601255ecd3d (patch) | |
tree | cda85f30b9bdaa95b3626599aa0e40ade18399d3 /Master/texmf-dist/doc/latex/interval | |
parent | d27eef38ae3949f50534d0d84c3e1e27a08d4a28 (diff) |
interval (24may13)
git-svn-id: svn://tug.org/texlive/trunk@30747 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/interval')
-rw-r--r-- | Master/texmf-dist/doc/latex/interval/interval.pdf | bin | 0 -> 302547 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/interval/interval.tex | 169 |
2 files changed, 169 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/interval/interval.pdf b/Master/texmf-dist/doc/latex/interval/interval.pdf Binary files differnew file mode 100644 index 00000000000..8a728032c54 --- /dev/null +++ b/Master/texmf-dist/doc/latex/interval/interval.pdf diff --git a/Master/texmf-dist/doc/latex/interval/interval.tex b/Master/texmf-dist/doc/latex/interval/interval.tex new file mode 100644 index 00000000000..685cb54c718 --- /dev/null +++ b/Master/texmf-dist/doc/latex/interval/interval.tex @@ -0,0 +1,169 @@ +\documentclass[a4paper,article]{memoir} +\usepackage[T1]{fontenc} +\usepackage{amsmath,enumitem,showexpl} +%\usepackage[scaled]{beramono} +\title{The \textsf{interval} package} +\author{Lars Madsen\thanks{Email: daleif@imf.au.dk}\\ \small (on behalf of By the Danish \TeX\ collective)} +\setsecnumdepth{none} + +%\setlength\overfullrule{5pt} + +\usepackage{interval} + +\begin{document} + +\maketitle + +\section{Motivation} +\label{sec:motivation} + +In mathematics there are two syntax' when it comes to specifying open +and closed intervals. + +The first use parantheses to mark an open end +\begin{align*} + [a,b] \qquad (a,b] \qquad [a,b)\qquad (a,b), +\end{align*} +while the other use brackets throughout +\begin{align*} + [a,b] \qquad ]a,b] \qquad [a,b[\qquad ]a,b[, +\end{align*} + +The former poses no problem in \TeX, but the later does, as, e.g., a +closing bracket is being used in place of an opening fence, and thus +have the wrong category when it comes to spacing: +\begin{align*} + ]-a,b[+c \qquad\text{versus}\qquad \mathopen{]}-a,b\mathclose{[}+c. +\end{align*} + +One could use +\begin{verbatim} +\mathopen{]}-a,b\mathclose{[}+c +\end{verbatim} +to solve the problem, but then \cs{left}\dots\cs{right} can no longer +be used to auto scale the fences. + + + + +\section{The \cs{interval} command} +\label{sec:csinterval-command} + +The following is the result of a discussion on the Danish \TeX\ Users +groups mailing list. Kudos to Martin Heller, for proposing the +original version using \textsf{pgfkeys}. + +We provide a macro and a way to globally configure it +\begin{quote} + \cs{interval}\oarg{options}\marg{start}\marg{end}\\ + \cs{intervalsetup}\marg{options} +\end{quote} +We note that the interval separator symbol is hidden inside the +\cs{interval} macro and can be changed using an option. + +\subsection{Configuration options} +\label{sec:options} + +\begin{description}[style=nextline,font=\sffamily\bfseries] +\item[separator symbol] + symbol that separates the start and end of the interval. Default: + \texttt{\{,\}}, note that as comma is the separating character in the + options specification, the symbol is enclosed in braces, these are + automatically removed. +\item[left open fence] + Default: \texttt{]} +\item[left closed fence] + Default: \texttt{[} +\item[right open fence] + Default: \texttt{[} +\item[right closed fence] + Default: \texttt{]} +\item[soft open fences] + This is just a fast way of saying + \begin{quote} + \ttfamily\obeylines + left open fence=(, + right open fence=) + \end{quote} + +\end{description} + +\subsection{Usage options} + +By default \cs{interval}\marg{start}\marg{end} will produce a closed +interval. Other types are provided via options: + +\begin{description}[style=nextline,font=\sffamily\bfseries] +\item[open] + an open interval +\item[open left] + interval open on the left side +\item[open right] + interval open on the right side +\item[scaled] + auto scale interval fences +\item[scaled=\meta{scaler}] + scale fences using \meta{scaler}, i.e.\ using \texttt{scaled=\cs{Big}} +\end{description} + +\fancybreak{} + +As some might be guessed, the \texttt{interval} package depends on the +\textsf{pgfkeys} package to handle its key-value configuration. + +\newpage + +\section{Examples} +\label{sec:examples} + +% used for showexpl +\lstset{ + explpreset={ + xleftmargin=0em, + columns=fixed, + }, + pos=r, + width=-99pt, + overhang=0pt, + hsep=2\columnsep, + vsep=\bigskipamount, + rframe=x, + basicstyle=\footnotesize\ttfamily, +} + + + +\begin{LTXexample} +\begin{align*} +&A\in\interval{a}{b}\\ +&A\in\interval[open]{a}{b}\\ +&A\in\interval[open left]{a}{b}\\ +&A\in\interval[open right, + scaled]{a}{\frac12b}=B\\ +&A\in\interval[scaled=\big]{a}{b} +\end{align*} +\end{LTXexample} +And using soft open fences: +\begin{LTXexample} +\intervalconfig{ + soft open fences, + separator symbol=;, +} +\begin{align*} +&A\in\interval{a}{b}\\ +&A\in\interval[open]{a}{b}\\ +&A\in\interval[open left]{a}{b}\\ +&A\in\interval[open right, + scaled]{a}{\frac12b}=B\\ +&A\in\interval[scaled=\big]{a}{b} +\end{align*} +\end{LTXexample} + + + +\end{document} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: |