Fractional alignment The 2019 Stack Overflow Developer Survey Results Are Incommath and ifinnerHow to keep alignment consistent with non-LaTeX contents?Suggestions for splitting a large fractional equation?Nicer alignment of x^*/2How to change horizontal alignment of frac?How to change horizontal alignment for frac?Display fractional formula nicelyFormatting a fractional exponent in display mathUsing braces with equations - how to make fractional terms 'bigger'Alignment of fractions of the form (a-b)/(c-d)Equation alignment between columns
"Riffle" two strings
Why do UK politicians seemingly ignore opinion polls on Brexit?
How long do I have to send payment?
How are circuits which use complex ICs normally simulated?
Inflated grade on resume at previous job, might former employer tell new employer?
Families of ordered set partitions with disjoint blocks
Why is Grand Jury testimony secret?
Carnot-Caratheodory metric
What does "rabbited" mean/imply in this sentence?
It's possible to achieve negative score?
Landlord wants to switch my lease to a "Land contract" to "get back at the city"
Is flight data recorder erased after every flight?
Why can Shazam do this?
is usb on wall sockets live all the time with out switches off
Why Did Howard Stark Use All The Vibranium They Had On A Prototype Shield?
Can we apply L'Hospital's rule where the derivative is not continuous?
Geography at the pixel level
What function has this graph?
I looked up a future colleague on linkedin before I started a job. I told my colleague about it and he seemed surprised. Should I apologize?
What does "sndry explns" mean in one of the Hitchhiker's guide books?
Limit the amount of RAM Mathematica may access?
Is this food a bread or a loaf?
Lethal sonic weapons
Spanish for "widget"
Fractional alignment
The 2019 Stack Overflow Developer Survey Results Are Incommath and ifinnerHow to keep alignment consistent with non-LaTeX contents?Suggestions for splitting a large fractional equation?Nicer alignment of x^*/2How to change horizontal alignment of frac?How to change horizontal alignment for frac?Display fractional formula nicelyFormatting a fractional exponent in display mathUsing braces with equations - how to make fractional terms 'bigger'Alignment of fractions of the form (a-b)/(c-d)Equation alignment between columns
So I have this basic code:
But the fractional alignment looks awful, any tips to fix this?
documentclass[11pt, a4paper]report
usepackagebm
usepackageamsfonts, graphicx, verbatim, amsmath,amssymb, amsthm, mathrsfs, eufrak
usepackagecolor
usepackagearray
usepackagesetspace% if you must (for double spacing thesis)
usepackagefancyhdr
usepackageenumitem
usepackagetikz
usepackageparskip
usepackagelipsum
usepackagefloatrow
usepackagecommath
providecommandU[1]protectrule.1in.1in
begindocument
Let $h$ be a linear mapping of $V_1$ into $V_2$. Let
[
h^0 = frac1abs G sum_tin G (rho_t^2)^-1 h rho_t^1
]
where $abs G$ is the order of $G$. Then
beginenumerate[label=(roman*)]
item If $rho^1$ and $rho^2$ are not isomorphic then we have $h^0=0$
item If $V_1 = V_2$ and $rho^1 = rho^2$, $h^0$ is a scalar multiple of the identity, the scalar being $frac1n Tr(h)$ where $n = dim(V_1)$
endenumerate
enddocument
as you notice, it looks awful.
fractions commath
|
show 3 more comments
So I have this basic code:
But the fractional alignment looks awful, any tips to fix this?
documentclass[11pt, a4paper]report
usepackagebm
usepackageamsfonts, graphicx, verbatim, amsmath,amssymb, amsthm, mathrsfs, eufrak
usepackagecolor
usepackagearray
usepackagesetspace% if you must (for double spacing thesis)
usepackagefancyhdr
usepackageenumitem
usepackagetikz
usepackageparskip
usepackagelipsum
usepackagefloatrow
usepackagecommath
providecommandU[1]protectrule.1in.1in
begindocument
Let $h$ be a linear mapping of $V_1$ into $V_2$. Let
[
h^0 = frac1abs G sum_tin G (rho_t^2)^-1 h rho_t^1
]
where $abs G$ is the order of $G$. Then
beginenumerate[label=(roman*)]
item If $rho^1$ and $rho^2$ are not isomorphic then we have $h^0=0$
item If $V_1 = V_2$ and $rho^1 = rho^2$, $h^0$ is a scalar multiple of the identity, the scalar being $frac1n Tr(h)$ where $n = dim(V_1)$
endenumerate
enddocument
as you notice, it looks awful.
fractions commath
I mean, can the |G| be pushed a little to the right? since the vertical "bars" and not aligned with the horizontal fractional line?
– Maths
11 hours ago
1
You can always add space to it:,abs G.
– JouleV
11 hours ago
1
Hmm, I don't think it deserves closure. This is a good question and my solution is only a workaround - it is not 100% centered. Maybe some TeXperts out there will provide a good answer.
– JouleV
11 hours ago
1
@JouleV I agree, the question shouldn't be closed. It's definitely a bug (feature?) incommath.
– campa
11 hours ago
1
See tex.stackexchange.com/a/135985/4427, if you really want to usecommathmacros.
– egreg
10 hours ago
|
show 3 more comments
So I have this basic code:
But the fractional alignment looks awful, any tips to fix this?
documentclass[11pt, a4paper]report
usepackagebm
usepackageamsfonts, graphicx, verbatim, amsmath,amssymb, amsthm, mathrsfs, eufrak
usepackagecolor
usepackagearray
usepackagesetspace% if you must (for double spacing thesis)
usepackagefancyhdr
usepackageenumitem
usepackagetikz
usepackageparskip
usepackagelipsum
usepackagefloatrow
usepackagecommath
providecommandU[1]protectrule.1in.1in
begindocument
Let $h$ be a linear mapping of $V_1$ into $V_2$. Let
[
h^0 = frac1abs G sum_tin G (rho_t^2)^-1 h rho_t^1
]
where $abs G$ is the order of $G$. Then
beginenumerate[label=(roman*)]
item If $rho^1$ and $rho^2$ are not isomorphic then we have $h^0=0$
item If $V_1 = V_2$ and $rho^1 = rho^2$, $h^0$ is a scalar multiple of the identity, the scalar being $frac1n Tr(h)$ where $n = dim(V_1)$
endenumerate
enddocument
as you notice, it looks awful.
fractions commath
So I have this basic code:
But the fractional alignment looks awful, any tips to fix this?
documentclass[11pt, a4paper]report
usepackagebm
usepackageamsfonts, graphicx, verbatim, amsmath,amssymb, amsthm, mathrsfs, eufrak
usepackagecolor
usepackagearray
usepackagesetspace% if you must (for double spacing thesis)
usepackagefancyhdr
usepackageenumitem
usepackagetikz
usepackageparskip
usepackagelipsum
usepackagefloatrow
usepackagecommath
providecommandU[1]protectrule.1in.1in
begindocument
Let $h$ be a linear mapping of $V_1$ into $V_2$. Let
[
h^0 = frac1abs G sum_tin G (rho_t^2)^-1 h rho_t^1
]
where $abs G$ is the order of $G$. Then
beginenumerate[label=(roman*)]
item If $rho^1$ and $rho^2$ are not isomorphic then we have $h^0=0$
item If $V_1 = V_2$ and $rho^1 = rho^2$, $h^0$ is a scalar multiple of the identity, the scalar being $frac1n Tr(h)$ where $n = dim(V_1)$
endenumerate
enddocument
as you notice, it looks awful.
fractions commath
fractions commath
edited 10 hours ago
Mico
286k32390779
286k32390779
asked 11 hours ago
MathsMaths
44111
44111
I mean, can the |G| be pushed a little to the right? since the vertical "bars" and not aligned with the horizontal fractional line?
– Maths
11 hours ago
1
You can always add space to it:,abs G.
– JouleV
11 hours ago
1
Hmm, I don't think it deserves closure. This is a good question and my solution is only a workaround - it is not 100% centered. Maybe some TeXperts out there will provide a good answer.
– JouleV
11 hours ago
1
@JouleV I agree, the question shouldn't be closed. It's definitely a bug (feature?) incommath.
– campa
11 hours ago
1
See tex.stackexchange.com/a/135985/4427, if you really want to usecommathmacros.
– egreg
10 hours ago
|
show 3 more comments
I mean, can the |G| be pushed a little to the right? since the vertical "bars" and not aligned with the horizontal fractional line?
– Maths
11 hours ago
1
You can always add space to it:,abs G.
– JouleV
11 hours ago
1
Hmm, I don't think it deserves closure. This is a good question and my solution is only a workaround - it is not 100% centered. Maybe some TeXperts out there will provide a good answer.
– JouleV
11 hours ago
1
@JouleV I agree, the question shouldn't be closed. It's definitely a bug (feature?) incommath.
– campa
11 hours ago
1
See tex.stackexchange.com/a/135985/4427, if you really want to usecommathmacros.
– egreg
10 hours ago
I mean, can the |G| be pushed a little to the right? since the vertical "bars" and not aligned with the horizontal fractional line?
– Maths
11 hours ago
I mean, can the |G| be pushed a little to the right? since the vertical "bars" and not aligned with the horizontal fractional line?
– Maths
11 hours ago
1
1
You can always add space to it:
,abs G.– JouleV
11 hours ago
You can always add space to it:
,abs G.– JouleV
11 hours ago
1
1
Hmm, I don't think it deserves closure. This is a good question and my solution is only a workaround - it is not 100% centered. Maybe some TeXperts out there will provide a good answer.
– JouleV
11 hours ago
Hmm, I don't think it deserves closure. This is a good question and my solution is only a workaround - it is not 100% centered. Maybe some TeXperts out there will provide a good answer.
– JouleV
11 hours ago
1
1
@JouleV I agree, the question shouldn't be closed. It's definitely a bug (feature?) in
commath.– campa
11 hours ago
@JouleV I agree, the question shouldn't be closed. It's definitely a bug (feature?) in
commath.– campa
11 hours ago
1
1
See tex.stackexchange.com/a/135985/4427, if you really want to use
commath macros.– egreg
10 hours ago
See tex.stackexchange.com/a/135985/4427, if you really want to use
commath macros.– egreg
10 hours ago
|
show 3 more comments
2 Answers
2
active
oldest
votes
The commath package provides a highly questionable implementation of abs. Don't load this package unless you absolutely have to. (Aside: You do not have to for the example at hand.)
Instead of loading this package, I suggest you
load the
mathtoolspackage instead of theamsmathpackage. Themathtoolspackage is, for all intents and purposes, a superset of theamsmathpackage; andissue the instruction
DeclarePairedDelimiterabslvertrvertin the preamble. This sets up a proper implementation of
abs.... If you need to auto-size the vertical bars, simply useabs*....
*Addendum": More about how commath implements envert (abs is just an alias for envert): If envert<arg> is invoked without an optional sizing argument (a whole number between 0 and 4), the following code gets executed:
!leftlvert#2rightrvert
It's the ! ("negative thinspace") instruction that messes up the symmetry of the full expression. Either write abs[0]<arg> to execute lvert#2rvert or, more safely, don't load commath at all and go for a cleaner definition of abs. The definitions of abs[1]... thru abs[4]... are also messed up, by the way, as are the definitions of norm and norm[1] thru norm]4]. While it's possible, in principle, to correct the faulty definitions of envert, abs, enVert, and norm, one is better off going for a setup that avoids these complications...
So I should remove the amsath package and insert the mathtools package? would this affect the remaining document consisting of 40-50 pages? if not then I'll change it since you have much more experience.
– Maths
10 hours ago
1
@Maths - Themathtoolspackage automatically loads theamsmathpackage, while taking great care not to mess with the operational details of the macros.
– Mico
10 hours ago
add a comment |
Compare the output of
documentclass[11pt, a4paper]report
usepackageamsmath
usepackageenumitem
usepackagecommath
DeclareMathOperatorTrTr
begindocument
Let $h$ be a linear mapping of $V_1$ into $V_2$. Let
[
h^0 = frac1abs G sum_tin G (rho_t^2)^-1 h rho_t^1
]
where $abs G$ is the order of $G$. Then
beginenumerate[label=(roman*)]
item If $rho^1$ and $rho^2$ are not isomorphic then we have $h^0=0$
item If $V_1 = V_2$ and $rho^1 = rho^2$, $h^0$ is a scalar multiple of the identity,
the scalar being $frac1n Tr(h)$ where $n = dim(V_1)$
endenumerate
enddocument

