What is the correct way to typeset a vector when there is subscript or superscript?












1















Consider this MWE:



documentclass{article}

begin{document}

[vec{v}_{12345}^{12345678}]

[overrightarrow{P_{12345}P_{12345}^{12345678}}]

end{document}


MWE output



As you can see, vec is designed to typeset a vector with an arrow above the argument.



However, when we do not have a unary symbol to represent a vector (e.g. the difference between the coordinates of two points) then we can use overrightarrow. But this notation has two problems:




  1. When we are working with long chain of numbers overrightarrow collides with it, as shown in the example.

  2. And I think the most important: it is not consistent with vec. Why? Because vec stops the arrow before the subscript/superscript, but overrightarrow continues the arrow to the end regardless of the existence or not of subscript/superscript.


Remember that we are writing vectors, no matter the length of the text that represents the vector.



What I want



With your huge help, I would like to write the following:



Example of what I want



Example 2 of what I want



Example 3 of what I want



Thanks!!










share|improve this question




















  • 1





    You can do that e.g. with [overrightarrow{P_{12345}P}!_{12345}^{,12345678}] but I promise you that in a few years you will find this notation awkward.

    – marmot
    4 hours ago











  • @marmot I am not a mathematician but a student of ingeering, so the conventions are our thing. :P

    – manooooh
    4 hours ago






  • 1





    it's best to avoid the over-arrow notation, especially you need it for anything more than x

    – David Carlisle
    4 hours ago






  • 1





    Then see this comment ... ;-)

    – marmot
    4 hours ago
















1















Consider this MWE:



documentclass{article}

begin{document}

[vec{v}_{12345}^{12345678}]

[overrightarrow{P_{12345}P_{12345}^{12345678}}]

end{document}


MWE output



As you can see, vec is designed to typeset a vector with an arrow above the argument.



However, when we do not have a unary symbol to represent a vector (e.g. the difference between the coordinates of two points) then we can use overrightarrow. But this notation has two problems:




  1. When we are working with long chain of numbers overrightarrow collides with it, as shown in the example.

  2. And I think the most important: it is not consistent with vec. Why? Because vec stops the arrow before the subscript/superscript, but overrightarrow continues the arrow to the end regardless of the existence or not of subscript/superscript.


Remember that we are writing vectors, no matter the length of the text that represents the vector.



What I want



With your huge help, I would like to write the following:



Example of what I want



Example 2 of what I want



Example 3 of what I want



Thanks!!










share|improve this question




















  • 1





    You can do that e.g. with [overrightarrow{P_{12345}P}!_{12345}^{,12345678}] but I promise you that in a few years you will find this notation awkward.

    – marmot
    4 hours ago











  • @marmot I am not a mathematician but a student of ingeering, so the conventions are our thing. :P

    – manooooh
    4 hours ago






  • 1





    it's best to avoid the over-arrow notation, especially you need it for anything more than x

    – David Carlisle
    4 hours ago






  • 1





    Then see this comment ... ;-)

    – marmot
    4 hours ago














1












1








1








Consider this MWE:



documentclass{article}

begin{document}

[vec{v}_{12345}^{12345678}]

[overrightarrow{P_{12345}P_{12345}^{12345678}}]

end{document}


MWE output



As you can see, vec is designed to typeset a vector with an arrow above the argument.



However, when we do not have a unary symbol to represent a vector (e.g. the difference between the coordinates of two points) then we can use overrightarrow. But this notation has two problems:




  1. When we are working with long chain of numbers overrightarrow collides with it, as shown in the example.

  2. And I think the most important: it is not consistent with vec. Why? Because vec stops the arrow before the subscript/superscript, but overrightarrow continues the arrow to the end regardless of the existence or not of subscript/superscript.


Remember that we are writing vectors, no matter the length of the text that represents the vector.



What I want



With your huge help, I would like to write the following:



Example of what I want



Example 2 of what I want



Example 3 of what I want



Thanks!!










