• No results found

The interval package

N/A
N/A
Protected

Academic year: 2021

Share "The interval package"

Copied!
3
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

The interval package

Lars Madsen

(on behalf of By the Danish TEX collective)

March 6, 2019

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 [a, b] (a, b] [a, b) (a, b), while the other use brackets throughout

[a, b] ]a, b] [a, b[ ]a, b[,

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:

] − a, b[+c versus ]−a, b[ + c.

One could use

\mathopen{]}-a,b\mathclose{[}+c

to solve the problem, but then \left. . . \right can no longer be used to auto scale the fences.

The \interval 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 pgfkeys.

We provide a macro and a way to globally configure it

\interval[hoptionsi]{hstart i}{hend i}

\intervalconfig{hoptionsi}

We note that the interval separator symbol is hidden inside the \interval macro and can be changed using an option.

Email: daleif@math.au.dk, version: v0.4

1

(2)

Configuration options separator symbol

symbol that separates the start and end of the interval. Default: {,}, note that as comma is the separating character in the options specification, the symbol is enclosed in braces, these are automatically removed.

left open fence Default: ] left closed fence

Default: [ right open fence

Default: [ right closed fence

Default: ] soft open fences

This is just a fast way of saying left open fence=(, right open fence=) colorize

Default: hempty i. When rewriting an existing document into using the interval package, it turns out to be very handy to color the result of the

\interval macro to keep track of which have been rewritten and which has not. This can be done using

\usepackage{xcolor}

\intervalconfig{ colorize=\color{red} } It will colorize the entire interval including the fences.

Usage options

By default \interval{hstart i}{hend i} will produce a closed interval. Other types are provided via options:

open

an open interval open left

interval open on the left side open right

interval open on the right side scaled

auto scale interval fences scaled=hscaler i

scale fences using hscaler i, i.e. using scaled=\Big

2

(3)

As some might be guessed, the interval package depends on the pgfkeys pack- age to handle its key-value configuration.

Short hands

For convenience the following short hands are provided as of version 0.4.

\ointerval[hoptionsi]{hstart i}{hend i}

is short for \interval[open,hoptionsi]{hstart i}{hend i}

\linterval[hoptionsi]{hstart i}{hend i}

is short for \interval[open left,hoptionsi]{hstart i}{hend i}

\rinterval[hoptionsi]{hstart i}{hend i}

is short for \interval[open right,hoptionsi]{hstart i}{hend i}

Examples

\ b e g i n { a l i g n *}

& A \ in \ i n t e r v a l { a }{ b } \\

& A \ in \ i n t e r v a l [ o p e n ]{ a }{ b } \\

& A \ in \ i n t e r v a l [ o p e n l e f t ]{ a }{ b } \\

& A \ in \ i n t e r v a l [ o p e n right ,

s c a l e d ]{ a }{\ f r a c { 1 } { 2 } b }= B \\

& A \ in \ i n t e r v a l [ s c a l e d =\ big ]{ a }{ b } \\

& A \ in \ o i n t e r v a l [ s c a l e d ]{%

\ t f r a c { 1 } { 3 } } { \ t f r a c { 1 } { 2 } }

\ end { a l i g n *}

A ∈ [a, b]

A ∈ ]a, b[

A ∈ ]a, b]

A ∈

 a, 1

2 b



= B A ∈ a, b

A ∈ 

1

3

,

12

 And using soft open fences:

\ i n t e r v a l c o n f i g { s o f t o p e n fences , s e p a r a t o r s y m b o l =; , }

\ b e g i n { a l i g n *}

& A \ in \ i n t e r v a l { a }{ b } \\

& A \ in \ i n t e r v a l [ o p e n ]{ a }{ b } \\

& A \ in \ i n t e r v a l [ o p e n l e f t ]{ a }{ b } \\

& A \ in \ i n t e r v a l [ o p e n right ,

s c a l e d ]{ a }{\ f r a c { 1 } { 2 } b }= B \\

& A \ in \ i n t e r v a l [ s c a l e d =\ big ]{ a }{ b } \\

& A \ in \ r i n t e r v a l { a }{ b }

\ end { a l i g n *}

A ∈ [a; b]

A ∈ (a; b) A ∈ (a; b]

A ∈

 a; 1

2 b



= B A ∈ a; b

A ∈ [a; b)

3

Referenties

GERELATEERDE DOCUMENTEN

The smart-eqn package aims to provide an automatic and customizable approach for math symbol styling, which eliminates the need to enter style commands repeatedly..

Shumane (2009) claims that a lack of education and limited.. access to information and resources were some of the barriers that hindered parent school board members’ ability to

Heat maps displaying the average depth of coverage of each nucleotide along the virus genome (X-axis), obtained through read-mapping (1000 replications) of different subset-sizes

So what if we need to push the limits of current CCD and CMOS camera technology and perform high-speed imaging at exposure times shorter than 1 microsecond, and correspondingly at

Questionnaire Structural and Questions Question B Main Topics Expansion Joints 17.3 Crane Bracing Reference Success Numbers Question 17.3: What is done to transfer the end stop

Daarnaast worden alle voor- en nadelen van niet-kerende grondbewerking op een rijtje gezet, onder andere door interviews af te nemen met voor- en tegenstanders.. “Telers

Op basis van de bedrijven in een groep kunnen uitspraken worden gedaan voor de hele groep, doordat door de stratificatie bedrijven uit alle groepen zijn opgenomen kunnen

Voor de boomtelers zorgde het herstel van de markt voor producten voor de consumentenmarkt en voor bos- en haagplantsoen en laan- en parkbomen er voor dat het inkomen stabiel