with the output of
documentclass[11pt, a4paper]report
usepackageamsmath
usepackageenumitem
makeatletter
% begin definitions for a "better commath"
newcommanddifmathop!mathrmd
newcommandDifmathop!mathrmD
newcommandspx[1]%
ifrelaxdetokenize#1relax
expandafter@gobble
else
expandafter@firstofone
fi
^#1%
newcommandpd[3][]fracpartialspx#1#2partial#3spx#1
newcommandtpd[3][]tfracpartialspx#1#2partial#3spx#1
newcommanddpd[3][]dfracpartialspx#1#2partial#3spx#1
newcommandmd[6]fracpartialspx#2#1partial#3spx#4partial#5spx#6
newcommandtmd[6]tfracpartialspx#2#1partial#3spx#4partial#5spx#6
newcommanddmd[6]dfracpartialspx#2#1partial#3spx#4partial#5spx#6
newcommandod[3][]fracdifspx#1#2dif#3spx#1
newcommandtod[3][]tfracdifspx#1#2dif#3spx#1
newcommanddod[3][]dfracdifspx#1#2dif#3spx#1
newcommandgenericdel[4]%
ifcase#3relax
ifx#1.else#1fi#4ifx#2.else#2fior
bigl#1#4bigr#2or
Bigl#1#4Bigr#2or
biggl#1#4biggr#2or
Biggl#1#4Biggr#2else
left#1#4right#2fi
newcommanddel[2][-1]genericdel()#1#2
newcommandset[2][-1]genericdel#1#2
letcbrset
newcommandsbr[2][-1]genericdel[]#1#2
letintoodel
letintccsbr
newcommandintoc[2][-1]genericdel(]#1#2
newcommandintco[2][-1]genericdel[)#1#2
newcommandeval[2][-1]#1#2
newcommandenvert[2][-1]#1#2
letabsenvert
newcommandsVert[1][0]orBigr
newcommandenVert[2][-1]#1#2
letnormenVert
newcommandfullfunction[5]%
beginarray@r@r@c@l@
#1 colon & #2 & longrightarrow & #3 \
& #4 & longmapsto & #5
endarray
%%% end of the definitions
makeatother
DeclareMathOperatorTrTr
begindocument
Let $h$ be a linear mapping of $V_1$ into $V_2$. Let
[
h^0 = frac1abs G sum_tin G (rho_t^2)^-1 h rho_t^1
]
where $abs G$ is the order of $G$. Then
beginenumerate[label=(roman*)]
item If $rho^1$ and $rho^2$ are not isomorphic then we have $h^0=0$
item If $V_1 = V_2$ and $rho^1 = rho^2$, $h^0$ is a scalar multiple of the identity,
the scalar being $frac1n Tr(h)$ where $n = dim(V_1)$
endenumerate
enddocument
The code has already been presented in https://tex.stackexchange.com/a/135985/4427 and provides a full replacement of commath, avoiding all its weaknesses. If you're tied to commath because you use its macros and features in other places, this can save you. Otherwise define abs with DeclarePairedDelimiter as suggested by Mico.
For instance, you can notice the reduced space between “where” and “|G|” in the commath version.

