left and right not working on parentheses within the same line when internal fractions are changed
I'm trying to show the product of two Legendre symbols. When I compile the following
documentclass{article}
begin{document}
$$left(frac{x}{p}right) left(frac{x}{p}right)$$
end{document}
it yields
as expected. However, when I switch the variables, i.e.
documentclass{article}
begin{document}
$$left(frac{x}{p}right)left(frac{p}{x}right)$$
end{document}
it yields
How do I resolve this? Why do the values within the fractions matter?
math-mode
add a comment |
I'm trying to show the product of two Legendre symbols. When I compile the following
documentclass{article}
begin{document}
$$left(frac{x}{p}right) left(frac{x}{p}right)$$
end{document}
it yields
as expected. However, when I switch the variables, i.e.
documentclass{article}
begin{document}
$$left(frac{x}{p}right)left(frac{p}{x}right)$$
end{document}
it yields
How do I resolve this? Why do the values within the fractions matter?
math-mode
1
The double signs of$$
it is a old syntax. You should must[...]
.
– Sebastiano
Nov 24 '18 at 19:30
add a comment |
I'm trying to show the product of two Legendre symbols. When I compile the following
documentclass{article}
begin{document}
$$left(frac{x}{p}right) left(frac{x}{p}right)$$
end{document}
it yields
as expected. However, when I switch the variables, i.e.
documentclass{article}
begin{document}
$$left(frac{x}{p}right)left(frac{p}{x}right)$$
end{document}
it yields
How do I resolve this? Why do the values within the fractions matter?
math-mode
I'm trying to show the product of two Legendre symbols. When I compile the following
documentclass{article}
begin{document}
$$left(frac{x}{p}right) left(frac{x}{p}right)$$
end{document}
it yields
as expected. However, when I switch the variables, i.e.
documentclass{article}
begin{document}
$$left(frac{x}{p}right)left(frac{p}{x}right)$$
end{document}
it yields
How do I resolve this? Why do the values within the fractions matter?
math-mode
math-mode
asked Nov 24 '18 at 16:55
Antoine EgoAntoine Ego
1037
1037
1
The double signs of$$
it is a old syntax. You should must[...]
.
– Sebastiano
Nov 24 '18 at 19:30
add a comment |
1
The double signs of$$
it is a old syntax. You should must[...]
.
– Sebastiano
Nov 24 '18 at 19:30
1
1
The double signs of
$$
it is a old syntax. You should must [...]
.– Sebastiano
Nov 24 '18 at 19:30
The double signs of
$$
it is a old syntax. You should must [...]
.– Sebastiano
Nov 24 '18 at 19:30
add a comment |
3 Answers
3
active
oldest
votes
This is somewhat similar to this question.
The values in the fractions matter because the boxes of the characters have different sizes. The p
has a descender below the baseline which the x
doesn't, thus when you swap them, the box of the denominator get a little bigger and TeX uses a larger delimiter to make that fit.
You have a few possibilities to work around that (basically the same ones I listed in the linked question):
You can use a fixed delimiter size (
bigg
orBig
, for instance):
$$Bigl(frac{x}{p}Bigr)Bigl(frac{p}{x}Bigr)$$
$$biggl(frac{x}{p}biggr)biggl(frac{p}{x}biggr)$$
You can
raise
thep
so that TeX won't try to use a larger box:
$$left(frac{x}{raise0.35exhbox{$p$}}right)left(frac{p}{x}right)$$
or you can add an invisible
p
next to thex
so that the delimiter used will be the larger one:
$$left(frac{x}{p}right)left(frac{p}{vphantom{p}x}right)$$
Or you can change change TeX's
delimiterfactor
(anddelimitershortfall
, which I didn't show here) and let TeX adjust the delimiters accordingly:
$$delimiterfactor=790
left(frac{x}{p}right)left(frac{p}{x}right)$$
$$delimiterfactor=970
left(frac{x}{p}right)left(frac{p}{x}right)$$
Full code:
documentclass{article}
begin{document}
% delimitershortfall=5pt % Default
% delimiterfactor=901 % Default
$$left(frac{x}{p}right)left(frac{p}{x}right)$$
$$Bigl(frac{x}{p}Bigr)Bigl(frac{p}{x}Bigr)$$
$$biggl(frac{x}{p}biggr)biggl(frac{p}{x}biggr)$$
$$left(frac{x}{raise0.35exhbox{$p$}}right)left(frac{p}{x}right)$$
$$left(frac{x}{p}right)left(frac{p}{vphantom{p}x}right)$$
$$delimiterfactor=790
left(frac{x}{p}right)left(frac{p}{x}right)$$
$$delimiterfactor=970
left(frac{x}{p}right)left(frac{p}{x}right)$$
end{document}
Output:
add a comment |
Use genfrac
for this:
documentclass{article}
usepackage{amsmath}
newcommand{genlegendre}[3]{genfrac{(}{)}{}{#1}{#2}{#3}}
newcommand{legendre}[2]{genlegendre{}{#1}{#2}}
newcommand{dlegendre}[2]{genlegendre{0}{#1}{#2}}
newcommand{tlegendre}[2]{genlegendre{1}{#1}{#2}}
begin{document}
[
legendre{x}{p}quadlegendre{p}{x}quad
legendre{x}{x}quadlegendre{d}{b}
]
end{document}
The variants dlegendre
and tlegendre
are analogous to dfrac
and tfrac
.
I've never heard oftfrac
, what's the package that defines it?
– AndréC
Nov 24 '18 at 22:14
1
@AndréCamsmath
, along withdfrac
; alsobinom
,dbinom
andtbinom
. In some cases, in displaystfrac
is needed not to give prominence to fractional factors.
– egreg
Nov 24 '18 at 22:24
add a comment |
I like the unified syntax for this kind of stuff in the mathtools
package.
documentclass{article}
usepackage{mathtools}
DeclarePairedDelimiter{paren}{lparen}{rparen}
begin{document}
begin{equation*}
paren*{frac{x}{p} }quad paren*{frac{p}{x}}
qquad
paren[bigg]{frac{x}{p}} quad paren[bigg]{frac{p}{x}}
end{equation*}
end{document}
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%2f461582%2fleft-and-right-not-working-on-parentheses-within-the-same-line-when-internal-f%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
This is somewhat similar to this question.
The values in the fractions matter because the boxes of the characters have different sizes. The p
has a descender below the baseline which the x
doesn't, thus when you swap them, the box of the denominator get a little bigger and TeX uses a larger delimiter to make that fit.
You have a few possibilities to work around that (basically the same ones I listed in the linked question):
You can use a fixed delimiter size (
bigg
orBig
, for instance):
$$Bigl(frac{x}{p}Bigr)Bigl(frac{p}{x}Bigr)$$
$$biggl(frac{x}{p}biggr)biggl(frac{p}{x}biggr)$$
You can
raise
thep
so that TeX won't try to use a larger box:
$$left(frac{x}{raise0.35exhbox{$p$}}right)left(frac{p}{x}right)$$
or you can add an invisible
p
next to thex
so that the delimiter used will be the larger one:
$$left(frac{x}{p}right)left(frac{p}{vphantom{p}x}right)$$
Or you can change change TeX's
delimiterfactor
(anddelimitershortfall
, which I didn't show here) and let TeX adjust the delimiters accordingly:
$$delimiterfactor=790
left(frac{x}{p}right)left(frac{p}{x}right)$$
$$delimiterfactor=970
left(frac{x}{p}right)left(frac{p}{x}right)$$
Full code:
documentclass{article}
begin{document}
% delimitershortfall=5pt % Default
% delimiterfactor=901 % Default
$$left(frac{x}{p}right)left(frac{p}{x}right)$$
$$Bigl(frac{x}{p}Bigr)Bigl(frac{p}{x}Bigr)$$
$$biggl(frac{x}{p}biggr)biggl(frac{p}{x}biggr)$$
$$left(frac{x}{raise0.35exhbox{$p$}}right)left(frac{p}{x}right)$$
$$left(frac{x}{p}right)left(frac{p}{vphantom{p}x}right)$$
$$delimiterfactor=790
left(frac{x}{p}right)left(frac{p}{x}right)$$
$$delimiterfactor=970
left(frac{x}{p}right)left(frac{p}{x}right)$$
end{document}
Output:
add a comment |
This is somewhat similar to this question.
The values in the fractions matter because the boxes of the characters have different sizes. The p
has a descender below the baseline which the x
doesn't, thus when you swap them, the box of the denominator get a little bigger and TeX uses a larger delimiter to make that fit.
You have a few possibilities to work around that (basically the same ones I listed in the linked question):
You can use a fixed delimiter size (
bigg
orBig
, for instance):
$$Bigl(frac{x}{p}Bigr)Bigl(frac{p}{x}Bigr)$$
$$biggl(frac{x}{p}biggr)biggl(frac{p}{x}biggr)$$
You can
raise
thep
so that TeX won't try to use a larger box:
$$left(frac{x}{raise0.35exhbox{$p$}}right)left(frac{p}{x}right)$$
or you can add an invisible
p
next to thex
so that the delimiter used will be the larger one:
$$left(frac{x}{p}right)left(frac{p}{vphantom{p}x}right)$$
Or you can change change TeX's
delimiterfactor
(anddelimitershortfall
, which I didn't show here) and let TeX adjust the delimiters accordingly:
$$delimiterfactor=790
left(frac{x}{p}right)left(frac{p}{x}right)$$
$$delimiterfactor=970
left(frac{x}{p}right)left(frac{p}{x}right)$$
Full code:
documentclass{article}
begin{document}
% delimitershortfall=5pt % Default
% delimiterfactor=901 % Default
$$left(frac{x}{p}right)left(frac{p}{x}right)$$
$$Bigl(frac{x}{p}Bigr)Bigl(frac{p}{x}Bigr)$$
$$biggl(frac{x}{p}biggr)biggl(frac{p}{x}biggr)$$
$$left(frac{x}{raise0.35exhbox{$p$}}right)left(frac{p}{x}right)$$
$$left(frac{x}{p}right)left(frac{p}{vphantom{p}x}right)$$
$$delimiterfactor=790
left(frac{x}{p}right)left(frac{p}{x}right)$$
$$delimiterfactor=970
left(frac{x}{p}right)left(frac{p}{x}right)$$
end{document}
Output:
add a comment |
This is somewhat similar to this question.
The values in the fractions matter because the boxes of the characters have different sizes. The p
has a descender below the baseline which the x
doesn't, thus when you swap them, the box of the denominator get a little bigger and TeX uses a larger delimiter to make that fit.
You have a few possibilities to work around that (basically the same ones I listed in the linked question):
You can use a fixed delimiter size (
bigg
orBig
, for instance):
$$Bigl(frac{x}{p}Bigr)Bigl(frac{p}{x}Bigr)$$
$$biggl(frac{x}{p}biggr)biggl(frac{p}{x}biggr)$$
You can
raise
thep
so that TeX won't try to use a larger box:
$$left(frac{x}{raise0.35exhbox{$p$}}right)left(frac{p}{x}right)$$
or you can add an invisible
p
next to thex
so that the delimiter used will be the larger one:
$$left(frac{x}{p}right)left(frac{p}{vphantom{p}x}right)$$
Or you can change change TeX's
delimiterfactor
(anddelimitershortfall
, which I didn't show here) and let TeX adjust the delimiters accordingly:
$$delimiterfactor=790
left(frac{x}{p}right)left(frac{p}{x}right)$$
$$delimiterfactor=970
left(frac{x}{p}right)left(frac{p}{x}right)$$
Full code:
documentclass{article}
begin{document}
% delimitershortfall=5pt % Default
% delimiterfactor=901 % Default
$$left(frac{x}{p}right)left(frac{p}{x}right)$$
$$Bigl(frac{x}{p}Bigr)Bigl(frac{p}{x}Bigr)$$
$$biggl(frac{x}{p}biggr)biggl(frac{p}{x}biggr)$$
$$left(frac{x}{raise0.35exhbox{$p$}}right)left(frac{p}{x}right)$$
$$left(frac{x}{p}right)left(frac{p}{vphantom{p}x}right)$$
$$delimiterfactor=790
left(frac{x}{p}right)left(frac{p}{x}right)$$
$$delimiterfactor=970
left(frac{x}{p}right)left(frac{p}{x}right)$$
end{document}
Output:
This is somewhat similar to this question.
The values in the fractions matter because the boxes of the characters have different sizes. The p
has a descender below the baseline which the x
doesn't, thus when you swap them, the box of the denominator get a little bigger and TeX uses a larger delimiter to make that fit.
You have a few possibilities to work around that (basically the same ones I listed in the linked question):
You can use a fixed delimiter size (
bigg
orBig
, for instance):
$$Bigl(frac{x}{p}Bigr)Bigl(frac{p}{x}Bigr)$$
$$biggl(frac{x}{p}biggr)biggl(frac{p}{x}biggr)$$
You can
raise
thep
so that TeX won't try to use a larger box:
$$left(frac{x}{raise0.35exhbox{$p$}}right)left(frac{p}{x}right)$$
or you can add an invisible
p
next to thex
so that the delimiter used will be the larger one:
$$left(frac{x}{p}right)left(frac{p}{vphantom{p}x}right)$$
Or you can change change TeX's
delimiterfactor
(anddelimitershortfall
, which I didn't show here) and let TeX adjust the delimiters accordingly:
$$delimiterfactor=790
left(frac{x}{p}right)left(frac{p}{x}right)$$
$$delimiterfactor=970
left(frac{x}{p}right)left(frac{p}{x}right)$$
Full code:
documentclass{article}
begin{document}
% delimitershortfall=5pt % Default
% delimiterfactor=901 % Default
$$left(frac{x}{p}right)left(frac{p}{x}right)$$
$$Bigl(frac{x}{p}Bigr)Bigl(frac{p}{x}Bigr)$$
$$biggl(frac{x}{p}biggr)biggl(frac{p}{x}biggr)$$
$$left(frac{x}{raise0.35exhbox{$p$}}right)left(frac{p}{x}right)$$
$$left(frac{x}{p}right)left(frac{p}{vphantom{p}x}right)$$
$$delimiterfactor=790
left(frac{x}{p}right)left(frac{p}{x}right)$$
$$delimiterfactor=970
left(frac{x}{p}right)left(frac{p}{x}right)$$
end{document}
Output:
answered Nov 24 '18 at 17:16
Phelype OleinikPhelype Oleinik
25.8k54691
25.8k54691
add a comment |
add a comment |
Use genfrac
for this:
documentclass{article}
usepackage{amsmath}
newcommand{genlegendre}[3]{genfrac{(}{)}{}{#1}{#2}{#3}}
newcommand{legendre}[2]{genlegendre{}{#1}{#2}}
newcommand{dlegendre}[2]{genlegendre{0}{#1}{#2}}
newcommand{tlegendre}[2]{genlegendre{1}{#1}{#2}}
begin{document}
[
legendre{x}{p}quadlegendre{p}{x}quad
legendre{x}{x}quadlegendre{d}{b}
]
end{document}
The variants dlegendre
and tlegendre
are analogous to dfrac
and tfrac
.
I've never heard oftfrac
, what's the package that defines it?
– AndréC
Nov 24 '18 at 22:14
1
@AndréCamsmath
, along withdfrac
; alsobinom
,dbinom
andtbinom
. In some cases, in displaystfrac
is needed not to give prominence to fractional factors.
– egreg
Nov 24 '18 at 22:24
add a comment |
Use genfrac
for this:
documentclass{article}
usepackage{amsmath}
newcommand{genlegendre}[3]{genfrac{(}{)}{}{#1}{#2}{#3}}
newcommand{legendre}[2]{genlegendre{}{#1}{#2}}
newcommand{dlegendre}[2]{genlegendre{0}{#1}{#2}}
newcommand{tlegendre}[2]{genlegendre{1}{#1}{#2}}
begin{document}
[
legendre{x}{p}quadlegendre{p}{x}quad
legendre{x}{x}quadlegendre{d}{b}
]
end{document}
The variants dlegendre
and tlegendre
are analogous to dfrac
and tfrac
.
I've never heard oftfrac
, what's the package that defines it?
– AndréC
Nov 24 '18 at 22:14
1
@AndréCamsmath
, along withdfrac
; alsobinom
,dbinom
andtbinom
. In some cases, in displaystfrac
is needed not to give prominence to fractional factors.
– egreg
Nov 24 '18 at 22:24
add a comment |
Use genfrac
for this:
documentclass{article}
usepackage{amsmath}
newcommand{genlegendre}[3]{genfrac{(}{)}{}{#1}{#2}{#3}}
newcommand{legendre}[2]{genlegendre{}{#1}{#2}}
newcommand{dlegendre}[2]{genlegendre{0}{#1}{#2}}
newcommand{tlegendre}[2]{genlegendre{1}{#1}{#2}}
begin{document}
[
legendre{x}{p}quadlegendre{p}{x}quad
legendre{x}{x}quadlegendre{d}{b}
]
end{document}
The variants dlegendre
and tlegendre
are analogous to dfrac
and tfrac
.
Use genfrac
for this:
documentclass{article}
usepackage{amsmath}
newcommand{genlegendre}[3]{genfrac{(}{)}{}{#1}{#2}{#3}}
newcommand{legendre}[2]{genlegendre{}{#1}{#2}}
newcommand{dlegendre}[2]{genlegendre{0}{#1}{#2}}
newcommand{tlegendre}[2]{genlegendre{1}{#1}{#2}}
begin{document}
[
legendre{x}{p}quadlegendre{p}{x}quad
legendre{x}{x}quadlegendre{d}{b}
]
end{document}
The variants dlegendre
and tlegendre
are analogous to dfrac
and tfrac
.
answered Nov 24 '18 at 22:09
egregegreg
735k8919343260
735k8919343260
I've never heard oftfrac
, what's the package that defines it?
– AndréC
Nov 24 '18 at 22:14
1
@AndréCamsmath
, along withdfrac
; alsobinom
,dbinom
andtbinom
. In some cases, in displaystfrac
is needed not to give prominence to fractional factors.
– egreg
Nov 24 '18 at 22:24
add a comment |
I've never heard oftfrac
, what's the package that defines it?
– AndréC
Nov 24 '18 at 22:14
1
@AndréCamsmath
, along withdfrac
; alsobinom
,dbinom
andtbinom
. In some cases, in displaystfrac
is needed not to give prominence to fractional factors.
– egreg
Nov 24 '18 at 22:24
I've never heard of
tfrac
, what's the package that defines it?– AndréC
Nov 24 '18 at 22:14
I've never heard of
tfrac
, what's the package that defines it?– AndréC
Nov 24 '18 at 22:14
1
1
@AndréC
amsmath
, along with dfrac
; also binom
, dbinom
and tbinom
. In some cases, in displays tfrac
is needed not to give prominence to fractional factors.– egreg
Nov 24 '18 at 22:24
@AndréC
amsmath
, along with dfrac
; also binom
, dbinom
and tbinom
. In some cases, in displays tfrac
is needed not to give prominence to fractional factors.– egreg
Nov 24 '18 at 22:24
add a comment |
I like the unified syntax for this kind of stuff in the mathtools
package.
documentclass{article}
usepackage{mathtools}
DeclarePairedDelimiter{paren}{lparen}{rparen}
begin{document}
begin{equation*}
paren*{frac{x}{p} }quad paren*{frac{p}{x}}
qquad
paren[bigg]{frac{x}{p}} quad paren[bigg]{frac{p}{x}}
end{equation*}
end{document}
add a comment |
I like the unified syntax for this kind of stuff in the mathtools
package.
documentclass{article}
usepackage{mathtools}
DeclarePairedDelimiter{paren}{lparen}{rparen}
begin{document}
begin{equation*}
paren*{frac{x}{p} }quad paren*{frac{p}{x}}
qquad
paren[bigg]{frac{x}{p}} quad paren[bigg]{frac{p}{x}}
end{equation*}
end{document}
add a comment |
I like the unified syntax for this kind of stuff in the mathtools
package.
documentclass{article}
usepackage{mathtools}
DeclarePairedDelimiter{paren}{lparen}{rparen}
begin{document}
begin{equation*}
paren*{frac{x}{p} }quad paren*{frac{p}{x}}
qquad
paren[bigg]{frac{x}{p}} quad paren[bigg]{frac{p}{x}}
end{equation*}
end{document}
I like the unified syntax for this kind of stuff in the mathtools
package.
documentclass{article}
usepackage{mathtools}
DeclarePairedDelimiter{paren}{lparen}{rparen}
begin{document}
begin{equation*}
paren*{frac{x}{p} }quad paren*{frac{p}{x}}
qquad
paren[bigg]{frac{x}{p}} quad paren[bigg]{frac{p}{x}}
end{equation*}
end{document}
answered Nov 27 '18 at 21:29
Máté WierdlMáté Wierdl
53729
53729
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%2f461582%2fleft-and-right-not-working-on-parentheses-within-the-same-line-when-internal-f%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
1
The double signs of
$$
it is a old syntax. You should must[...]
.– Sebastiano
Nov 24 '18 at 19:30