share|improve this question
















Consider this MWE:



documentclass{article}

begin{document}

[vec{v}_{12345}^{12345678}]

[overrightarrow{P_{12345}P_{12345}^{12345678}}]

end{document}


MWE output



As you can see, vec is designed to typeset a vector with an arrow above the argument.



However, when we do not have a unary symbol to represent a vector (e.g. the difference between the coordinates of two points) then we can use overrightarrow. But this notation has two problems:




  1. When we are working with long chain of numbers overrightarrow collides with it, as shown in the example.

  2. And I think the most important: it is not consistent with vec. Why? Because vec stops the arrow before the subscript/superscript, but overrightarrow continues the arrow to the end regardless of the existence or not of subscript/superscript.


Remember that we are writing vectors, no matter the length of the text that represents the vector.



What I want



With your huge help, I would like to write the following:



Example of what I want



Example 2 of what I want



Example 3 of what I want



Thanks!!







arrows subscripts superscripts vector






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 4 hours ago







manooooh

















asked 4 hours ago









manoooohmanooooh

1,1751517




1,1751517








  • 1





    You can do that e.g. with [overrightarrow{P_{12345}P}!_{12345}^{,12345678}] but I promise you that in a few years you will find this notation awkward.

    – marmot
    4 hours ago











  • @marmot I am not a mathematician but a student of ingeering, so the conventions are our thing. :P

    – manooooh
    4 hours ago






  • 1





    it's best to avoid the over-arrow notation, especially you need it for anything more than x

    – David Carlisle
    4 hours ago






  • 1





    Then see this comment ... ;-)

    – marmot
    4 hours ago














  • 1





    You can do that e.g. with [overrightarrow{P_{12345}P}!_{12345}^{,12345678}] but I promise you that in a few years you will find this notation awkward.

    – marmot
    4 hours ago











  • @marmot I am not a mathematician but a student of ingeering, so the conventions are our thing. :P

    – manooooh
    4 hours ago






  • 1





    it's best to avoid the over-arrow notation, especially you need it for anything more than x

    – David Carlisle
    4 hours ago






  • 1





    Then see this comment ... ;-)

    – marmot
    4 hours ago








1




1





You can do that e.g. with [overrightarrow{P_{12345}P}!_{12345}^{,12345678}] but I promise you that in a few years you will find this notation awkward.

– marmot
4 hours ago





You can do that e.g. with [overrightarrow{P_{12345}P}!_{12345}^{,12345678}] but I promise you that in a few years you will find this notation awkward.

– marmot
4 hours ago













@marmot I am not a mathematician but a student of ingeering, so the conventions are our thing. :P

– manooooh
4 hours ago





@marmot I am not a mathematician but a student of ingeering, so the conventions are our thing. :P

– manooooh
4 hours ago




1




1





it's best to avoid the over-arrow notation, especially you need it for anything more than x

– David Carlisle
4 hours ago





it's best to avoid the over-arrow notation, especially you need it for anything more than x

– David Carlisle
4 hours ago




1




1





Then see this comment ... ;-)

– marmot
4 hours ago





Then see this comment ... ;-)

– marmot
4 hours ago










1 Answer
1






active

oldest

votes


















1














This seems a really confusing (and ugly) convention, but..



enter image description here



documentclass{article}

begin{document}

sbox0{$P$}
[overrightarrow{strut P_{12345}kernwd0}kern-wd0P_{12345}^{12345678}]

end{document}





share|improve this answer
























  • Thanks! The original overrightarrow stops the arrow just after the last P, and your solution stops it at the middle. How can we stop the arrow a little more to the right?

    – manooooh
    4 hours ago






  • 1





    @manooooh middle? it goes to the right edge (bar the sidebearing on the arrowhead) but use kern1.1wd0}kern-1.1wd0 if you prefer (or any other factor)

    – David Carlisle
    4 hours 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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f482665%2fwhat-is-the-correct-way-to-typeset-a-vector-when-there-is-subscript-or-superscri%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