You should define anyway an operator name for “Tr”.
If you decide to go for this, save the part between
% begin definitions for a "better commath"
and
% end of the definitions
in a file called bettercommath.sty in the working directory and do usepackagebettercommath.
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%2f483944%2ffractional-alignment%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
The commath package provides a highly questionable implementation of abs. Don't load this package unless you absolutely have to. (Aside: You do not have to for the example at hand.)
Instead of loading this package, I suggest you
load the
mathtoolspackage instead of theamsmathpackage. Themathtoolspackage is, for all intents and purposes, a superset of theamsmathpackage; andissue the instruction
DeclarePairedDelimiterabslvertrvertin the preamble. This sets up a proper implementation of
abs.... If you need to auto-size the vertical bars, simply useabs*....
*Addendum": More about how commath implements envert (abs is just an alias for envert): If envert<arg> is invoked without an optional sizing argument (a whole number between 0 and 4), the following code gets executed:
!leftlvert#2rightrvert
It's the ! ("negative thinspace") instruction that messes up the symmetry of the full expression. Either write abs[0]<arg> to execute lvert#2rvert or, more safely, don't load commath at all and go for a cleaner definition of abs. The definitions of abs[1]... thru abs[4]... are also messed up, by the way, as are the definitions of norm and norm[1] thru norm]4]. While it's possible, in principle, to correct the faulty definitions of envert, abs, enVert, and norm, one is better off going for a setup that avoids these complications...
So I should remove the amsath package and insert the mathtools package? would this affect the remaining document consisting of 40-50 pages? if not then I'll change it since you have much more experience.
– Maths
10 hours ago
1
@Maths - Themathtoolspackage automatically loads theamsmathpackage, while taking great care not to mess with the operational details of the macros.
– Mico
10 hours ago
add a comment |
The commath package provides a highly questionable implementation of abs. Don't load this package unless you absolutely have to. (Aside: You do not have to for the example at hand.)
Instead of loading this package, I suggest you
load the
mathtoolspackage instead of theamsmathpackage. Themathtoolspackage is, for all intents and purposes, a superset of theamsmathpackage; andissue the instruction
DeclarePairedDelimiterabslvertrvertin the preamble. This sets up a proper implementation of
abs.... If you need to auto-size the vertical bars, simply useabs*....
*Addendum": More about how commath implements envert (abs is just an alias for envert): If envert<arg> is invoked without an optional sizing argument (a whole number between 0 and 4), the following code gets executed:
!leftlvert#2rightrvert
It's the ! ("negative thinspace") instruction that messes up the symmetry of the full expression. Either write abs[0]<arg> to execute lvert#2rvert or, more safely, don't load commath at all and go for a cleaner definition of abs. The definitions of abs[1]... thru abs[4]... are also messed up, by the way, as are the definitions of norm and norm[1] thru norm]4]. While it's possible, in principle, to correct the faulty definitions of envert, abs, enVert, and norm, one is better off going for a setup that avoids these complications...
So I should remove the amsath package and insert the mathtools package? would this affect the remaining document consisting of 40-50 pages? if not then I'll change it since you have much more experience.
– Maths
10 hours ago
1
@Maths - Themathtoolspackage automatically loads theamsmathpackage, while taking great care not to mess with the operational details of the macros.
– Mico
10 hours ago
add a comment |
The commath package provides a highly questionable implementation of abs. Don't load this package unless you absolutely have to. (Aside: You do not have to for the example at hand.)
Instead of loading this package, I suggest you
load the
mathtoolspackage instead of theamsmathpackage. Themathtoolspackage is, for all intents and purposes, a superset of theamsmathpackage; andissue the instruction
DeclarePairedDelimiterabslvertrvertin the preamble. This sets up a proper implementation of
abs.... If you need to auto-size the vertical bars, simply useabs*....
*Addendum": More about how commath implements envert (abs is just an alias for envert): If envert<arg> is invoked without an optional sizing argument (a whole number between 0 and 4), the following code gets executed:
!leftlvert#2rightrvert
It's the ! ("negative thinspace") instruction that messes up the symmetry of the full expression. Either write abs[0]<arg> to execute lvert#2rvert or, more safely, don't load commath at all and go for a cleaner definition of abs. The definitions of abs[1]... thru abs[4]... are also messed up, by the way, as are the definitions of norm and norm[1] thru norm]4]. While it's possible, in principle, to correct the faulty definitions of envert, abs, enVert, and norm, one is better off going for a setup that avoids these complications...
The commath package provides a highly questionable implementation of abs. Don't load this package unless you absolutely have to. (Aside: You do not have to for the example at hand.)
Instead of loading this package, I suggest you
load the
mathtoolspackage instead of theamsmathpackage. Themathtoolspackage is, for all intents and purposes, a superset of theamsmathpackage; andissue the instruction
DeclarePairedDelimiterabslvertrvertin the preamble. This sets up a proper implementation of
abs.... If you need to auto-size the vertical bars, simply useabs*....
*Addendum": More about how commath implements envert (abs is just an alias for envert): If envert<arg> is invoked without an optional sizing argument (a whole number between 0 and 4), the following code gets executed:
!leftlvert#2rightrvert
It's the ! ("negative thinspace") instruction that messes up the symmetry of the full expression. Either write abs[0]<arg> to execute lvert#2rvert or, more safely, don't load commath at all and go for a cleaner definition of abs. The definitions of abs[1]... thru abs[4]... are also messed up, by the way, as are the definitions of norm and norm[1] thru norm]4]. While it's possible, in principle, to correct the faulty definitions of envert, abs, enVert, and norm, one is better off going for a setup that avoids these complications...
edited 10 hours ago
answered 10 hours ago
MicoMico
286k32390779
286k32390779
So I should remove the amsath package and insert the mathtools package? would this affect the remaining document consisting of 40-50 pages? if not then I'll change it since you have much more experience.
– Maths
10 hours ago
1
@Maths - Themathtoolspackage automatically loads theamsmathpackage, while taking great care not to mess with the operational details of the macros.
– Mico
10 hours ago
add a comment |
So I should remove the amsath package and insert the mathtools package? would this affect the remaining document consisting of 40-50 pages? if not then I'll change it since you have much more experience.
– Maths
10 hours ago
1
@Maths - Themathtoolspackage automatically loads theamsmathpackage, while taking great care not to mess with the operational details of the macros.
– Mico
10 hours ago
So I should remove the amsath package and insert the mathtools package? would this affect the remaining document consisting of 40-50 pages? if not then I'll change it since you have much more experience.
– Maths
10 hours ago
So I should remove the amsath package and insert the mathtools package? would this affect the remaining document consisting of 40-50 pages? if not then I'll change it since you have much more experience.
– Maths
10 hours ago
1
1
@Maths - The
mathtools package automatically loads the amsmath package, while taking great care not to mess with the operational details of the macros.– Mico
10 hours ago
@Maths - The
mathtools package automatically loads the amsmath package, while taking great care not to mess with the operational details of the macros.– Mico
10 hours ago
add a comment |
Compare the output of
documentclass[11pt, a4paper]report
usepackageamsmath
usepackageenumitem
usepackagecommath
DeclareMathOperatorTrTr
begindocument
Let $h$ be a linear mapping of $V_1$ into $V_2$. Let
[
h^0 = frac1abs G sum_tin G (rho_t^2)^-1 h rho_t^1
]
where $abs G$ is the order of $G$. Then
beginenumerate[label=(roman*)]
item If $rho^1$ and $rho^2$ are not isomorphic then we have $h^0=0$
item If $V_1 = V_2$ and $rho^1 = rho^2$, $h^0$ is a scalar multiple of the identity,
the scalar being $frac1n Tr(h)$ where $n = dim(V_1)$
endenumerate
enddocument

