Math-accent symbol over parentheses enclosing accented symbol (amsmath) The Next CEO of Stack OverflowWhy do arguments to nested tilde or breve commands reappear when amsmath is used?dot over vec over : amsmath bug/feature?amsmath possible bug: dot over bracketed dotxdot over vec over : amsmath bug/feature?How can I draw a straight vertical accent (like textvbaraccent) over a symbol in math mode?Unusual custom math accentEquation number enclosing parentheses misplaced with Polyglossia+Hebrew+amsmathConfigurable and Extensible Accents (Arrows, Dots, Vectors)Accented math operatorAccent in letters over a Lettermath accent before starred macro, with unicode-math or without amsmathCannot put accent over letter 'a'Unusual Accented Letter: umlaut + accent

A hang glider, sudden unexpected lift to 25,000 feet altitude, what could do this?

How badly should I try to prevent a user from XSSing themselves?

Could a dragon use its wings to swim?

How do I secure a TV wall mount?

How can I replace x-axis labels with pre-determined symbols?

How does a dynamic QR code work?

Is it OK to decorate a log book cover?

What difference does it make matching a word with/without a trailing whitespace?

How to implement Comparable so it is consistent with identity-equality

Man transported from Alternate World into ours by a Neutrino Detector

Salesforce opportunity stages

Gödel's incompleteness theorems - what are the religious implications?

Are British MPs missing the point, with these 'Indicative Votes'?

Car headlights in a world without electricity

Finitely generated matrix groups whose eigenvalues are all algebraic

Is it possible to create a QR code using text?

Is the offspring between a demon and a celestial possible? If so what is it called and is it in a book somewhere?

Why doesn't Shulchan Aruch include the laws of destroying fruit trees?

Is it a bad idea to plug the other end of ESD strap to wall ground?

How to pronounce fünf in 45

Ising model simulation

"Eavesdropping" vs "Listen in on"

My ex-girlfriend uses my Apple ID to login to her iPad, do I have to give her my Apple ID password to reset it?

Prodigo = pro + ago?



Math-accent symbol over parentheses enclosing accented symbol (amsmath)



The Next CEO of Stack OverflowWhy do arguments to nested tilde or breve commands reappear when amsmath is used?dot over vec over : amsmath bug/feature?amsmath possible bug: dot over bracketed dotxdot over vec over : amsmath bug/feature?How can I draw a straight vertical accent (like textvbaraccent) over a symbol in math mode?Unusual custom math accentEquation number enclosing parentheses misplaced with Polyglossia+Hebrew+amsmathConfigurable and Extensible Accents (Arrows, Dots, Vectors)Accented math operatorAccent in letters over a Lettermath accent before starred macro, with unicode-math or without amsmathCannot put accent over letter 'a'Unusual Accented Letter: umlaut + accent










5















I'm trying to write an expression in which an accented expression enclosed by parentheses has an accent over the parentheses. For example,



vec(dotx)


This typesets fine when amsmath is not loaded, but with amsmath present, the x is typeset to the right of the dot, as if the inner expression is being treated as



dotx


This behavior only happens when a closing parentheses (or bracket or brace) is part of the argument to the outer accent.



The best workaround I've been able to find is to use overset for the outer accent instead of the actual accent command (or accentset).



Is this behavior expected/documented anywhere?




I believe that this question was previously asked at
amsmath possible bug: dot over bracketed dotx, but was incorrectly marked as a duplicate of dot over vec over : amsmath bug/feature?. The latter question was about the differences in typesetting between dotting a subscripted character and subscripting a dotted character.










share|improve this question







New contributor




