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
How to sort and filter a constantly changing list of data?
Where to place an artificial gland in the human body?
Protected custom settings as a parameter in an @AuraEnabled method causes error
What is a Union Word™?
How do campaign rallies gain candidates votes?
How can I create a shape in Illustrator which follows a path in descending order size?
Does static fire reduce reliability?
What does Kasparov mean here?
How to write a sincerely religious protagonist without preaching or affirming or judging their worldview?
Why did NASA use U.S customary units?
How can I tell if there was a power cut while I was out?
This message is flooding my syslog, how to find were it comes from?
How important is a good quality camera for good photography?
Is it normal practice to screen share with a client?
Terence Tao - type books in other fields?
Would it be a good idea to memorize relative interval positions on guitar?
What is "ass door"?
Sitecore Powershell extensions module compatibility with Sitecore 9.2
What do teaching faculty do during semester breaks?
Why do people say "I am broke" instead of "I am broken"?
How do professional electronic musicians/sound engineers combat listening fatigue?
How did C64 games handle music during gameplay?
Moving files accidentally to an not existing directory erases files?
Why is chess failing to attract big name sponsors?
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*e,f,g,h$
enddocument
Thanks for your comments and answers but I need a more general command ofthinmuskip=2thinmuskip
– HS8637
7 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
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
@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
LandR f, g, h, noexpandfracij
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*e,f,g,h$
enddocument
Thanks for your comments and answers but I need a more general command ofthinmuskip=2thinmuskip
– HS8637
7 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
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
@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*e,f,g,h$
enddocument
Thanks for your comments and answers but I need a more general command ofthinmuskip=2thinmuskip
– HS8637
7 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
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
@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*e,f,g,h$
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*e,f,g,h$
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
7 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
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
@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
7 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
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
@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
7 hours ago
Thanks for your comments and answers but I need a more general command of
thinmuskip=2thinmuskip
– HS8637
7 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
7 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
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
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
LandR f, g, h, noexpandfracij
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
LandR f, g, h, noexpandfracij
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
LandR f, g, h, noexpandfracij
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
LandR f, g, h, noexpandfracij
edited 1 hour ago
answered 7 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