with the output of
documentclass[11pt, a4paper]report
usepackageamsmath
usepackageenumitem
makeatletter
% begin definitions for a "better commath"
newcommanddifmathop!mathrmd
newcommandDifmathop!mathrmD
newcommandspx[1]%
ifrelaxdetokenize#1relax
expandafter@gobble
else
expandafter@firstofone
fi
^#1%
newcommandpd[3][]fracpartialspx#1#2partial#3spx#1
newcommandtpd[3][]tfracpartialspx#1#2partial#3spx#1
newcommanddpd[3][]dfracpartialspx#1#2partial#3spx#1
newcommandmd[6]fracpartialspx#2#1partial#3spx#4partial#5spx#6
newcommandtmd[6]tfracpartialspx#2#1partial#3spx#4partial#5spx#6
newcommanddmd[6]dfracpartialspx#2#1partial#3spx#4partial#5spx#6
newcommandod[3][]fracdifspx#1#2dif#3spx#1
newcommandtod[3][]tfracdifspx#1#2dif#3spx#1
newcommanddod[3][]dfracdifspx#1#2dif#3spx#1
newcommandgenericdel[4]%
ifcase#3relax
ifx#1.else#1fi#4ifx#2.else#2fior
bigl#1#4bigr#2or
Bigl#1#4Bigr#2or
biggl#1#4biggr#2or
Biggl#1#4Biggr#2else
left#1#4right#2fi
newcommanddel[2][-1]genericdel()#1#2
newcommandset[2][-1]genericdel#1#2
letcbrset
newcommandsbr[2][-1]genericdel[]#1#2
letintoodel
letintccsbr
newcommandintoc[2][-1]genericdel(]#1#2
newcommandintco[2][-1]genericdel[)#1#2
newcommandeval[2][-1]#1#2
newcommandenvert[2][-1]#1#2
letabsenvert
newcommandsVert[1][0]orBigr
newcommandenVert[2][-1]#1#2
letnormenVert
newcommandfullfunction[5]%
beginarray@r@r@c@l@
#1 colon & #2 & longrightarrow & #3 \
& #4 & longmapsto & #5
endarray
%%% end of the definitions
makeatother
DeclareMathOperatorTrTr
begindocument
Let $h$ be a linear mapping of $V_1$ into $V_2$. Let
[
h^0 = frac1abs G sum_tin G (rho_t^2)^-1 h rho_t^1
]
where $abs G$ is the order of $G$. Then
beginenumerate[label=(roman*)]
item If $rho^1$ and $rho^2$ are not isomorphic then we have $h^0=0$
item If $V_1 = V_2$ and $rho^1 = rho^2$, $h^0$ is a scalar multiple of the identity,
the scalar being $frac1n Tr(h)$ where $n = dim(V_1)$
endenumerate
enddocument
The code has already been presented in https://tex.stackexchange.com/a/135985/4427 and provides a full replacement of commath, avoiding all its weaknesses. If you're tied to commath because you use its macros and features in other places, this can save you. Otherwise define abs with DeclarePairedDelimiter as suggested by Mico.
For instance, you can notice the reduced space between “where” and “|G|” in the commath version.