RLH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • I guess this is rather related to tex.stackexchange.com/q/30327/4427. On the other hand, (vec{dotx) seems better syntax.

    – egreg
    2 days ago











  • Thanks. On the syntax question, putting the parentheses outside the vec command is semantically different from applying the vec to the whole contents of the parentheses. My vec(dotx) minimal example probably would not be used in practice, but applying accents to parenthetically-delimited expressions or to matrices has multiple use-cases.

    – RLH
    2 days ago











  • How's the reader supposed to know the difference between vec(dotx) and (vecdotx)? And, if you have vec(blahblah) the problem is even worse.

    – egreg
    2 days ago












  • As I said, I don't think that my minimal example will be used in practice. An expression like dotbeginbmatrix x \ dotx endbmatrix has a use-case (in explaining basic controls systems principles), and gets mangled by this bug. As a second example, in vec(exp dotx) vs (vecexp dotx), the vec is set higher on the first expression, clearly indicating that it applies to the contents of the parentheses.

    – RLH
    2 days ago












  • Funny thing, I wrote a package to shift the accents of mathaccentV (the macro amsmath uses internally for dot, etc.), which doesn't suffer from this issue. I'll try to provide a patch from that.

    – Skillmon
    2 days ago















5















I'm trying to write an expression in which an accented expression enclosed by parentheses has an accent over the parentheses. For example,



vec(dotx)


This typesets fine when amsmath is not loaded, but with amsmath present, the x is typeset to the right of the dot, as if the inner expression is being treated as



dotx


This behavior only happens when a closing parentheses (or bracket or brace) is part of the argument to the outer accent.



The best workaround I've been able to find is to use overset for the outer accent instead of the actual accent command (or accentset).



Is this behavior expected/documented anywhere?




I believe that this question was previously asked at
amsmath possible bug: dot over bracketed dotx, but was incorrectly marked as a duplicate of dot over vec over : amsmath bug/feature?. The latter question was about the differences in typesetting between dotting a subscripted character and subscripting a dotted character.










share|improve this question







New contributor




RLH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • I guess this is rather related to tex.stackexchange.com/q/30327/4427. On the other hand, (vec{dotx) seems better syntax.

    – egreg
    2 days ago











  • Thanks. On the syntax question, putting the parentheses outside the vec command is semantically different from applying the vec to the whole contents of the parentheses. My vec(dotx) minimal example probably would not be used in practice, but applying accents to parenthetically-delimited expressions or to matrices has multiple use-cases.

    – RLH
    2 days ago











  • How's the reader supposed to know the difference between vec(dotx) and (vecdotx)? And, if you have vec(blahblah) the problem is even worse.

    – egreg
    2 days ago












  • As I said, I don't think that my minimal example will be used in practice. An expression like dotbeginbmatrix x \ dotx endbmatrix has a use-case (in explaining basic controls systems principles), and gets mangled by this bug. As a second example, in vec(exp dotx) vs (vecexp dotx), the vec is set higher on the first expression, clearly indicating that it applies to the contents of the parentheses.

    – RLH
    2 days ago












  • Funny thing, I wrote a package to shift the accents of mathaccentV (the macro amsmath uses internally for dot, etc.), which doesn't suffer from this issue. I'll try to provide a patch from that.

    – Skillmon
    2 days ago













5












5








5








I'm trying to write an expression in which an accented expression enclosed by parentheses has an accent over the parentheses. For example,



vec(dotx)


This typesets fine when amsmath is not loaded, but with amsmath present, the x is typeset to the right of the dot, as if the inner expression is being treated as



dotx


This behavior only happens when a closing parentheses (or bracket or brace) is part of the argument to the outer accent.



The best workaround I've been able to find is to use overset for the outer accent instead of the actual accent command (or accentset).



Is this behavior expected/documented anywhere?




I believe that this question was previously asked at
amsmath possible bug: dot over bracketed dotx, but was incorrectly marked as a duplicate of dot over vec over : amsmath bug/feature?. The latter question was about the differences in typesetting between dotting a subscripted character and subscripting a dotted character.










share|improve this question







New contributor




RLH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I'm trying to write an expression in which an accented expression enclosed by parentheses has an accent over the parentheses. For example,



vec(dotx)


This typesets fine when amsmath is not loaded, but with amsmath present, the x is typeset to the right of the dot, as if the inner expression is being treated as



dotx


This behavior only happens when a closing parentheses (or bracket or brace) is part of the argument to the outer accent.



The best workaround I've been able to find is to use overset for the outer accent instead of the actual accent command (or accentset).



Is this behavior expected/documented anywhere?




I believe that this question was previously asked at
amsmath possible bug: dot over bracketed dotx, but was incorrectly marked as a duplicate of dot over vec over : amsmath bug/feature?. The latter question was about the differences in typesetting between dotting a subscripted character and subscripting a dotted character.







amsmath accents






share|improve this question







New contributor




RLH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




RLH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




RLH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 days ago









RLHRLH

1283




1283




New contributor




RLH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





RLH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






RLH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • I guess this is rather related to tex.stackexchange.com/q/30327/4427. On the other hand, (vec{dotx) seems better syntax.

    – egreg
    2 days ago











  • Thanks. On the syntax question, putting the parentheses outside the vec command is semantically different from applying the vec to the whole contents of the parentheses. My vec(dotx) minimal example probably would not be used in practice, but applying accents to parenthetically-delimited expressions or to matrices has multiple use-cases.

    – RLH
    2 days ago











  • How's the reader supposed to know the difference between vec(dotx) and (vecdotx)? And, if you have vec(blahblah) the problem is even worse.

    – egreg
    2 days ago












  • As I said, I don't think that my minimal example will be used in practice. An expression like dotbeginbmatrix x \ dotx endbmatrix has a use-case (in explaining basic controls systems principles), and gets mangled by this bug. As a second example, in vec(exp dotx) vs (vecexp dotx), the vec is set higher on the first expression, clearly indicating that it applies to the contents of the parentheses.

    – RLH
    2 days ago












  • Funny thing, I wrote a package to shift the accents of mathaccentV (the macro amsmath uses internally for dot, etc.), which doesn't suffer from this issue. I'll try to provide a patch from that.

    – Skillmon
    2 days ago

















  • I guess this is rather related to tex.stackexchange.com/q/30327/4427. On the other hand, (vec{dotx) seems better syntax.

    – egreg
    2 days ago











  • Thanks. On the syntax question, putting the parentheses outside the vec command is semantically different from applying the vec to the whole contents of the parentheses. My vec(dotx) minimal example probably would not be used in practice, but applying accents to parenthetically-delimited expressions or to matrices has multiple use-cases.

    – RLH
    2 days ago











  • How's the reader supposed to know the difference between vec(dotx) and (vecdotx)? And, if you have vec(blahblah) the problem is even worse.

    – egreg
    2 days ago












  • As I said, I don't think that my minimal example will be used in practice. An expression like dotbeginbmatrix x \ dotx endbmatrix has a use-case (in explaining basic controls systems principles), and gets mangled by this bug. As a second example, in vec(exp dotx) vs (vecexp dotx), the vec is set higher on the first expression, clearly indicating that it applies to the contents of the parentheses.

    – RLH
    2 days ago












  • Funny thing, I wrote a package to shift the accents of mathaccentV (the macro amsmath uses internally for dot, etc.), which doesn't suffer from this issue. I'll try to provide a patch from that.

    – Skillmon
    2 days ago
















I guess this is rather related to tex.stackexchange.com/q/30327/4427. On the other hand, (vec{dotx) seems better syntax.

– egreg
2 days ago





I guess this is rather related to tex.stackexchange.com/q/30327/4427. On the other hand, (vec{dotx) seems better syntax.

– egreg
2 days ago













Thanks. On the syntax question, putting the parentheses outside the vec command is semantically different from applying the vec to the whole contents of the parentheses. My vec(dotx) minimal example probably would not be used in practice, but applying accents to parenthetically-delimited expressions or to matrices has multiple use-cases.

– RLH
2 days ago





Thanks. On the syntax question, putting the parentheses outside the vec command is semantically different from applying the vec to the whole contents of the parentheses. My vec(dotx) minimal example probably would not be used in practice, but applying accents to parenthetically-delimited expressions or to matrices has multiple use-cases.

– RLH
2 days ago













How's the reader supposed to know the difference between vec(dotx) and (vecdotx)? And, if you have vec(blahblah) the problem is even worse.

– egreg
2 days ago






How's the reader supposed to know the difference between vec(dotx) and (vecdotx)? And, if you have vec(blahblah) the problem is even worse.

– egreg
2 days ago














As I said, I don't think that my minimal example will be used in practice. An expression like dotbeginbmatrix x \ dotx endbmatrix has a use-case (in explaining basic controls systems principles), and gets mangled by this bug. As a second example, in vec(exp dotx) vs (vecexp dotx), the vec is set higher on the first expression, clearly indicating that it applies to the contents of the parentheses.

– RLH
2 days ago






As I said, I don't think that my minimal example will be used in practice. An expression like dotbeginbmatrix x \ dotx endbmatrix has a use-case (in explaining basic controls systems principles), and gets mangled by this bug. As a second example, in vec(exp dotx) vs (vecexp dotx), the vec is set higher on the first expression, clearly indicating that it applies to the contents of the parentheses.

– RLH
2 days ago














Funny thing, I wrote a package to shift the accents of mathaccentV (the macro amsmath uses internally for dot, etc.), which doesn't suffer from this issue. I'll try to provide a patch from that.

– Skillmon
2 days ago





Funny thing, I wrote a package to shift the accents of mathaccentV (the macro amsmath uses internally for dot, etc.), which doesn't suffer from this issue. I'll try to provide a patch from that.

– Skillmon
2 days ago










2 Answers
2






active

oldest

votes


















4














This has to do with a long-standing amsmath issue, see Why do arguments to nested tilde or breve commands reappear when amsmath is used?



I can offer a workaround.



documentclassarticle
usepackageamsmath

makeatletter
newcommanddblacc[2]mathpalettedblacc@#1#2
newcommanddblacc@[2]dblacc@@#1#2
newcommanddblacc@@[3]%
begingroup
sboxz@$m@th#1#3$%
#2boxz@%
endgroup

makeatother

begindocument

begingather*
dblaccvec(dotx)
\
dblaccdotbeginbmatrix x \ dotx endbmatrix
\
dblaccvec(exp dotx)
endgather*

enddocument


enter image description here



A version that works also with accents:



documentclassarticle
usepackageamsmath
usepackageaccents

makeatletter
newsaveboxdblacc@boxa
newsaveboxdblacc@boxb
DeclareRobustCommanddblacc[2]mathpalettedblacc@#1#2
newcommanddblacc@[2]dblacc@@#1#2
newcommanddblacc@@[3]%
begingroup
sboxdblacc@boxa$m@th#1#3$%
sboxdblacc@boxb$m@th#1#2copydblacc@boxa$%
boxdblacc@boxb
endgroup

makeatother

begindocument

begingather*
dblaccvec(dotx)quadscriptscriptstyledblaccvec(dotx)
\
dblaccdotbeginbmatrix x \ dotx endbmatrix
\
dblaccvec(exp dotx)
endgather*

enddocument





share|improve this answer

























  • Thanks very much. If it's not too much trouble, is there a way to make this compatible with the accents package? I'm using the accentset command in my document for a custom accent, and with the accents package turned on, the arguments to the outer accent all disappear.

    – RLH
    2 days ago











  • @RLH newcommandmyaccent[1]accentset<accent>#1 and dblaccmyaccentwhatever should work

    – egreg
    2 days ago











  • Sorry for the miscommunication: The problem I'm running into is that if I add usepackageaccents to the preamble of the example document you posted, only the outer accent character appears -- the rest of the expression is not typeset.

    – RLH
    2 days ago











  • @RLH Problem solved. :-D

    – egreg
    2 days ago


















4














The following redefines an internal of amsmath. After that the output of your example looks good. I don't know whether this has any possibility of breaking other stuff. I've added every test case egreg used in his answer and the output looks good. It doesn't work with the accents package, though.



documentclass[]article

usepackage[]amsmath

makeatletter
protecteddefmathaccentV#1#2#3#4#5%
%
ifmmode
mathaccentV@do#2#3#4#5%
else
@xpnonmatherr@csname #1endcsname
fi

defmathaccentV@do#1#2#3#4%
%
globalletmacc@nucleus@empty
mathaccent"accentclass@#1#2#3#4macc@nucleus

makeatother

begindocument
begingather*
vec(dotx)
\
dotbeginbmatrix x \ dotx endbmatrix
\
vec(exp dotx)
endgather*
enddocument


enter image description here






share|improve this answer























  • Thanks very much. Is there something fundamental about the accents package that breaks solutions of the kind that you and egreg suggested?

    – RLH
    2 days ago











  • @RLH accents redefines all those accents macros to no longer use mathaccentV, so my fix is bound to not work there. I didn't dig too deep into why the accents package fails to do the alignment right, so I can't really state anything else about the issue.

    – Skillmon
    2 days ago












  • Thanks again for your help!

    – RLH
    2 days ago











  • @RLH note that this patch changes the way vecdotx would be typeset (the arrow is moved slightly to the right which yields imperfect placement, but not severely misplacement). In the original use case of my package where something like this is done, that is not that bad, because the default placement of the accents would be very bad there.

    – Skillmon
    2 days ago











  • @RLH if you only use accents for accentset, you can use the package option single. That way my fix above will still be applied.

    – Skillmon
    2 days ago











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
);



);






RLH is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482281%2fmath-accent-symbol-over-parentheses-enclosing-accented-symbol-amsmath%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









4














This has to do with a long-standing amsmath issue, see Why do arguments to nested tilde or breve commands reappear when amsmath is used?



I can offer a workaround.



documentclassarticle
usepackageamsmath

makeatletter
newcommanddblacc[2]mathpalettedblacc@#1#2
newcommanddblacc@[2]dblacc@@#1#2
newcommanddblacc@@[3]%
begingroup
sboxz@$m@th#1#3$%
#2boxz@%
endgroup

makeatother

begindocument

begingather*
dblaccvec(dotx)
\
dblaccdotbeginbmatrix x \ dotx endbmatrix
\
dblaccvec(exp dotx)
endgather*

enddocument


enter image description here



A version that works also with accents:



documentclassarticle
usepackageamsmath
usepackageaccents

makeatletter
newsaveboxdblacc@boxa
newsaveboxdblacc@boxb
DeclareRobustCommanddblacc[2]mathpalettedblacc@#1#2
newcommanddblacc@[2]dblacc@@#1#2
newcommanddblacc@@[3]%
begingroup
sboxdblacc@boxa$m@th#1#3$%
sboxdblacc@boxb$m@th#1#2copydblacc@boxa$%
boxdblacc@boxb
endgroup

makeatother

begindocument

begingather*
dblaccvec(dotx)quadscriptscriptstyledblaccvec(dotx)
\
dblaccdotbeginbmatrix x \ dotx endbmatrix
\
dblaccvec(exp dotx)
endgather*

enddocument





share|improve this answer

























  • Thanks very much. If it's not too much trouble, is there a way to make this compatible with the accents package? I'm using the accentset command in my document for a custom accent, and with the accents package turned on, the arguments to the outer accent all disappear.

    – RLH
    2 days ago











  • @RLH newcommandmyaccent[1]accentset<accent>#1 and dblaccmyaccentwhatever should work

    – egreg
    2 days ago











  • Sorry for the miscommunication: The problem I'm running into is that if I add usepackageaccents to the preamble of the example document you posted, only the outer accent character appears -- the rest of the expression is not typeset.

    – RLH
    2 days ago











  • @RLH Problem solved. :-D

    – egreg
    2 days ago















4














This has to do with a long-standing amsmath issue, see Why do arguments to nested tilde or breve commands reappear when amsmath is used?



I can offer a workaround.



documentclassarticle
usepackageamsmath

makeatletter
newcommanddblacc[2]mathpalettedblacc@#1#2
newcommanddblacc@[2]dblacc@@#1#2
newcommanddblacc@@[3]%
begingroup
sboxz@$m@th#1#3$%
#2boxz@%
endgroup

makeatother

begindocument

begingather*
dblaccvec(dotx)
\
dblaccdotbeginbmatrix x \ dotx endbmatrix
\
dblaccvec(exp dotx)
endgather*

enddocument


enter image description here



A version that works also with accents:



documentclassarticle
usepackageamsmath
usepackageaccents

makeatletter
newsaveboxdblacc@boxa
newsaveboxdblacc@boxb
DeclareRobustCommanddblacc[2]mathpalettedblacc@#1#2
newcommanddblacc@[2]dblacc@@#1#2
newcommanddblacc@@[3]%
begingroup
sboxdblacc@boxa$m@th#1#3$%
sboxdblacc@boxb$m@th#1#2copydblacc@boxa$%
boxdblacc@boxb
endgroup

makeatother

begindocument

begingather*
dblaccvec(dotx)quadscriptscriptstyledblaccvec(dotx)
\
dblaccdotbeginbmatrix x \ dotx endbmatrix
\
dblaccvec(exp dotx)
endgather*

enddocument





share|improve this answer

























  • Thanks very much. If it's not too much trouble, is there a way to make this compatible with the accents package? I'm using the accentset command in my document for a custom accent, and with the accents package turned on, the arguments to the outer accent all disappear.

    – RLH
    2 days ago











  • @RLH newcommandmyaccent[1]accentset<accent>#1 and dblaccmyaccentwhatever should work

    – egreg
    2 days ago











  • Sorry for the miscommunication: The problem I'm running into is that if I add usepackageaccents to the preamble of the example document you posted, only the outer accent character appears -- the rest of the expression is not typeset.

    – RLH
    2 days ago











  • @RLH Problem solved. :-D

    – egreg
    2 days ago













4












4








4







This has to do with a long-standing amsmath issue, see Why do arguments to nested tilde or breve commands reappear when amsmath is used?



I can offer a workaround.



documentclassarticle
usepackageamsmath

makeatletter
newcommanddblacc[2]mathpalettedblacc@#1#2
newcommanddblacc@[2]dblacc@@#1#2
newcommanddblacc@@[3]%
begingroup
sboxz@$m@th#1#3$%
#2boxz@%
endgroup

makeatother

begindocument

begingather*
dblaccvec(dotx)
\
dblaccdotbeginbmatrix x \ dotx endbmatrix
\
dblaccvec(exp dotx)
endgather*

enddocument


enter image description here



A version that works also with accents:



documentclassarticle
usepackageamsmath
usepackageaccents

makeatletter
newsaveboxdblacc@boxa
newsaveboxdblacc@boxb
DeclareRobustCommanddblacc[2]mathpalettedblacc@#1#2
newcommanddblacc@[2]dblacc@@#1#2
newcommanddblacc@@[3]%
begingroup
sboxdblacc@boxa$m@th#1#3$%
sboxdblacc@boxb$m@th#1#2copydblacc@boxa$%
boxdblacc@boxb
endgroup

makeatother

begindocument

begingather*
dblaccvec(dotx)quadscriptscriptstyledblaccvec(dotx)
\
dblaccdotbeginbmatrix x \ dotx endbmatrix
\
dblaccvec(exp dotx)
endgather*

enddocument





share|improve this answer















This has to do with a long-standing amsmath issue, see Why do arguments to nested tilde or breve commands reappear when amsmath is used?



I can offer a workaround.



documentclassarticle
usepackageamsmath

makeatletter
newcommanddblacc[2]mathpalettedblacc@#1#2
newcommanddblacc@[2]dblacc@@#1#2
newcommanddblacc@@[3]%
begingroup
sboxz@$m@th#1#3$%
#2boxz@%
endgroup

makeatother

begindocument

begingather*
dblaccvec(dotx)
\
dblaccdotbeginbmatrix x \ dotx endbmatrix
\
dblaccvec(exp dotx)
endgather*

enddocument


enter image description here



A version that works also with accents:



documentclassarticle
usepackageamsmath
usepackageaccents

makeatletter
newsaveboxdblacc@boxa
newsaveboxdblacc@boxb
DeclareRobustCommanddblacc[2]mathpalettedblacc@#1#2
newcommanddblacc@[2]dblacc@@#1#2
newcommanddblacc@@[3]%
begingroup
sboxdblacc@boxa$m@th#1#3$%
sboxdblacc@boxb$m@th#1#2copydblacc@boxa$%
boxdblacc@boxb
endgroup

makeatother

begindocument

begingather*
dblaccvec(dotx)quadscriptscriptstyledblaccvec(dotx)
\
dblaccdotbeginbmatrix x \ dotx endbmatrix
\
dblaccvec(exp dotx)
endgather*

enddocument






share|improve this answer














share|improve this answer



share|improve this answer








edited 2 days ago

























answered 2 days ago









egregegreg

731k8819293246




731k8819293246












  • Thanks very much. If it's not too much trouble, is there a way to make this compatible with the accents package? I'm using the accentset command in my document for a custom accent, and with the accents package turned on, the arguments to the outer accent all disappear.

    – RLH
    2 days ago











  • @RLH newcommandmyaccent[1]accentset<accent>#1 and dblaccmyaccentwhatever should work

    – egreg
    2 days ago











  • Sorry for the miscommunication: The problem I'm running into is that if I add usepackageaccents to the preamble of the example document you posted, only the outer accent character appears -- the rest of the expression is not typeset.

    – RLH
    2 days ago











  • @RLH Problem solved. :-D

    – egreg
    2 days ago

















  • Thanks very much. If it's not too much trouble, is there a way to make this compatible with the accents package? I'm using the accentset command in my document for a custom accent, and with the accents package turned on, the arguments to the outer accent all disappear.

    – RLH
    2 days ago











  • @RLH newcommandmyaccent[1]accentset<accent>#1 and dblaccmyaccentwhatever should work

    – egreg
    2 days ago











  • Sorry for the miscommunication: The problem I'm running into is that if I add usepackageaccents to the preamble of the example document you posted, only the outer accent character appears -- the rest of the expression is not typeset.

    – RLH
    2 days ago











  • @RLH Problem solved. :-D

    – egreg
    2 days ago
















Thanks very much. If it's not too much trouble, is there a way to make this compatible with the accents package? I'm using the accentset command in my document for a custom accent, and with the accents package turned on, the arguments to the outer accent all disappear.

– RLH
2 days ago





Thanks very much. If it's not too much trouble, is there a way to make this compatible with the accents package? I'm using the accentset command in my document for a custom accent, and with the accents package turned on, the arguments to the outer accent all disappear.

– RLH
2 days ago













@RLH newcommandmyaccent[1]accentset<accent>#1 and dblaccmyaccentwhatever should work

– egreg
2 days ago





@RLH newcommandmyaccent[1]accentset<accent>#1 and dblaccmyaccentwhatever should work

– egreg
2 days ago













Sorry for the miscommunication: The problem I'm running into is that if I add usepackageaccents to the preamble of the example document you posted, only the outer accent character appears -- the rest of the expression is not typeset.

– RLH
2 days ago





Sorry for the miscommunication: The problem I'm running into is that if I add usepackageaccents to the preamble of the example document you posted, only the outer accent character appears -- the rest of the expression is not typeset.

– RLH
2 days ago













@RLH Problem solved. :-D

– egreg
2 days ago





@RLH Problem solved. :-D

– egreg
2 days ago











4














The following redefines an internal of amsmath. After that the output of your example looks good. I don't know whether this has any possibility of breaking other stuff. I've added every test case egreg used in his answer and the output looks good. It doesn't work with the accents package, though.



documentclass[]article

usepackage[]amsmath

makeatletter
protecteddefmathaccentV#1#2#3#4#5%
%
ifmmode
mathaccentV@do#2#3#4#5%
else
@xpnonmatherr@csname #1endcsname
fi

defmathaccentV@do#1#2#3#4%
%
globalletmacc@nucleus@empty
mathaccent"accentclass@#1#2#3#4macc@nucleus

makeatother

begindocument
begingather*
vec(dotx)
\
dotbeginbmatrix x \ dotx endbmatrix
\
vec(exp dotx)
endgather*
enddocument


enter image description here






share|improve this answer























  • Thanks very much. Is there something fundamental about the accents package that breaks solutions of the kind that you and egreg suggested?

    – RLH
    2 days ago











  • @RLH accents redefines all those accents macros to no longer use mathaccentV, so my fix is bound to not work there. I didn't dig too deep into why the accents package fails to do the alignment right, so I can't really state anything else about the issue.

    – Skillmon
    2 days ago












  • Thanks again for your help!

    – RLH
    2 days ago











  • @RLH note that this patch changes the way vecdotx would be typeset (the arrow is moved slightly to the right which yields imperfect placement, but not severely misplacement). In the original use case of my package where something like this is done, that is not that bad, because the default placement of the accents would be very bad there.

    – Skillmon
    2 days ago











  • @RLH if you only use accents for accentset, you can use the package option single. That way my fix above will still be applied.

    – Skillmon
    2 days ago















4














The following redefines an internal of amsmath. After that the output of your example looks good. I don't know whether this has any possibility of breaking other stuff. I've added every test case egreg used in his answer and the output looks good. It doesn't work with the accents package, though.



documentclass[]article

usepackage[]amsmath

makeatletter
protecteddefmathaccentV#1#2#3#4#5%
%
ifmmode
mathaccentV@do#2#3#4#5%
else
@xpnonmatherr@csname #1endcsname
fi

defmathaccentV@do#1#2#3#4%
%
globalletmacc@nucleus@empty
mathaccent"accentclass@#1#2#3#4macc@nucleus

makeatother

begindocument
begingather*
vec(dotx)
\
dotbeginbmatrix x \ dotx endbmatrix
\
vec(exp dotx)
endgather*
enddocument


enter image description here






share|improve this answer























  • Thanks very much. Is there something fundamental about the accents package that breaks solutions of the kind that you and egreg suggested?

    – RLH
    2 days ago











  • @RLH accents redefines all those accents macros to no longer use mathaccentV, so my fix is bound to not work there. I didn't dig too deep into why the accents package fails to do the alignment right, so I can't really state anything else about the issue.

    – Skillmon
    2 days ago












  • Thanks again for your help!

    – RLH
    2 days ago











  • @RLH note that this patch changes the way vecdotx would be typeset (the arrow is moved slightly to the right which yields imperfect placement, but not severely misplacement). In the original use case of my package where something like this is done, that is not that bad, because the default placement of the accents would be very bad there.

    – Skillmon
    2 days ago











  • @RLH if you only use accents for accentset, you can use the package option single. That way my fix above will still be applied.

    – Skillmon
    2 days ago













4












4








4







The following redefines an internal of amsmath. After that the output of your example looks good. I don't know whether this has any possibility of breaking other stuff. I've added every test case egreg used in his answer and the output looks good. It doesn't work with the accents package, though.



documentclass[]article

usepackage[]amsmath

makeatletter
protecteddefmathaccentV#1#2#3#4#5%
%
ifmmode
mathaccentV@do#2#3#4#5%
else
@xpnonmatherr@csname #1endcsname
fi

defmathaccentV@do#1#2#3#4%
%
globalletmacc@nucleus@empty
mathaccent"accentclass@#1#2#3#4macc@nucleus

makeatother

begindocument
begingather*
vec(dotx)
\
dotbeginbmatrix x \ dotx endbmatrix
\
vec(exp dotx)
endgather*
enddocument


enter image description here






share|improve this answer













The following redefines an internal of amsmath. After that the output of your example looks good. I don't know whether this has any possibility of breaking other stuff. I've added every test case egreg used in his answer and the output looks good. It doesn't work with the accents package, though.



documentclass[]article

usepackage[]amsmath

makeatletter
protecteddefmathaccentV#1#2#3#4#5%
%
ifmmode
mathaccentV@do#2#3#4#5%
else
@xpnonmatherr@csname #1endcsname
fi

defmathaccentV@do#1#2#3#4%
%
globalletmacc@nucleus@empty
mathaccent"accentclass@#1#2#3#4macc@nucleus

makeatother

begindocument
begingather*
vec(dotx)
\
dotbeginbmatrix x \ dotx endbmatrix
\
vec(exp dotx)
endgather*
enddocument


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered 2 days ago









SkillmonSkillmon

24.1k12249




24.1k12249












  • Thanks very much. Is there something fundamental about the accents package that breaks solutions of the kind that you and egreg suggested?

    – RLH
    2 days ago











  • @RLH accents redefines all those accents macros to no longer use mathaccentV, so my fix is bound to not work there. I didn't dig too deep into why the accents package fails to do the alignment right, so I can't really state anything else about the issue.

    – Skillmon
    2 days ago












  • Thanks again for your help!

    – RLH
    2 days ago











  • @RLH note that this patch changes the way vecdotx would be typeset (the arrow is moved slightly to the right which yields imperfect placement, but not severely misplacement). In the original use case of my package where something like this is done, that is not that bad, because the default placement of the accents would be very bad there.

    – Skillmon
    2 days ago











  • @RLH if you only use accents for accentset, you can use the package option single. That way my fix above will still be applied.

    – Skillmon
    2 days ago

















  • Thanks very much. Is there something fundamental about the accents package that breaks solutions of the kind that you and egreg suggested?

    – RLH
    2 days ago











  • @RLH accents redefines all those accents macros to no longer use mathaccentV, so my fix is bound to not work there. I didn't dig too deep into why the accents package fails to do the alignment right, so I can't really state anything else about the issue.

    – Skillmon
    2 days ago












  • Thanks again for your help!

    – RLH
    2 days ago











  • @RLH note that this patch changes the way vecdotx would be typeset (the arrow is moved slightly to the right which yields imperfect placement, but not severely misplacement). In the original use case of my package where something like this is done, that is not that bad, because the default placement of the accents would be very bad there.

    – Skillmon
    2 days ago











  • @RLH if you only use accents for accentset, you can use the package option single. That way my fix above will still be applied.

    – Skillmon
    2 days ago
















Thanks very much. Is there something fundamental about the accents package that breaks solutions of the kind that you and egreg suggested?

– RLH
2 days ago





Thanks very much. Is there something fundamental about the accents package that breaks solutions of the kind that you and egreg suggested?

– RLH
2 days ago













@RLH accents redefines all those accents macros to no longer use mathaccentV, so my fix is bound to not work there. I didn't dig too deep into why the accents package fails to do the alignment right, so I can't really state anything else about the issue.

– Skillmon
2 days ago






@RLH accents redefines all those accents macros to no longer use mathaccentV, so my fix is bound to not work there. I didn't dig too deep into why the accents package fails to do the alignment right, so I can't really state anything else about the issue.

– Skillmon
2 days ago














Thanks again for your help!

– RLH
2 days ago





Thanks again for your help!

– RLH
2 days ago













@RLH note that this patch changes the way vecdotx would be typeset (the arrow is moved slightly to the right which yields imperfect placement, but not severely misplacement). In the original use case of my package where something like this is done, that is not that bad, because the default placement of the accents would be very bad there.

– Skillmon
2 days ago





@RLH note that this patch changes the way vecdotx would be typeset (the arrow is moved slightly to the right which yields imperfect placement, but not severely misplacement). In the original use case of my package where something like this is done, that is not that bad, because the default placement of the accents would be very bad there.

– Skillmon
2 days ago













@RLH if you only use accents for accentset, you can use the package option single. That way my fix above will still be applied.

– Skillmon
2 days ago





@RLH if you only use accents for accentset, you can use the package option single. That way my fix above will still be applied.

– Skillmon
2 days ago










RLH is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















RLH is a new contributor. Be nice, and check out our Code of Conduct.












RLH is a new contributor. Be nice, and check out our Code of Conduct.











RLH is a new contributor. Be nice, and check out our Code of Conduct.














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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482281%2fmath-accent-symbol-over-parentheses-enclosing-accented-symbol-amsmath%23new-answer', 'question_page');

);

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







Popular posts from this blog

រឿង រ៉ូមេអូ និង ហ្ស៊ុយលីយេ សង្ខេបរឿង តួអង្គ បញ្ជីណែនាំ

Crop image to path created in TikZ? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Crop an inserted image?TikZ pictures does not appear in posterImage behind and beyond crop marks?Tikz picture as large as possible on A4 PageTransparency vs image compression dilemmaHow to crop background from image automatically?Image does not cropTikzexternal capturing crop marks when externalizing pgfplots?How to include image path that contains a dollar signCrop image with left size given

Romeo and Juliet ContentsCharactersSynopsisSourcesDate and textThemes and motifsCriticism and interpretationLegacyScene by sceneSee alsoNotes and referencesSourcesExternal linksNavigation menu"Consumer Price Index (estimate) 1800–"10.2307/28710160037-3222287101610.1093/res/II.5.31910.2307/45967845967810.2307/2869925286992510.1525/jams.1982.35.3.03a00050"Dada Masilo: South African dancer who breaks the rules"10.1093/res/os-XV.57.1610.2307/28680942868094"Sweet Sorrow: Mann-Korman's Romeo and Juliet Closes Sept. 5 at MN's Ordway"the original10.2307/45957745957710.1017/CCOL0521570476.009"Ram Leela box office collections hit massive Rs 100 crore, pulverises prediction"Archived"Broadway Revival of Romeo and Juliet, Starring Orlando Bloom and Condola Rashad, Will Close Dec. 8"Archived10.1075/jhp.7.1.04hon"Wherefore art thou, Romeo? To make us laugh at Navy Pier"the original10.1093/gmo/9781561592630.article.O006772"Ram-leela Review Roundup: Critics Hail Film as Best Adaptation of Romeo and Juliet"Archived10.2307/31946310047-77293194631"Romeo and Juliet get Twitter treatment""Juliet's Nurse by Lois Leveen""Romeo and Juliet: Orlando Bloom's Broadway Debut Released in Theaters for Valentine's Day"Archived"Romeo and Juliet Has No Balcony"10.1093/gmo/9781561592630.article.O00778110.2307/2867423286742310.1076/enst.82.2.115.959510.1080/00138380601042675"A plague o' both your houses: error in GCSE exam paper forces apology""Juliet of the Five O'Clock Shadow, and Other Wonders"10.2307/33912430027-4321339124310.2307/28487440038-7134284874410.2307/29123140149-661129123144728341M"Weekender Guide: Shakespeare on The Drive""balcony"UK public library membership"romeo"UK public library membership10.1017/CCOL9780521844291"Post-Zionist Critique on Israel and the Palestinians Part III: Popular Culture"10.2307/25379071533-86140377-919X2537907"Capulets and Montagues: UK exam board admit mixing names up in Romeo and Juliet paper"Istoria Novellamente Ritrovata di Due Nobili Amanti2027/mdp.390150822329610820-750X"GCSE exam error: Board accidentally rewrites Shakespeare"10.2307/29176390149-66112917639"Exam board apologises after error in English GCSE paper which confused characters in Shakespeare's Romeo and Juliet""From Mariotto and Ganozza to Romeo and Guilietta: Metamorphoses of a Renaissance Tale"10.2307/37323537323510.2307/2867455286745510.2307/28678912867891"10 Questions for Taylor Swift"10.2307/28680922868092"Haymarket Theatre""The Zeffirelli Way: Revealing Talk by Florentine Director""Michael Smuin: 1938-2007 / Prolific dance director had showy career"The Life and Art of Edwin BoothRomeo and JulietRomeo and JulietRomeo and JulietRomeo and JulietEasy Read Romeo and JulietRomeo and Julieteeecb12003684p(data)4099369-3n8211610759dbe00d-a9e2-41a3-b2c1-977dd692899302814385X313670221313670221