Spacing setting of math modeCunning (La)TeX tricksHow do I disregard automatic spacing between characters in math mode?How to get less spacing in math modeMath mode: Spacing after SuperscriptsGlobally changing math line spacinglock spacing in math modeSetting a default horizontal spacing value for math modeHorizontal spacing in “align” modeAuto spacing in math modeSpacing around variables in math-modeDebugging - spacing in math mode
Using "Kollege" as "university friend"?
How can I create a shape in Illustrator which follows a path in descending order size?
Which creatures count as green creatures?
How to sort and filter a constantly changing list of data?
Moving files accidentally to an not existing directory erases files?
How to write a sincerely religious protagonist without preaching or affirming or judging their worldview?
Is Grandpa Irrational? Another Grandpa Mystery
Where is this photo of a group of hikers taken? Is it really in the Ural?
What is the difference between 1/3, 1/2, and full casters?
Can GPL and BSD licensed applications be used for government work?
how to add 1 milliseconds on a datetime string?
Invert Some Switches on a Switchboard
Terence Tao - type books in other fields?
What is a reasonable time for modern human society to adapt to dungeons?
What is the meaning of "a thinly disguised price"?
Keeping an "hot eyeball planet" wet
Are gangsters hired to attack people at a train station classified as a terrorist attack?
kids pooling money for Lego League and taxes
Why no ";" after "do" in sh loops?
How do professional electronic musicians/sound engineers combat listening fatigue?
How can I make sure my players' decisions have consequences?
Very basic singly linked list
Should I leave my PhD after 3 years with a Masters?
How can I prevent corporations from growing their own workforce?
Spacing setting of math mode
Cunning (La)TeX tricksHow do I disregard automatic spacing between characters in math mode?How to get less spacing in math modeMath mode: Spacing after SuperscriptsGlobally changing math line spacinglock spacing in math modeSetting a default horizontal spacing value for math modeHorizontal spacing in “align” modeAuto spacing in math modeSpacing around variables in math-modeDebugging - spacing in math mode
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
In typing of an article, I need to type many formulas like
$ left( a, b,c,d | e,f,g,h right) $.
Since they are too tight, I should add space using ,
command to obtain
$ left( a, , b, , c, , d | e, , f, , g, , h right) $.
But my problem is there are too many of such formulas. Is there any command which changes the default spacing between characters in the math mode?
math-mode spacing
add a comment |
In typing of an article, I need to type many formulas like
$ left( a, b,c,d | e,f,g,h right) $.
Since they are too tight, I should add space using ,
command to obtain
$ left( a, , b, , c, , d | e, , f, , g, , h right) $.
But my problem is there are too many of such formulas. Is there any command which changes the default spacing between characters in the math mode?
math-mode spacing
[beginpmatrixa&b&c&d&e&f&g&hendpmatrix]
(don't forget to addusepackageamsmath
to the preamble) could be an option.
– manooooh
8 hours ago
add a comment |
In typing of an article, I need to type many formulas like
$ left( a, b,c,d | e,f,g,h right) $.
Since they are too tight, I should add space using ,
command to obtain
$ left( a, , b, , c, , d | e, , f, , g, , h right) $.
But my problem is there are too many of such formulas. Is there any command which changes the default spacing between characters in the math mode?
math-mode spacing
In typing of an article, I need to type many formulas like
$ left( a, b,c,d | e,f,g,h right) $.
Since they are too tight, I should add space using ,
command to obtain
$ left( a, , b, , c, , d | e, , f, , g, , h right) $.
But my problem is there are too many of such formulas. Is there any command which changes the default spacing between characters in the math mode?
math-mode spacing
math-mode spacing
edited 8 hours ago
leandriis
16.9k1 gold badge11 silver badges36 bronze badges
16.9k1 gold badge11 silver badges36 bronze badges
asked 8 hours ago
HS8637HS8637
2941 silver badge6 bronze badges
2941 silver badge6 bronze badges
[beginpmatrixa&b&c&d&e&f&g&hendpmatrix]
(don't forget to addusepackageamsmath
to the preamble) could be an option.
– manooooh
8 hours ago
add a comment |
[beginpmatrixa&b&c&d&e&f&g&hendpmatrix]
(don't forget to addusepackageamsmath
to the preamble) could be an option.
– manooooh
8 hours ago
[beginpmatrixa&b&c&d&e&f&g&hendpmatrix]
(don't forget to add usepackageamsmath
to the preamble) could be an option.– manooooh
8 hours ago
[beginpmatrixa&b&c&d&e&f&g&hendpmatrix]
(don't forget to add usepackageamsmath
to the preamble) could be an option.– manooooh
8 hours ago
add a comment |
2 Answers
2
active
oldest
votes
Assuming you don't need the thing in subscripts or superscripts, the easiest way is to exit from math mode, doubling the thinmuskip
, reentering math mode, typesetting the lists and go back.
documentclassarticle
usepackageamsmath
newcommandcls[2]%
mathordmbox%
thinmuskip=2thinmuskip
$(#1mid#2)$%
%
begindocument
$( a, b,c,d mid e,f,g,h)$
$(a,, b,, c,, d mid e,, f,, g,, h)$
$clsa,b,c,de,f,g,h$
enddocument
A different solution that allows for resizing the parentheses as usual for commands defined with DeclarePairedDelimiter
, see the examples. It also has a friendlier syntax.
documentclassarticle
usepackageamsmath
usepackagexparse
AtBeginDocumentmathchardefclscomma=mathcode`,
ExplSyntaxOn
NewDocumentCommandclssom
group_begin:
IfBooleanTF#1
hs_cls_auto:n #3
hs_cls_manual:nn #2 #3
group_end:
cs_new_protected:Nn hs_cls_auto:n
__hs_cls_activate_comma:
__hs_cls_activate_bar:n ;middlevert;
left( #1 right)
cs_new_protected:Nn hs_cls_manual:nn
__hs_cls_activate_comma:
__hs_cls_activate_bar:n __hs_cls_mid:n #1
__hs_cls_open:n #1 #2 __hs_cls_close:n #1
cs_new_protected:Nn __hs_cls_activate_comma:
char_set_active_eq:nN `, __hs_cls_comma:
mathcode`,="8000 scan_stop:
cs_new_protected:Nn __hs_cls_comma: clscomma,
cs_new_protected:Nn __hs_cls_activate_bar:n
cs_set_protected:Nn __hs_cls_bar: #1
char_set_active_eq:nN ` __hs_cls_bar:
mathcode`
cs_new_protected:Nn __hs_cls_open:n
tl_if_novalue:nTF #1 ( mathopen#1(
cs_new_protected:Nn __hs_cls_mid:n
tl_if_novalue:nTF #1 mid mathrel#1vert
cs_new_protected:Nn __hs_cls_close:n
tl_if_novalue:nTF #1 ) mathclose#1)
ExplSyntaxOff
begindocument
$( a, b,c,d mid e,f,g,h)$
$(a,, b,, c,, d mid e,, f,, g,, h)$
$clsa,b,c,d$
$cls[Big]a,b,c,d$
$cls*dfraca2,b,c,d$
enddocument
Thanks for your comments and answers but I need a more general command ofthinmuskip=2thinmuskip
– HS8637
8 hours ago
@HS8637 Why? A comma is followed by a thin space and,
inserts another thin space; the thin space has widththinmuskip
, so you get exactly the same output with my code and with,,
all around.
– egreg
8 hours ago
Dear @egreg. You're right. But I need to change the setting of spacing, not an especial case.
– HS8637
7 hours ago
@HS8637 Reread your question. Those are the formulas you mention. Changing in general the spacing after commas is not something I'd recommend.
– egreg
7 hours ago
@egreg Thanks for adding the LaTeX3 code, it is full of little interesting things!
– frougon
5 hours ago
add a comment |
You can process each of the two lists (left and right) using etoolbox
and a cunning delimiter trick:
documentclassarticle
usepackageetoolbox
% https://tex.stackexchange.com/a/89187/5764
newcommandprintlist[2][,]%
defitemdelimdefitemdelim#1% Item delimiter delayed by one cycle
renewcommand*do[1]itemdelim##1% How each item is processed
docsvlist#2% Process CSV list
makeatletter
def@LandR#1|#2relaxdefleftlist#1defrightlist#2%
defLandR#1%
@LandR#1relax
left( % Left bracket
edefxnoexpandprintlist[,,]leftlistx
,middle
makeatother
begindocument
$left( a, b, c, d | e, f, g, h right)$
$LandRa, b, c, d $
enddocument
Each list is printed using printlist[,,]
, which adds a small space ,
after each delimiter ,
. You can adjust the layout of the left/right bracket and middle divider.
If you wish to include larger constructions, you may need to use noexpand
, as in
LandRnoexpandfracab, c, d, e
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%2f501447%2fspacing-setting-of-math-mode%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Assuming you don't need the thing in subscripts or superscripts, the easiest way is to exit from math mode, doubling the thinmuskip
, reentering math mode, typesetting the lists and go back.
documentclassarticle
usepackageamsmath
newcommandcls[2]%
mathordmbox%
thinmuskip=2thinmuskip
$(#1mid#2)$%
%
begindocument
$( a, b,c,d mid e,f,g,h)$
$(a,, b,, c,, d mid e,, f,, g,, h)$
$clsa,b,c,de,f,g,h$
enddocument
A different solution that allows for resizing the parentheses as usual for commands defined with DeclarePairedDelimiter
, see the examples. It also has a friendlier syntax.
documentclassarticle
usepackageamsmath
usepackagexparse
AtBeginDocumentmathchardefclscomma=mathcode`,
ExplSyntaxOn
NewDocumentCommandclssom
group_begin:
IfBooleanTF#1
hs_cls_auto:n #3
hs_cls_manual:nn #2 #3
group_end:
cs_new_protected:Nn hs_cls_auto:n
__hs_cls_activate_comma:
__hs_cls_activate_bar:n ;middlevert;
left( #1 right)
cs_new_protected:Nn hs_cls_manual:nn
__hs_cls_activate_comma:
__hs_cls_activate_bar:n __hs_cls_mid:n #1
__hs_cls_open:n #1 #2 __hs_cls_close:n #1
cs_new_protected:Nn __hs_cls_activate_comma:
char_set_active_eq:nN `, __hs_cls_comma:
mathcode`,="8000 scan_stop:
cs_new_protected:Nn __hs_cls_comma: clscomma,
cs_new_protected:Nn __hs_cls_activate_bar:n
cs_set_protected:Nn __hs_cls_bar: #1
char_set_active_eq:nN ` __hs_cls_bar:
mathcode`
cs_new_protected:Nn __hs_cls_open:n
tl_if_novalue:nTF #1 ( mathopen#1(
cs_new_protected:Nn __hs_cls_mid:n
tl_if_novalue:nTF #1 mid mathrel#1vert
cs_new_protected:Nn __hs_cls_close:n
tl_if_novalue:nTF #1 ) mathclose#1)
ExplSyntaxOff
begindocument
$( a, b,c,d mid e,f,g,h)$
$(a,, b,, c,, d mid e,, f,, g,, h)$
$clsa,b,c,d$
$cls[Big]a,b,c,d$
$cls*dfraca2,b,c,d$
enddocument
Thanks for your comments and answers but I need a more general command ofthinmuskip=2thinmuskip
– HS8637
8 hours ago
@HS8637 Why? A comma is followed by a thin space and,
inserts another thin space; the thin space has widththinmuskip
, so you get exactly the same output with my code and with,,
all around.
– egreg
8 hours ago
Dear @egreg. You're right. But I need to change the setting of spacing, not an especial case.
– HS8637
7 hours ago
@HS8637 Reread your question. Those are the formulas you mention. Changing in general the spacing after commas is not something I'd recommend.
– egreg
7 hours ago
@egreg Thanks for adding the LaTeX3 code, it is full of little interesting things!
– frougon
5 hours ago
add a comment |
Assuming you don't need the thing in subscripts or superscripts, the easiest way is to exit from math mode, doubling the thinmuskip
, reentering math mode, typesetting the lists and go back.
documentclassarticle
usepackageamsmath
newcommandcls[2]%
mathordmbox%
thinmuskip=2thinmuskip
$(#1mid#2)$%
%
begindocument
$( a, b,c,d mid e,f,g,h)$
$(a,, b,, c,, d mid e,, f,, g,, h)$
$clsa,b,c,de,f,g,h$
enddocument
A different solution that allows for resizing the parentheses as usual for commands defined with DeclarePairedDelimiter
, see the examples. It also has a friendlier syntax.
documentclassarticle
usepackageamsmath
usepackagexparse
AtBeginDocumentmathchardefclscomma=mathcode`,
ExplSyntaxOn
NewDocumentCommandclssom
group_begin:
IfBooleanTF#1
hs_cls_auto:n #3
hs_cls_manual:nn #2 #3
group_end:
cs_new_protected:Nn hs_cls_auto:n
__hs_cls_activate_comma:
__hs_cls_activate_bar:n ;middlevert;
left( #1 right)
cs_new_protected:Nn hs_cls_manual:nn
__hs_cls_activate_comma:
__hs_cls_activate_bar:n __hs_cls_mid:n #1
__hs_cls_open:n #1 #2 __hs_cls_close:n #1
cs_new_protected:Nn __hs_cls_activate_comma:
char_set_active_eq:nN `, __hs_cls_comma:
mathcode`,="8000 scan_stop:
cs_new_protected:Nn __hs_cls_comma: clscomma,
cs_new_protected:Nn __hs_cls_activate_bar:n
cs_set_protected:Nn __hs_cls_bar: #1
char_set_active_eq:nN ` __hs_cls_bar:
mathcode`
cs_new_protected:Nn __hs_cls_open:n
tl_if_novalue:nTF #1 ( mathopen#1(
cs_new_protected:Nn __hs_cls_mid:n
tl_if_novalue:nTF #1 mid mathrel#1vert
cs_new_protected:Nn __hs_cls_close:n
tl_if_novalue:nTF #1 ) mathclose#1)
ExplSyntaxOff
begindocument
$( a, b,c,d mid e,f,g,h)$
$(a,, b,, c,, d mid e,, f,, g,, h)$
$clsa,b,c,d$
$cls[Big]a,b,c,d$
$cls*dfraca2,b,c,d$
enddocument
Thanks for your comments and answers but I need a more general command ofthinmuskip=2thinmuskip
– HS8637
8 hours ago
@HS8637 Why? A comma is followed by a thin space and,
inserts another thin space; the thin space has widththinmuskip
, so you get exactly the same output with my code and with,,
all around.
– egreg
8 hours ago
Dear @egreg. You're right. But I need to change the setting of spacing, not an especial case.
– HS8637
7 hours ago
@HS8637 Reread your question. Those are the formulas you mention. Changing in general the spacing after commas is not something I'd recommend.
– egreg
7 hours ago
@egreg Thanks for adding the LaTeX3 code, it is full of little interesting things!
– frougon
5 hours ago
add a comment |
Assuming you don't need the thing in subscripts or superscripts, the easiest way is to exit from math mode, doubling the thinmuskip
, reentering math mode, typesetting the lists and go back.
documentclassarticle
usepackageamsmath
newcommandcls[2]%
mathordmbox%
thinmuskip=2thinmuskip
$(#1mid#2)$%
%
begindocument
$( a, b,c,d mid e,f,g,h)$
$(a,, b,, c,, d mid e,, f,, g,, h)$
$clsa,b,c,de,f,g,h$
enddocument
A different solution that allows for resizing the parentheses as usual for commands defined with DeclarePairedDelimiter
, see the examples. It also has a friendlier syntax.
documentclassarticle
usepackageamsmath
usepackagexparse
AtBeginDocumentmathchardefclscomma=mathcode`,
ExplSyntaxOn
NewDocumentCommandclssom
group_begin:
IfBooleanTF#1
hs_cls_auto:n #3
hs_cls_manual:nn #2 #3
group_end:
cs_new_protected:Nn hs_cls_auto:n
__hs_cls_activate_comma:
__hs_cls_activate_bar:n ;middlevert;
left( #1 right)
cs_new_protected:Nn hs_cls_manual:nn
__hs_cls_activate_comma:
__hs_cls_activate_bar:n __hs_cls_mid:n #1
__hs_cls_open:n #1 #2 __hs_cls_close:n #1
cs_new_protected:Nn __hs_cls_activate_comma:
char_set_active_eq:nN `, __hs_cls_comma:
mathcode`,="8000 scan_stop:
cs_new_protected:Nn __hs_cls_comma: clscomma,
cs_new_protected:Nn __hs_cls_activate_bar:n
cs_set_protected:Nn __hs_cls_bar: #1
char_set_active_eq:nN ` __hs_cls_bar:
mathcode`
cs_new_protected:Nn __hs_cls_open:n
tl_if_novalue:nTF #1 ( mathopen#1(
cs_new_protected:Nn __hs_cls_mid:n
tl_if_novalue:nTF #1 mid mathrel#1vert
cs_new_protected:Nn __hs_cls_close:n
tl_if_novalue:nTF #1 ) mathclose#1)
ExplSyntaxOff
begindocument
$( a, b,c,d mid e,f,g,h)$
$(a,, b,, c,, d mid e,, f,, g,, h)$
$clsa,b,c,d$
$cls[Big]a,b,c,d$
$cls*dfraca2,b,c,d$
enddocument
Assuming you don't need the thing in subscripts or superscripts, the easiest way is to exit from math mode, doubling the thinmuskip
, reentering math mode, typesetting the lists and go back.
documentclassarticle
usepackageamsmath
newcommandcls[2]%
mathordmbox%
thinmuskip=2thinmuskip
$(#1mid#2)$%
%
begindocument
$( a, b,c,d mid e,f,g,h)$
$(a,, b,, c,, d mid e,, f,, g,, h)$
$clsa,b,c,de,f,g,h$
enddocument
A different solution that allows for resizing the parentheses as usual for commands defined with DeclarePairedDelimiter
, see the examples. It also has a friendlier syntax.
documentclassarticle
usepackageamsmath
usepackagexparse
AtBeginDocumentmathchardefclscomma=mathcode`,
ExplSyntaxOn
NewDocumentCommandclssom
group_begin:
IfBooleanTF#1
hs_cls_auto:n #3
hs_cls_manual:nn #2 #3
group_end:
cs_new_protected:Nn hs_cls_auto:n
__hs_cls_activate_comma:
__hs_cls_activate_bar:n ;middlevert;
left( #1 right)
cs_new_protected:Nn hs_cls_manual:nn
__hs_cls_activate_comma:
__hs_cls_activate_bar:n __hs_cls_mid:n #1
__hs_cls_open:n #1 #2 __hs_cls_close:n #1
cs_new_protected:Nn __hs_cls_activate_comma:
char_set_active_eq:nN `, __hs_cls_comma:
mathcode`,="8000 scan_stop:
cs_new_protected:Nn __hs_cls_comma: clscomma,
cs_new_protected:Nn __hs_cls_activate_bar:n
cs_set_protected:Nn __hs_cls_bar: #1
char_set_active_eq:nN ` __hs_cls_bar:
mathcode`
cs_new_protected:Nn __hs_cls_open:n
tl_if_novalue:nTF #1 ( mathopen#1(
cs_new_protected:Nn __hs_cls_mid:n
tl_if_novalue:nTF #1 mid mathrel#1vert
cs_new_protected:Nn __hs_cls_close:n
tl_if_novalue:nTF #1 ) mathclose#1)
ExplSyntaxOff
begindocument
$( a, b,c,d mid e,f,g,h)$
$(a,, b,, c,, d mid e,, f,, g,, h)$
$clsa,b,c,d$
$cls[Big]a,b,c,d$
$cls*dfraca2,b,c,d$
enddocument
edited 7 hours ago
answered 8 hours ago
egregegreg
757k90 gold badges1981 silver badges3327 bronze badges
757k90 gold badges1981 silver badges3327 bronze badges
Thanks for your comments and answers but I need a more general command ofthinmuskip=2thinmuskip
– HS8637
8 hours ago
@HS8637 Why? A comma is followed by a thin space and,
inserts another thin space; the thin space has widththinmuskip
, so you get exactly the same output with my code and with,,
all around.
– egreg
8 hours ago
Dear @egreg. You're right. But I need to change the setting of spacing, not an especial case.
– HS8637
7 hours ago
@HS8637 Reread your question. Those are the formulas you mention. Changing in general the spacing after commas is not something I'd recommend.
– egreg
7 hours ago
@egreg Thanks for adding the LaTeX3 code, it is full of little interesting things!
– frougon
5 hours ago
add a comment |
Thanks for your comments and answers but I need a more general command ofthinmuskip=2thinmuskip
– HS8637
8 hours ago
@HS8637 Why? A comma is followed by a thin space and,
inserts another thin space; the thin space has widththinmuskip
, so you get exactly the same output with my code and with,,
all around.
– egreg
8 hours ago
Dear @egreg. You're right. But I need to change the setting of spacing, not an especial case.
– HS8637
7 hours ago
@HS8637 Reread your question. Those are the formulas you mention. Changing in general the spacing after commas is not something I'd recommend.
– egreg
7 hours ago
@egreg Thanks for adding the LaTeX3 code, it is full of little interesting things!
– frougon
5 hours ago
Thanks for your comments and answers but I need a more general command of
thinmuskip=2thinmuskip
– HS8637
8 hours ago
Thanks for your comments and answers but I need a more general command of
thinmuskip=2thinmuskip
– HS8637
8 hours ago
@HS8637 Why? A comma is followed by a thin space and
,
inserts another thin space; the thin space has width thinmuskip
, so you get exactly the same output with my code and with ,,
all around.– egreg
8 hours ago
@HS8637 Why? A comma is followed by a thin space and
,
inserts another thin space; the thin space has width thinmuskip
, so you get exactly the same output with my code and with ,,
all around.– egreg
8 hours ago
Dear @egreg. You're right. But I need to change the setting of spacing, not an especial case.
– HS8637
7 hours ago
Dear @egreg. You're right. But I need to change the setting of spacing, not an especial case.
– HS8637
7 hours ago
@HS8637 Reread your question. Those are the formulas you mention. Changing in general the spacing after commas is not something I'd recommend.
– egreg
7 hours ago
@HS8637 Reread your question. Those are the formulas you mention. Changing in general the spacing after commas is not something I'd recommend.
– egreg
7 hours ago
@egreg Thanks for adding the LaTeX3 code, it is full of little interesting things!
– frougon
5 hours ago
@egreg Thanks for adding the LaTeX3 code, it is full of little interesting things!
– frougon
5 hours ago
add a comment |
You can process each of the two lists (left and right) using etoolbox
and a cunning delimiter trick:
documentclassarticle
usepackageetoolbox
% https://tex.stackexchange.com/a/89187/5764
newcommandprintlist[2][,]%
defitemdelimdefitemdelim#1% Item delimiter delayed by one cycle
renewcommand*do[1]itemdelim##1% How each item is processed
docsvlist#2% Process CSV list
makeatletter
def@LandR#1|#2relaxdefleftlist#1defrightlist#2%
defLandR#1%
@LandR#1relax
left( % Left bracket
edefxnoexpandprintlist[,,]leftlistx
,middle
makeatother
begindocument
$left( a, b, c, d | e, f, g, h right)$
$LandRa, b, c, d $
enddocument
Each list is printed using printlist[,,]
, which adds a small space ,
after each delimiter ,
. You can adjust the layout of the left/right bracket and middle divider.
If you wish to include larger constructions, you may need to use noexpand
, as in
LandRnoexpandfracab, c, d, e
add a comment |
You can process each of the two lists (left and right) using etoolbox
and a cunning delimiter trick:
documentclassarticle
usepackageetoolbox
% https://tex.stackexchange.com/a/89187/5764
newcommandprintlist[2][,]%
defitemdelimdefitemdelim#1% Item delimiter delayed by one cycle
renewcommand*do[1]itemdelim##1% How each item is processed
docsvlist#2% Process CSV list
makeatletter
def@LandR#1|#2relaxdefleftlist#1defrightlist#2%
defLandR#1%
@LandR#1relax
left( % Left bracket
edefxnoexpandprintlist[,,]leftlistx
,middle
makeatother
begindocument
$left( a, b, c, d | e, f, g, h right)$
$LandRa, b, c, d $
enddocument
Each list is printed using printlist[,,]
, which adds a small space ,
after each delimiter ,
. You can adjust the layout of the left/right bracket and middle divider.
If you wish to include larger constructions, you may need to use noexpand
, as in
LandRnoexpandfracab, c, d, e
add a comment |
You can process each of the two lists (left and right) using etoolbox
and a cunning delimiter trick:
documentclassarticle
usepackageetoolbox
% https://tex.stackexchange.com/a/89187/5764
newcommandprintlist[2][,]%
defitemdelimdefitemdelim#1% Item delimiter delayed by one cycle
renewcommand*do[1]itemdelim##1% How each item is processed
docsvlist#2% Process CSV list
makeatletter
def@LandR#1|#2relaxdefleftlist#1defrightlist#2%
defLandR#1%
@LandR#1relax
left( % Left bracket
edefxnoexpandprintlist[,,]leftlistx
,middle
makeatother
begindocument
$left( a, b, c, d | e, f, g, h right)$
$LandRa, b, c, d $
enddocument
Each list is printed using printlist[,,]
, which adds a small space ,
after each delimiter ,
. You can adjust the layout of the left/right bracket and middle divider.
If you wish to include larger constructions, you may need to use noexpand
, as in
LandRnoexpandfracab, c, d, e
You can process each of the two lists (left and right) using etoolbox
and a cunning delimiter trick:
documentclassarticle
usepackageetoolbox
% https://tex.stackexchange.com/a/89187/5764
newcommandprintlist[2][,]%
defitemdelimdefitemdelim#1% Item delimiter delayed by one cycle
renewcommand*do[1]itemdelim##1% How each item is processed
docsvlist#2% Process CSV list
makeatletter
def@LandR#1|#2relaxdefleftlist#1defrightlist#2%
defLandR#1%
@LandR#1relax
left( % Left bracket
edefxnoexpandprintlist[,,]leftlistx
,middle
makeatother
begindocument
$left( a, b, c, d | e, f, g, h right)$
$LandRa, b, c, d $
enddocument
Each list is printed using printlist[,,]
, which adds a small space ,
after each delimiter ,
. You can adjust the layout of the left/right bracket and middle divider.
If you wish to include larger constructions, you may need to use noexpand
, as in
LandRnoexpandfracab, c, d, e
edited 1 hour ago
answered 8 hours ago
WernerWerner
458k76 gold badges1022 silver badges1758 bronze badges
458k76 gold badges1022 silver badges1758 bronze badges
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%2f501447%2fspacing-setting-of-math-mode%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
[beginpmatrixa&b&c&d&e&f&g&hendpmatrix]
(don't forget to addusepackageamsmath
to the preamble) could be an option.– manooooh
8 hours ago