You should define anyway an operator name for “Tr”.
If you decide to go for this, save the part between
% begin definitions for a "better commath"
and
% end of the definitions
in a file called bettercommath.sty in the working directory and do usepackagebettercommath.
add a comment |
Compare the output of
documentclass[11pt, a4paper]report
usepackageamsmath
usepackageenumitem
usepackagecommath
DeclareMathOperatorTrTr
begindocument
Let $h$ be a linear mapping of $V_1$ into $V_2$. Let
[
h^0 = frac1abs G sum_tin G (rho_t^2)^-1 h rho_t^1
]
where $abs G$ is the order of $G$. Then
beginenumerate[label=(roman*)]
item If $rho^1$ and $rho^2$ are not isomorphic then we have $h^0=0$
item If $V_1 = V_2$ and $rho^1 = rho^2$, $h^0$ is a scalar multiple of the identity,
the scalar being $frac1n Tr(h)$ where $n = dim(V_1)$
endenumerate
enddocument

with the output of
documentclass[11pt, a4paper]report
usepackageamsmath
usepackageenumitem
makeatletter
% begin definitions for a "better commath"
newcommanddifmathop!mathrmd
newcommandDifmathop!mathrmD
newcommandspx[1]%
ifrelaxdetokenize#1relax
expandafter@gobble
else
expandafter@firstofone
fi
^#1%
newcommandpd[3][]fracpartialspx#1#2partial#3spx#1
newcommandtpd[3][]tfracpartialspx#1#2partial#3spx#1
newcommanddpd[3][]dfracpartialspx#1#2partial#3spx#1
newcommandmd[6]fracpartialspx#2#1partial#3spx#4partial#5spx#6
newcommandtmd[6]tfracpartialspx#2#1partial#3spx#4partial#5spx#6
newcommanddmd[6]dfracpartialspx#2#1partial#3spx#4partial#5spx#6
newcommandod[3][]fracdifspx#1#2dif#3spx#1
newcommandtod[3][]tfracdifspx#1#2dif#3spx#1
newcommanddod[3][]dfracdifspx#1#2dif#3spx#1
newcommandgenericdel[4]%
ifcase#3relax
ifx#1.else#1fi#4ifx#2.else#2fior
bigl#1#4bigr#2or
Bigl#1#4Bigr#2or
biggl#1#4biggr#2or
Biggl#1#4Biggr#2else
left#1#4right#2fi
newcommanddel[2][-1]genericdel()#1#2
newcommandset[2][-1]genericdel#1#2
letcbrset
newcommandsbr[2][-1]genericdel[]#1#2
letintoodel
letintccsbr
newcommandintoc[2][-1]genericdel(]#1#2
newcommandintco[2][-1]genericdel[)#1#2
newcommandeval[2][-1]#1#2
newcommandenvert[2][-1]#1#2
letabsenvert
newcommandsVert[1][0]orBigr
newcommandenVert[2][-1]#1#2
letnormenVert
newcommandfullfunction[5]%
beginarray@r@r@c@l@
#1 colon & #2 & longrightarrow & #3 \
& #4 & longmapsto & #5
endarray
%%% end of the definitions
makeatother
DeclareMathOperatorTrTr
begindocument
Let $h$ be a linear mapping of $V_1$ into $V_2$. Let
[
h^0 = frac1abs G sum_tin G (rho_t^2)^-1 h rho_t^1
]
where $abs G$ is the order of $G$. Then
beginenumerate[label=(roman*)]
item If $rho^1$ and $rho^2$ are not isomorphic then we have $h^0=0$
item If $V_1 = V_2$ and $rho^1 = rho^2$, $h^0$ is a scalar multiple of the identity,
the scalar being $frac1n Tr(h)$ where $n = dim(V_1)$
endenumerate
enddocument
The code has already been presented in https://tex.stackexchange.com/a/135985/4427 and provides a full replacement of commath, avoiding all its weaknesses. If you're tied to commath because you use its macros and features in other places, this can save you. Otherwise define abs with DeclarePairedDelimiter as suggested by Mico.
For instance, you can notice the reduced space between “where” and “|G|” in the commath version.