This seems a really confusing (and ugly) convention, but..



enter image description here



documentclass{article}

begin{document}

sbox0{$P$}
[overrightarrow{strut P_{12345}kernwd0}kern-wd0P_{12345}^{12345678}]

end{document}





share|improve this answer
























  • Thanks! The original overrightarrow stops the arrow just after the last P, and your solution stops it at the middle. How can we stop the arrow a little more to the right?

    – manooooh
    4 hours ago






  • 1





    @manooooh middle? it goes to the right edge (bar the sidebearing on the arrowhead) but use kern1.1wd0}kern-1.1wd0 if you prefer (or any other factor)

    – David Carlisle
    4 hours ago


















1














This seems a really confusing (and ugly) convention, but..



enter image description here



documentclass{article}

begin{document}

sbox0{$P$}
[overrightarrow{strut P_{12345}kernwd0}kern-wd0P_{12345}^{12345678}]

end{document}





share|improve this answer
























  • Thanks! The original overrightarrow stops the arrow just after the last P, and your solution stops it at the middle. How can we stop the arrow a little more to the right?

    – manooooh
    4 hours ago






  • 1





    @manooooh middle? it goes to the right edge (bar the sidebearing on the arrowhead) but use kern1.1wd0}kern-1.1wd0 if you prefer (or any other factor)

    – David Carlisle
    4 hours ago
















1












1








1







This seems a really confusing (and ugly) convention, but..



enter image description here



documentclass{article}

begin{document}

sbox0{$P$}
[overrightarrow{strut P_{12345}kernwd0}kern-wd0P_{12345}^{12345678}]

end{document}





share|improve this answer













This seems a really confusing (and ugly) convention, but..



enter image description here



documentclass{article}

begin{document}

sbox0{$P$}
[overrightarrow{strut P_{12345}kernwd0}kern-wd0P_{12345}^{12345678}]

end{document}






share|improve this answer












share|improve this answer



share|improve this answer










answered 4 hours ago









David CarlisleDavid Carlisle

497k4111441890




497k4111441890













  • Thanks! The original overrightarrow stops the arrow just after the last P, and your solution stops it at the middle. How can we stop the arrow a little more to the right?

    – manooooh
    4 hours ago






  • 1





    @manooooh middle? it goes to the right edge (bar the sidebearing on the arrowhead) but use kern1.1wd0}kern-1.1wd0 if you prefer (or any other factor)

    – David Carlisle
    4 hours ago





















  • Thanks! The original overrightarrow stops the arrow just after the last P, and your solution stops it at the middle. How can we stop the arrow a little more to the right?

    – manooooh
    4 hours ago






  • 1





    @manooooh middle? it goes to the right edge (bar the sidebearing on the arrowhead) but use kern1.1wd0}kern-1.1wd0 if you prefer (or any other factor)

    – David Carlisle
    4 hours ago



















Thanks! The original overrightarrow stops the arrow just after the last P, and your solution stops it at the middle. How can we stop the arrow a little more to the right?

– manooooh
4 hours ago





Thanks! The original overrightarrow stops the arrow just after the last P, and your solution stops it at the middle. How can we stop the arrow a little more to the right?

– manooooh
4 hours ago




1




1





@manooooh middle? it goes to the right edge (bar the sidebearing on the arrowhead) but use kern1.1wd0}kern-1.1wd0 if you prefer (or any other factor)

– David Carlisle
4 hours ago







@manooooh middle? it goes to the right edge (bar the sidebearing on the arrowhead) but use kern1.1wd0}kern-1.1wd0 if you prefer (or any other factor)

– David Carlisle
4 hours ago




















draft saved

draft discarded




















































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%2f482665%2fwhat-is-the-correct-way-to-typeset-a-vector-when-there-is-subscript-or-superscri%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

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

Calculate evaluation metrics using cross_val_predict sklearn

Insert data from modal to MySQL (multiple modal on website)