Typesetting an integer interval Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)How can I see the “implementation” of the LaTeX command?How to properly typeset math intervalsvertical spacing in multiline gather with amsmathExtra space between number and variable in math modeCorrectly typesetting a relationUsing the parskip package, I find the space between subtitles uglyToo much space below figuresDecrease horizontal space in moderncv's cvdoubleitemTypesetting longitude or latitude followed by a commaZero space between bars of the same interval in pgfplots ybar interval plotsLarge Brackets Make Line Breaks too SmallTypesetting Hermann-Mauguin notation correctlyHow to increase Chinese character space?
The Nth Gryphon Number
Why do early math courses focus on the cross sections of a cone and not on other 3D objects?
Can a sorcerer use careful spell on himself?
Would it be easier to apply for a UK visa if there is a host family to sponsor for you in going there?
What makes a man succeed?
The test team as an enemy of development? And how can this be avoided?
Project Euler #1 in C++
What does Turing mean by this statement?
Putting class ranking in CV, but against dept guidelines
Random body shuffle every night—can we still function?
How were pictures turned from film to a big picture in a picture frame before digital scanning?
Is there hard evidence that the grant peer review system performs significantly better than random?
Deconstruction is ambiguous
1-probability to calculate two events in a row
How do I find out the mythology and history of my Fortress?
Draw 4 of the same figure in the same tikzpicture
Amount of permutations on an NxNxN Rubik's Cube
How much damage would a cupful of neutron star matter do to the Earth?
How often does castling occur in grandmaster games?
A term for a woman complaining about things/begging in a cute/childish way
Lagrange four-squares theorem --- deterministic complexity
Maximum summed subsequences with non-adjacent items
Do I really need to have a message in a novel to appeal to readers?
What is the meaning of 'breadth' in breadth first search?
Typesetting an integer interval
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)How can I see the “implementation” of the LaTeX command?How to properly typeset math intervalsvertical spacing in multiline gather with amsmathExtra space between number and variable in math modeCorrectly typesetting a relationUsing the parskip package, I find the space between subtitles uglyToo much space below figuresDecrease horizontal space in moderncv's cvdoubleitemTypesetting longitude or latitude followed by a commaZero space between bars of the same interval in pgfplots ybar interval plotsLarge Brackets Make Line Breaks too SmallTypesetting Hermann-Mauguin notation correctlyHow to increase Chinese character space?
I am trying to typeset a integer interval like this: [0..m-1]
However, the space between 0
,.
, and m - 1
are too small. Is there a package to improve this?
spacing
add a comment |
I am trying to typeset a integer interval like this: [0..m-1]
However, the space between 0
,.
, and m - 1
are too small. Is there a package to improve this?
spacing
$[0 dots m-1]$?
– Rmano
Apr 16 '16 at 19:00
3
@Rmano It must be two dots.
– Henricus V.
Apr 16 '16 at 19:01
add a comment |
I am trying to typeset a integer interval like this: [0..m-1]
However, the space between 0
,.
, and m - 1
are too small. Is there a package to improve this?
spacing
I am trying to typeset a integer interval like this: [0..m-1]
However, the space between 0
,.
, and m - 1
are too small. Is there a package to improve this?
spacing
spacing
asked Apr 16 '16 at 18:35
Henricus V.Henricus V.
448412
448412
$[0 dots m-1]$?
– Rmano
Apr 16 '16 at 19:00
3
@Rmano It must be two dots.
– Henricus V.
Apr 16 '16 at 19:01
add a comment |
$[0 dots m-1]$?
– Rmano
Apr 16 '16 at 19:00
3
@Rmano It must be two dots.
– Henricus V.
Apr 16 '16 at 19:01
$[0 dots m-1]$?
– Rmano
Apr 16 '16 at 19:00
$[0 dots m-1]$?
– Rmano
Apr 16 '16 at 19:00
3
3
@Rmano It must be two dots.
– Henricus V.
Apr 16 '16 at 19:01
@Rmano It must be two dots.
– Henricus V.
Apr 16 '16 at 19:01
add a comment |
5 Answers
5
active
oldest
votes
Let's see how I can make a command that is like a dots
but with two dots. Firstly, I use the wisdom of TeX.SE and find how to find the content of a standard definition; then a bit of command line:
[romano:~] % texdef -t latex dots
dots:
macro:->protect dots
dots :
long macro:->ifmmode mathellipsis else textellipsis fi
[romano:~] % texdef -t latex mathellipsis
mathellipsis:
macro:->mathinner ldotp ldotp ldotp
and finally:
newcommandtwodotsmathinner ldotp ldotp
which results in:
(This is just for math mode, but you can easily extend it for text too, mimicking the dots
definition)
add a comment |
I like the two dots, too. My usual code is
[amathrel.,.nobreak b]
of course hidden in a macro.
documentclassarticle
usepackageamsmath
newcommandisepmathrel.,.nobreak
begindocument
$[0isep m-1]$
enddocument
A more elaborate solution for coping with intervals of any kind, while keeping a syntax that doesn't force a choice.
documentclassarticle
usepackageamsmath,mleftright
usepackagexparse
ExplSyntaxOn
NewDocumentCommandintervalO>SplitArgument1,m
group_begin:
keys_set:nn calcolo/interval o, #1
bool_if:NTF l_calcolo_interval_auto_bool
mleftl_calcolo_interval_left_tl
mathopenl_calcolo_interval_size_tll_calcolo_interval_left_tl
calcolo_interval_set:nn #2
bool_if:NTF l_calcolo_interval_auto_bool
mrightl_calcolo_interval_right_tl
mathclosel_calcolo_interval_size_tll_calcolo_interval_right_tl
group_end:
cs_new_protected:Nn calcolo_interval_set:nn
#1 mathrel.,.nobreak #2
keys_define:nn calcolo/interval
size .code:n =
tl_if_eq:nnTF #1 *
bool_set_true:N l_calcolo_interval_auto_bool
tl_set:Nn l_calcolo_interval_size_tl #1 ,
o .code:n =
tl_set:Nn l_calcolo_interval_left_tl (
tl_set:Nn l_calcolo_interval_right_tl ) ,
oo .code:n =
tl_set:Nn l_calcolo_interval_left_tl (
tl_set:Nn l_calcolo_interval_right_tl ) ,
c .code:n =
tl_set:Nn l_calcolo_interval_left_tl [
tl_set:Nn l_calcolo_interval_right_tl ] ,
cc .code:n =
tl_set:Nn l_calcolo_interval_left_tl [
tl_set:Nn l_calcolo_interval_right_tl ] ,
oc .code:n =
tl_set:Nn l_calcolo_interval_left_tl (
tl_set:Nn l_calcolo_interval_right_tl ] ,
co .code:n =
tl_set:Nn l_calcolo_interval_left_tl [
tl_set:Nn l_calcolo_interval_right_tl ) ,
o .value_forbidden:n = true,
oo .value_forbidden:n = true,
c .value_forbidden:n = true,
cc .value_forbidden:n = true,
oc .value_forbidden:n = true,
co .value_forbidden:n = true,
tl_new:N l_calcolo_interval_left_tl
tl_new:N l_calcolo_interval_right_tl
tl_new:N l_calcolo_interval_size_tl
bool_new:N l_calcolo_interval_auto_bool
ExplSyntaxOff
begindocument
$intervala,b$
$interval[c]a,b$
$interval[co]a,b$
$interval[oc]a,b$
$interval[size=Big]a,b$
bigskip
$interval[size=*,co]dfracdfrac12dfrac34,b$
enddocument
add a comment |
Here is a solution with mathtools
and xparse
. I define a command Iintvlm,n
. You need a font which contains the relevant delimiters, llbracket
and rrbracket
(fourier
and stmaryrd
) or equivalents (MnSymbol
and MdSymbol
have lsem
and rsem
). The star version of the command adapts the size of the delimiters to the contents, and you can fine-tune their size with an optional argument (big, Big, …
).
documentclassarticle
usepackagemathtools, stmaryrd
usepackagexparse DeclarePairedDelimiterXIintv[1]llbracketrrbracketiintvargs#1
NewDocumentCommandiintvargs>SplitArgument1,m
iintvargsaux#1 %
NewDocumentCommandiintvargsauxmm #1mkern1.5mu..mkern1.5mu#2
begindocument
[ Iintv-2,5 quad Iintv*2^n, 2^n + 1 quad Iintv*2^2^n + 1, 2^2^n + 1 + 1]
enddocument
add a comment |
Much less robust than others (it can of course be made more robust, but may be this is enough), but it might be nice looking and readable code
defintv#1[#2..#3]mathopen#1[#2mathrel.,.nobreak#3mathclose#1]
$
intv[a..b]
intvbig[a..b]
intvBigg[fracab..c]
$
If you need left[ .. right]
I can add the code.
2
nobreak
is necessary aftermathrel...
or TeX would be allowed to put a line break.
– egreg
Apr 16 '16 at 21:42
Sorry, I definitely tried to copy your output code (while varying the input) but miss that one.
– Manuel
Apr 16 '16 at 21:43
add a comment |
Use enleadertwodots
in the stix
package is perfect (aside from tiny spacing). I've added a couple variations on spacing so you can see how it looks:
documentclass[10pt]article
usepackagestix
begindocument
[[1, enleadertwodots, m-1] quad [1 enleadertwodots, m-1] quad [1 enleadertwodots m-1]]
enddocument
I found this after scanning through this huge list of symbols in latex.
New contributor
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f304662%2ftypesetting-an-integer-interval%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
Let's see how I can make a command that is like a dots
but with two dots. Firstly, I use the wisdom of TeX.SE and find how to find the content of a standard definition; then a bit of command line:
[romano:~] % texdef -t latex dots
dots:
macro:->protect dots
dots :
long macro:->ifmmode mathellipsis else textellipsis fi
[romano:~] % texdef -t latex mathellipsis
mathellipsis:
macro:->mathinner ldotp ldotp ldotp
and finally:
newcommandtwodotsmathinner ldotp ldotp
which results in:
(This is just for math mode, but you can easily extend it for text too, mimicking the dots
definition)
add a comment |
Let's see how I can make a command that is like a dots
but with two dots. Firstly, I use the wisdom of TeX.SE and find how to find the content of a standard definition; then a bit of command line:
[romano:~] % texdef -t latex dots
dots:
macro:->protect dots
dots :
long macro:->ifmmode mathellipsis else textellipsis fi
[romano:~] % texdef -t latex mathellipsis
mathellipsis:
macro:->mathinner ldotp ldotp ldotp
and finally:
newcommandtwodotsmathinner ldotp ldotp
which results in:
(This is just for math mode, but you can easily extend it for text too, mimicking the dots
definition)
add a comment |
Let's see how I can make a command that is like a dots
but with two dots. Firstly, I use the wisdom of TeX.SE and find how to find the content of a standard definition; then a bit of command line:
[romano:~] % texdef -t latex dots
dots:
macro:->protect dots
dots :
long macro:->ifmmode mathellipsis else textellipsis fi
[romano:~] % texdef -t latex mathellipsis
mathellipsis:
macro:->mathinner ldotp ldotp ldotp
and finally:
newcommandtwodotsmathinner ldotp ldotp
which results in:
(This is just for math mode, but you can easily extend it for text too, mimicking the dots
definition)
Let's see how I can make a command that is like a dots
but with two dots. Firstly, I use the wisdom of TeX.SE and find how to find the content of a standard definition; then a bit of command line:
[romano:~] % texdef -t latex dots
dots:
macro:->protect dots
dots :
long macro:->ifmmode mathellipsis else textellipsis fi
[romano:~] % texdef -t latex mathellipsis
mathellipsis:
macro:->mathinner ldotp ldotp ldotp
and finally:
newcommandtwodotsmathinner ldotp ldotp
which results in:
(This is just for math mode, but you can easily extend it for text too, mimicking the dots
definition)
edited Apr 13 '17 at 12:35
Community♦
1
1
answered Apr 16 '16 at 19:14
RmanoRmano
8,28121648
8,28121648
add a comment |
add a comment |
I like the two dots, too. My usual code is
[amathrel.,.nobreak b]
of course hidden in a macro.
documentclassarticle
usepackageamsmath
newcommandisepmathrel.,.nobreak
begindocument
$[0isep m-1]$
enddocument
A more elaborate solution for coping with intervals of any kind, while keeping a syntax that doesn't force a choice.
documentclassarticle
usepackageamsmath,mleftright
usepackagexparse
ExplSyntaxOn
NewDocumentCommandintervalO>SplitArgument1,m
group_begin:
keys_set:nn calcolo/interval o, #1
bool_if:NTF l_calcolo_interval_auto_bool
mleftl_calcolo_interval_left_tl
mathopenl_calcolo_interval_size_tll_calcolo_interval_left_tl
calcolo_interval_set:nn #2
bool_if:NTF l_calcolo_interval_auto_bool
mrightl_calcolo_interval_right_tl
mathclosel_calcolo_interval_size_tll_calcolo_interval_right_tl
group_end:
cs_new_protected:Nn calcolo_interval_set:nn
#1 mathrel.,.nobreak #2
keys_define:nn calcolo/interval
size .code:n =
tl_if_eq:nnTF #1 *
bool_set_true:N l_calcolo_interval_auto_bool
tl_set:Nn l_calcolo_interval_size_tl #1 ,
o .code:n =
tl_set:Nn l_calcolo_interval_left_tl (
tl_set:Nn l_calcolo_interval_right_tl ) ,
oo .code:n =
tl_set:Nn l_calcolo_interval_left_tl (
tl_set:Nn l_calcolo_interval_right_tl ) ,
c .code:n =
tl_set:Nn l_calcolo_interval_left_tl [
tl_set:Nn l_calcolo_interval_right_tl ] ,
cc .code:n =
tl_set:Nn l_calcolo_interval_left_tl [
tl_set:Nn l_calcolo_interval_right_tl ] ,
oc .code:n =
tl_set:Nn l_calcolo_interval_left_tl (
tl_set:Nn l_calcolo_interval_right_tl ] ,
co .code:n =
tl_set:Nn l_calcolo_interval_left_tl [
tl_set:Nn l_calcolo_interval_right_tl ) ,
o .value_forbidden:n = true,
oo .value_forbidden:n = true,
c .value_forbidden:n = true,
cc .value_forbidden:n = true,
oc .value_forbidden:n = true,
co .value_forbidden:n = true,
tl_new:N l_calcolo_interval_left_tl
tl_new:N l_calcolo_interval_right_tl
tl_new:N l_calcolo_interval_size_tl
bool_new:N l_calcolo_interval_auto_bool
ExplSyntaxOff
begindocument
$intervala,b$
$interval[c]a,b$
$interval[co]a,b$
$interval[oc]a,b$
$interval[size=Big]a,b$
bigskip
$interval[size=*,co]dfracdfrac12dfrac34,b$
enddocument
add a comment |
I like the two dots, too. My usual code is
[amathrel.,.nobreak b]
of course hidden in a macro.
documentclassarticle
usepackageamsmath
newcommandisepmathrel.,.nobreak
begindocument
$[0isep m-1]$
enddocument
A more elaborate solution for coping with intervals of any kind, while keeping a syntax that doesn't force a choice.
documentclassarticle
usepackageamsmath,mleftright
usepackagexparse
ExplSyntaxOn
NewDocumentCommandintervalO>SplitArgument1,m
group_begin:
keys_set:nn calcolo/interval o, #1
bool_if:NTF l_calcolo_interval_auto_bool
mleftl_calcolo_interval_left_tl
mathopenl_calcolo_interval_size_tll_calcolo_interval_left_tl
calcolo_interval_set:nn #2
bool_if:NTF l_calcolo_interval_auto_bool
mrightl_calcolo_interval_right_tl
mathclosel_calcolo_interval_size_tll_calcolo_interval_right_tl
group_end:
cs_new_protected:Nn calcolo_interval_set:nn
#1 mathrel.,.nobreak #2
keys_define:nn calcolo/interval
size .code:n =
tl_if_eq:nnTF #1 *
bool_set_true:N l_calcolo_interval_auto_bool
tl_set:Nn l_calcolo_interval_size_tl #1 ,
o .code:n =
tl_set:Nn l_calcolo_interval_left_tl (
tl_set:Nn l_calcolo_interval_right_tl ) ,
oo .code:n =
tl_set:Nn l_calcolo_interval_left_tl (
tl_set:Nn l_calcolo_interval_right_tl ) ,
c .code:n =
tl_set:Nn l_calcolo_interval_left_tl [
tl_set:Nn l_calcolo_interval_right_tl ] ,
cc .code:n =
tl_set:Nn l_calcolo_interval_left_tl [
tl_set:Nn l_calcolo_interval_right_tl ] ,
oc .code:n =
tl_set:Nn l_calcolo_interval_left_tl (
tl_set:Nn l_calcolo_interval_right_tl ] ,
co .code:n =
tl_set:Nn l_calcolo_interval_left_tl [
tl_set:Nn l_calcolo_interval_right_tl ) ,
o .value_forbidden:n = true,
oo .value_forbidden:n = true,
c .value_forbidden:n = true,
cc .value_forbidden:n = true,
oc .value_forbidden:n = true,
co .value_forbidden:n = true,
tl_new:N l_calcolo_interval_left_tl
tl_new:N l_calcolo_interval_right_tl
tl_new:N l_calcolo_interval_size_tl
bool_new:N l_calcolo_interval_auto_bool
ExplSyntaxOff
begindocument
$intervala,b$
$interval[c]a,b$
$interval[co]a,b$
$interval[oc]a,b$
$interval[size=Big]a,b$
bigskip
$interval[size=*,co]dfracdfrac12dfrac34,b$
enddocument
add a comment |
I like the two dots, too. My usual code is
[amathrel.,.nobreak b]
of course hidden in a macro.
documentclassarticle
usepackageamsmath
newcommandisepmathrel.,.nobreak
begindocument
$[0isep m-1]$
enddocument
A more elaborate solution for coping with intervals of any kind, while keeping a syntax that doesn't force a choice.
documentclassarticle
usepackageamsmath,mleftright
usepackagexparse
ExplSyntaxOn
NewDocumentCommandintervalO>SplitArgument1,m
group_begin:
keys_set:nn calcolo/interval o, #1
bool_if:NTF l_calcolo_interval_auto_bool
mleftl_calcolo_interval_left_tl
mathopenl_calcolo_interval_size_tll_calcolo_interval_left_tl
calcolo_interval_set:nn #2
bool_if:NTF l_calcolo_interval_auto_bool
mrightl_calcolo_interval_right_tl
mathclosel_calcolo_interval_size_tll_calcolo_interval_right_tl
group_end:
cs_new_protected:Nn calcolo_interval_set:nn
#1 mathrel.,.nobreak #2
keys_define:nn calcolo/interval
size .code:n =
tl_if_eq:nnTF #1 *
bool_set_true:N l_calcolo_interval_auto_bool
tl_set:Nn l_calcolo_interval_size_tl #1 ,
o .code:n =
tl_set:Nn l_calcolo_interval_left_tl (
tl_set:Nn l_calcolo_interval_right_tl ) ,
oo .code:n =
tl_set:Nn l_calcolo_interval_left_tl (
tl_set:Nn l_calcolo_interval_right_tl ) ,
c .code:n =
tl_set:Nn l_calcolo_interval_left_tl [
tl_set:Nn l_calcolo_interval_right_tl ] ,
cc .code:n =
tl_set:Nn l_calcolo_interval_left_tl [
tl_set:Nn l_calcolo_interval_right_tl ] ,
oc .code:n =
tl_set:Nn l_calcolo_interval_left_tl (
tl_set:Nn l_calcolo_interval_right_tl ] ,
co .code:n =
tl_set:Nn l_calcolo_interval_left_tl [
tl_set:Nn l_calcolo_interval_right_tl ) ,
o .value_forbidden:n = true,
oo .value_forbidden:n = true,
c .value_forbidden:n = true,
cc .value_forbidden:n = true,
oc .value_forbidden:n = true,
co .value_forbidden:n = true,
tl_new:N l_calcolo_interval_left_tl
tl_new:N l_calcolo_interval_right_tl
tl_new:N l_calcolo_interval_size_tl
bool_new:N l_calcolo_interval_auto_bool
ExplSyntaxOff
begindocument
$intervala,b$
$interval[c]a,b$
$interval[co]a,b$
$interval[oc]a,b$
$interval[size=Big]a,b$
bigskip
$interval[size=*,co]dfracdfrac12dfrac34,b$
enddocument
I like the two dots, too. My usual code is
[amathrel.,.nobreak b]
of course hidden in a macro.
documentclassarticle
usepackageamsmath
newcommandisepmathrel.,.nobreak
begindocument
$[0isep m-1]$
enddocument
A more elaborate solution for coping with intervals of any kind, while keeping a syntax that doesn't force a choice.
documentclassarticle
usepackageamsmath,mleftright
usepackagexparse
ExplSyntaxOn
NewDocumentCommandintervalO>SplitArgument1,m
group_begin:
keys_set:nn calcolo/interval o, #1
bool_if:NTF l_calcolo_interval_auto_bool
mleftl_calcolo_interval_left_tl
mathopenl_calcolo_interval_size_tll_calcolo_interval_left_tl
calcolo_interval_set:nn #2
bool_if:NTF l_calcolo_interval_auto_bool
mrightl_calcolo_interval_right_tl
mathclosel_calcolo_interval_size_tll_calcolo_interval_right_tl
group_end:
cs_new_protected:Nn calcolo_interval_set:nn
#1 mathrel.,.nobreak #2
keys_define:nn calcolo/interval
size .code:n =
tl_if_eq:nnTF #1 *
bool_set_true:N l_calcolo_interval_auto_bool
tl_set:Nn l_calcolo_interval_size_tl #1 ,
o .code:n =
tl_set:Nn l_calcolo_interval_left_tl (
tl_set:Nn l_calcolo_interval_right_tl ) ,
oo .code:n =
tl_set:Nn l_calcolo_interval_left_tl (
tl_set:Nn l_calcolo_interval_right_tl ) ,
c .code:n =
tl_set:Nn l_calcolo_interval_left_tl [
tl_set:Nn l_calcolo_interval_right_tl ] ,
cc .code:n =
tl_set:Nn l_calcolo_interval_left_tl [
tl_set:Nn l_calcolo_interval_right_tl ] ,
oc .code:n =
tl_set:Nn l_calcolo_interval_left_tl (
tl_set:Nn l_calcolo_interval_right_tl ] ,
co .code:n =
tl_set:Nn l_calcolo_interval_left_tl [
tl_set:Nn l_calcolo_interval_right_tl ) ,
o .value_forbidden:n = true,
oo .value_forbidden:n = true,
c .value_forbidden:n = true,
cc .value_forbidden:n = true,
oc .value_forbidden:n = true,
co .value_forbidden:n = true,
tl_new:N l_calcolo_interval_left_tl
tl_new:N l_calcolo_interval_right_tl
tl_new:N l_calcolo_interval_size_tl
bool_new:N l_calcolo_interval_auto_bool
ExplSyntaxOff
begindocument
$intervala,b$
$interval[c]a,b$
$interval[co]a,b$
$interval[oc]a,b$
$interval[size=Big]a,b$
bigskip
$interval[size=*,co]dfracdfrac12dfrac34,b$
enddocument
edited Apr 16 '16 at 20:18
AboAmmar
34.7k32985
34.7k32985
answered Apr 16 '16 at 19:33
egregegreg
735k8919343259
735k8919343259
add a comment |
add a comment |
Here is a solution with mathtools
and xparse
. I define a command Iintvlm,n
. You need a font which contains the relevant delimiters, llbracket
and rrbracket
(fourier
and stmaryrd
) or equivalents (MnSymbol
and MdSymbol
have lsem
and rsem
). The star version of the command adapts the size of the delimiters to the contents, and you can fine-tune their size with an optional argument (big, Big, …
).
documentclassarticle
usepackagemathtools, stmaryrd
usepackagexparse DeclarePairedDelimiterXIintv[1]llbracketrrbracketiintvargs#1
NewDocumentCommandiintvargs>SplitArgument1,m
iintvargsaux#1 %
NewDocumentCommandiintvargsauxmm #1mkern1.5mu..mkern1.5mu#2
begindocument
[ Iintv-2,5 quad Iintv*2^n, 2^n + 1 quad Iintv*2^2^n + 1, 2^2^n + 1 + 1]
enddocument
add a comment |
Here is a solution with mathtools
and xparse
. I define a command Iintvlm,n
. You need a font which contains the relevant delimiters, llbracket
and rrbracket
(fourier
and stmaryrd
) or equivalents (MnSymbol
and MdSymbol
have lsem
and rsem
). The star version of the command adapts the size of the delimiters to the contents, and you can fine-tune their size with an optional argument (big, Big, …
).
documentclassarticle
usepackagemathtools, stmaryrd
usepackagexparse DeclarePairedDelimiterXIintv[1]llbracketrrbracketiintvargs#1
NewDocumentCommandiintvargs>SplitArgument1,m
iintvargsaux#1 %
NewDocumentCommandiintvargsauxmm #1mkern1.5mu..mkern1.5mu#2
begindocument
[ Iintv-2,5 quad Iintv*2^n, 2^n + 1 quad Iintv*2^2^n + 1, 2^2^n + 1 + 1]
enddocument
add a comment |
Here is a solution with mathtools
and xparse
. I define a command Iintvlm,n
. You need a font which contains the relevant delimiters, llbracket
and rrbracket
(fourier
and stmaryrd
) or equivalents (MnSymbol
and MdSymbol
have lsem
and rsem
). The star version of the command adapts the size of the delimiters to the contents, and you can fine-tune their size with an optional argument (big, Big, …
).
documentclassarticle
usepackagemathtools, stmaryrd
usepackagexparse DeclarePairedDelimiterXIintv[1]llbracketrrbracketiintvargs#1
NewDocumentCommandiintvargs>SplitArgument1,m
iintvargsaux#1 %
NewDocumentCommandiintvargsauxmm #1mkern1.5mu..mkern1.5mu#2
begindocument
[ Iintv-2,5 quad Iintv*2^n, 2^n + 1 quad Iintv*2^2^n + 1, 2^2^n + 1 + 1]
enddocument
Here is a solution with mathtools
and xparse
. I define a command Iintvlm,n
. You need a font which contains the relevant delimiters, llbracket
and rrbracket
(fourier
and stmaryrd
) or equivalents (MnSymbol
and MdSymbol
have lsem
and rsem
). The star version of the command adapts the size of the delimiters to the contents, and you can fine-tune their size with an optional argument (big, Big, …
).
documentclassarticle
usepackagemathtools, stmaryrd
usepackagexparse DeclarePairedDelimiterXIintv[1]llbracketrrbracketiintvargs#1
NewDocumentCommandiintvargs>SplitArgument1,m
iintvargsaux#1 %
NewDocumentCommandiintvargsauxmm #1mkern1.5mu..mkern1.5mu#2
begindocument
[ Iintv-2,5 quad Iintv*2^n, 2^n + 1 quad Iintv*2^2^n + 1, 2^2^n + 1 + 1]
enddocument
answered Apr 16 '16 at 19:15
BernardBernard
176k778210
176k778210
add a comment |
add a comment |
Much less robust than others (it can of course be made more robust, but may be this is enough), but it might be nice looking and readable code
defintv#1[#2..#3]mathopen#1[#2mathrel.,.nobreak#3mathclose#1]
$
intv[a..b]
intvbig[a..b]
intvBigg[fracab..c]
$
If you need left[ .. right]
I can add the code.
2
nobreak
is necessary aftermathrel...
or TeX would be allowed to put a line break.
– egreg
Apr 16 '16 at 21:42
Sorry, I definitely tried to copy your output code (while varying the input) but miss that one.
– Manuel
Apr 16 '16 at 21:43
add a comment |
Much less robust than others (it can of course be made more robust, but may be this is enough), but it might be nice looking and readable code
defintv#1[#2..#3]mathopen#1[#2mathrel.,.nobreak#3mathclose#1]
$
intv[a..b]
intvbig[a..b]
intvBigg[fracab..c]
$
If you need left[ .. right]
I can add the code.
2
nobreak
is necessary aftermathrel...
or TeX would be allowed to put a line break.
– egreg
Apr 16 '16 at 21:42
Sorry, I definitely tried to copy your output code (while varying the input) but miss that one.
– Manuel
Apr 16 '16 at 21:43
add a comment |
Much less robust than others (it can of course be made more robust, but may be this is enough), but it might be nice looking and readable code
defintv#1[#2..#3]mathopen#1[#2mathrel.,.nobreak#3mathclose#1]
$
intv[a..b]
intvbig[a..b]
intvBigg[fracab..c]
$
If you need left[ .. right]
I can add the code.
Much less robust than others (it can of course be made more robust, but may be this is enough), but it might be nice looking and readable code
defintv#1[#2..#3]mathopen#1[#2mathrel.,.nobreak#3mathclose#1]
$
intv[a..b]
intvbig[a..b]
intvBigg[fracab..c]
$
If you need left[ .. right]
I can add the code.
edited Apr 16 '16 at 21:44
answered Apr 16 '16 at 21:16
ManuelManuel
21.6k847109
21.6k847109
2
nobreak
is necessary aftermathrel...
or TeX would be allowed to put a line break.
– egreg
Apr 16 '16 at 21:42
Sorry, I definitely tried to copy your output code (while varying the input) but miss that one.
– Manuel
Apr 16 '16 at 21:43
add a comment |
2
nobreak
is necessary aftermathrel...
or TeX would be allowed to put a line break.
– egreg
Apr 16 '16 at 21:42
Sorry, I definitely tried to copy your output code (while varying the input) but miss that one.
– Manuel
Apr 16 '16 at 21:43
2
2
nobreak
is necessary after mathrel...
or TeX would be allowed to put a line break.– egreg
Apr 16 '16 at 21:42
nobreak
is necessary after mathrel...
or TeX would be allowed to put a line break.– egreg
Apr 16 '16 at 21:42
Sorry, I definitely tried to copy your output code (while varying the input) but miss that one.
– Manuel
Apr 16 '16 at 21:43
Sorry, I definitely tried to copy your output code (while varying the input) but miss that one.
– Manuel
Apr 16 '16 at 21:43
add a comment |
Use enleadertwodots
in the stix
package is perfect (aside from tiny spacing). I've added a couple variations on spacing so you can see how it looks:
documentclass[10pt]article
usepackagestix
begindocument
[[1, enleadertwodots, m-1] quad [1 enleadertwodots, m-1] quad [1 enleadertwodots m-1]]
enddocument
I found this after scanning through this huge list of symbols in latex.
New contributor
add a comment |
Use enleadertwodots
in the stix
package is perfect (aside from tiny spacing). I've added a couple variations on spacing so you can see how it looks:
documentclass[10pt]article
usepackagestix
begindocument
[[1, enleadertwodots, m-1] quad [1 enleadertwodots, m-1] quad [1 enleadertwodots m-1]]
enddocument
I found this after scanning through this huge list of symbols in latex.
New contributor
add a comment |
Use enleadertwodots
in the stix
package is perfect (aside from tiny spacing). I've added a couple variations on spacing so you can see how it looks:
documentclass[10pt]article
usepackagestix
begindocument
[[1, enleadertwodots, m-1] quad [1 enleadertwodots, m-1] quad [1 enleadertwodots m-1]]
enddocument
I found this after scanning through this huge list of symbols in latex.
New contributor
Use enleadertwodots
in the stix
package is perfect (aside from tiny spacing). I've added a couple variations on spacing so you can see how it looks:
documentclass[10pt]article
usepackagestix
begindocument
[[1, enleadertwodots, m-1] quad [1 enleadertwodots, m-1] quad [1 enleadertwodots m-1]]
enddocument
I found this after scanning through this huge list of symbols in latex.
New contributor
New contributor
answered 13 mins ago
ryanryan
1012
1012
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f304662%2ftypesetting-an-integer-interval%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$[0 dots m-1]$?
– Rmano
Apr 16 '16 at 19:00
3
@Rmano It must be two dots.
– Henricus V.
Apr 16 '16 at 19:01