You should define anyway an operator name for “Tr”.
If you decide to go for this, save the part between
% begin definitions for a "better commath"
and
% end of the definitions
in a file called bettercommath.sty in the working directory and do usepackagebettercommath.
add a comment |
Compare the output of
documentclass[11pt, a4paper]report
usepackageamsmath
usepackageenumitem
usepackagecommath
DeclareMathOperatorTrTr
begindocument
Let $h$ be a linear mapping of $V_1$ into $V_2$. Let
[
h^0 = frac1abs G sum_tin G (rho_t^2)^-1 h rho_t^1
]
where $abs G$ is the order of $G$. Then
beginenumerate[label=(roman*)]
item If $rho^1$ and $rho^2$ are not isomorphic then we have $h^0=0$
item If $V_1 = V_2$ and $rho^1 = rho^2$, $h^0$ is a scalar multiple of the identity,
the scalar being $frac1n Tr(h)$ where $n = dim(V_1)$
endenumerate
enddocument

with the output of
documentclass[11pt, a4paper]report
usepackageamsmath
usepackageenumitem
makeatletter
% begin definitions for a "better commath"
newcommanddifmathop!mathrmd
newcommandDifmathop!mathrmD
newcommandspx[1]%
ifrelaxdetokenize#1relax
expandafter@gobble
else
expandafter@firstofone
fi
^#1%
newcommandpd[3][]fracpartialspx#1#2partial#3spx#1
newcommandtpd[3][]tfracpartialspx#1#2partial#3spx#1
newcommanddpd[3][]dfracpartialspx#1#2partial#3spx#1
newcommandmd[6]fracpartialspx#2#1partial#3spx#4partial#5spx#6
newcommandtmd[6]tfracpartialspx#2#1partial#3spx#4partial#5spx#6
newcommanddmd[6]dfracpartialspx#2#1partial#3spx#4partial#5spx#6
newcommandod[3][]fracdifspx#1#2dif#3spx#1
newcommandtod[3][]tfracdifspx#1#2dif#3spx#1
newcommanddod[3][]dfracdifspx#1#2dif#3spx#1
newcommandgenericdel[4]%
ifcase#3relax
ifx#1.else#1fi#4ifx#2.else#2fior
bigl#1#4bigr#2or
Bigl#1#4Bigr#2or
biggl#1#4biggr#2or
Biggl#1#4Biggr#2else
left#1#4right#2fi
newcommanddel[2][-1]genericdel()#1#2
newcommandset[2][-1]genericdel#1#2
letcbrset
newcommandsbr[2][-1]genericdel[]#1#2
letintoodel
letintccsbr
newcommandintoc[2][-1]genericdel(]#1#2
newcommandintco[2][-1]genericdel[)#1#2
newcommandeval[2][-1]#1#2
newcommandenvert[2][-1]#1#2
letabsenvert
newcommandsVert[1][0]orBigr
newcommandenVert[2][-1]#1#2
letnormenVert
newcommandfullfunction[5]%
beginarray@r@r@c@l@
#1 colon & #2 & longrightarrow & #3 \
& #4 & longmapsto & #5
endarray
%%% end of the definitions
makeatother
DeclareMathOperatorTrTr
begindocument
Let $h$ be a linear mapping of $V_1$ into $V_2$. Let
[
h^0 = frac1abs G sum_tin G (rho_t^2)^-1 h rho_t^1
]
where $abs G$ is the order of $G$. Then
beginenumerate[label=(roman*)]
item If $rho^1$ and $rho^2$ are not isomorphic then we have $h^0=0$
item If $V_1 = V_2$ and $rho^1 = rho^2$, $h^0$ is a scalar multiple of the identity,
the scalar being $frac1n Tr(h)$ where $n = dim(V_1)$
endenumerate
enddocument
The code has already been presented in https://tex.stackexchange.com/a/135985/4427 and provides a full replacement of commath, avoiding all its weaknesses. If you're tied to commath because you use its macros and features in other places, this can save you. Otherwise define abs with DeclarePairedDelimiter as suggested by Mico.
For instance, you can notice the reduced space between “where” and “|G|” in the commath version.

You should define anyway an operator name for “Tr”.
If you decide to go for this, save the part between
% begin definitions for a "better commath"
and
% end of the definitions
in a file called bettercommath.sty in the working directory and do usepackagebettercommath.
Compare the output of
documentclass[11pt, a4paper]report
usepackageamsmath
usepackageenumitem
usepackagecommath
DeclareMathOperatorTrTr
begindocument
Let $h$ be a linear mapping of $V_1$ into $V_2$. Let
[
h^0 = frac1abs G sum_tin G (rho_t^2)^-1 h rho_t^1
]
where $abs G$ is the order of $G$. Then
beginenumerate[label=(roman*)]
item If $rho^1$ and $rho^2$ are not isomorphic then we have $h^0=0$
item If $V_1 = V_2$ and $rho^1 = rho^2$, $h^0$ is a scalar multiple of the identity,
the scalar being $frac1n Tr(h)$ where $n = dim(V_1)$
endenumerate
enddocument

with the output of
documentclass[11pt, a4paper]report
usepackageamsmath
usepackageenumitem
makeatletter
% begin definitions for a "better commath"
newcommanddifmathop!mathrmd
newcommandDifmathop!mathrmD
newcommandspx[1]%
ifrelaxdetokenize#1relax
expandafter@gobble
else
expandafter@firstofone
fi
^#1%
newcommandpd[3][]fracpartialspx#1#2partial#3spx#1
newcommandtpd[3][]tfracpartialspx#1#2partial#3spx#1
newcommanddpd[3][]dfracpartialspx#1#2partial#3spx#1
newcommandmd[6]fracpartialspx#2#1partial#3spx#4partial#5spx#6
newcommandtmd[6]tfracpartialspx#2#1partial#3spx#4partial#5spx#6
newcommanddmd[6]dfracpartialspx#2#1partial#3spx#4partial#5spx#6
newcommandod[3][]fracdifspx#1#2dif#3spx#1
newcommandtod[3][]tfracdifspx#1#2dif#3spx#1
newcommanddod[3][]dfracdifspx#1#2dif#3spx#1
newcommandgenericdel[4]%
ifcase#3relax
ifx#1.else#1fi#4ifx#2.else#2fior
bigl#1#4bigr#2or
Bigl#1#4Bigr#2or
biggl#1#4biggr#2or
Biggl#1#4Biggr#2else
left#1#4right#2fi
newcommanddel[2][-1]genericdel()#1#2
newcommandset[2][-1]genericdel#1#2
letcbrset
newcommandsbr[2][-1]genericdel[]#1#2
letintoodel
letintccsbr
newcommandintoc[2][-1]genericdel(]#1#2
newcommandintco[2][-1]genericdel[)#1#2
newcommandeval[2][-1]#1#2
newcommandenvert[2][-1]#1#2
letabsenvert
newcommandsVert[1][0]orBigr
newcommandenVert[2][-1]#1#2
letnormenVert
newcommandfullfunction[5]%
beginarray@r@r@c@l@
#1 colon & #2 & longrightarrow & #3 \
& #4 & longmapsto & #5
endarray
%%% end of the definitions
makeatother
DeclareMathOperatorTrTr
begindocument
Let $h$ be a linear mapping of $V_1$ into $V_2$. Let
[
h^0 = frac1abs G sum_tin G (rho_t^2)^-1 h rho_t^1
]
where $abs G$ is the order of $G$. Then
beginenumerate[label=(roman*)]
item If $rho^1$ and $rho^2$ are not isomorphic then we have $h^0=0$
item If $V_1 = V_2$ and $rho^1 = rho^2$, $h^0$ is a scalar multiple of the identity,
the scalar being $frac1n Tr(h)$ where $n = dim(V_1)$
endenumerate
enddocument
The code has already been presented in https://tex.stackexchange.com/a/135985/4427 and provides a full replacement of commath, avoiding all its weaknesses. If you're tied to commath because you use its macros and features in other places, this can save you. Otherwise define abs with DeclarePairedDelimiter as suggested by Mico.
For instance, you can notice the reduced space between “where” and “|G|” in the commath version.

You should define anyway an operator name for “Tr”.
If you decide to go for this, save the part between
% begin definitions for a "better commath"
and
% end of the definitions
in a file called bettercommath.sty in the working directory and do usepackagebettercommath.
answered 9 hours ago
egregegreg
732k8919313254
732k8919313254
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%2f483944%2ffractional-alignment%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
I mean, can the |G| be pushed a little to the right? since the vertical "bars" and not aligned with the horizontal fractional line?
– Maths
11 hours ago
1
You can always add space to it:
,abs G.– JouleV
11 hours ago
1
Hmm, I don't think it deserves closure. This is a good question and my solution is only a workaround - it is not 100% centered. Maybe some TeXperts out there will provide a good answer.
– JouleV
11 hours ago
1
@JouleV I agree, the question shouldn't be closed. It's definitely a bug (feature?) in
commath.– campa
11 hours ago
1
See tex.stackexchange.com/a/135985/4427, if you really want to use
commathmacros.– egreg
10 hours ago