Align vector symbol with upright math letter

Multi tool use
Multi tool use












4















So basically I need to put a vector symbol (vec) on an upright letter for which I use mathrm in math mode. For example:



vec{mathrm{E}}


While Katex seems to get the alignment right on all the letters:



Katex



My pdfTeX version doesn't do so well (using the same code):



pdflatex



Clearly the vector symbol is positioned such that it would be aligned if the letters were in italic mode.



Which leads me to the following question:




  • How can I get the vector symbol aligned with the upright math letter using pdfTeX?




pdfTeX version



$ pdflatex --version
pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian)
kpathsea version 6.2.1


Document setup



documentclass[a4paper,12pt]{scrartcl}
usepackage[utf8]{inputenc}
usepackage{amsmath}




Complete example



documentclass[a4paper,12pt]{scrartcl}
usepackage[utf8]{inputenc}
usepackage{amsmath}

begin{document}

begin{equation*}
vec{mathrm{A}};vec{mathrm{B}};vec{mathrm{C}};vec{mathrm{D}};vec{mathrm{E}};vec{mathrm{F}};vec{mathrm{G}};vec{mathrm{H}};vec{mathrm{I}};vec{mathrm{J}};vec{mathrm{K}};vec{mathrm{L}};vec{mathrm{M}};vec{mathrm{N}};vec{mathrm{O}};vec{mathrm{P}};vec{mathrm{Q}};vec{mathrm{R}};vec{mathrm{S}};vec{mathrm{T}};vec{mathrm{U}};vec{mathrm{V}};vec{mathrm{W}};vec{mathrm{X}};vec{mathrm{Y}};vec{mathrm{Z}}
end{equation*}

end{document}









share|improve this question

























  • Show a complete minimal example, not only some snippets - this makes it much easier to test.

    – Ulrike Fischer
    Feb 4 at 8:49






  • 2





    The glyph used for the vec accent is indeed tailored for best results with italic letters, as the shape of the arrow itself shows. Katex is not a TeX engine, so it can't be used for comparison. Beware that textrm is the wrong command in that context, use mathrm.

    – egreg
    Feb 4 at 8:50













  • vec{{}<letter>} try adding the empty group (or a kern0pt) inside the argument of vec.

    – Manuel
    Feb 4 at 8:52






  • 2





    try vv{textrm{E}} from the esvect package

    – Hafid Boukhoulda
    Feb 4 at 8:56











  • @UlrikeFischer I assumed the Document setup would already contain all the necessary information. Anyway I've added the complete code that produces the posted screenshot.

    – a_guest
    Feb 4 at 16:36
















4















So basically I need to put a vector symbol (vec) on an upright letter for which I use mathrm in math mode. For example:



vec{mathrm{E}}


While Katex seems to get the alignment right on all the letters:



Katex



My pdfTeX version doesn't do so well (using the same code):



pdflatex



Clearly the vector symbol is positioned such that it would be aligned if the letters were in italic mode.



Which leads me to the following question:




  • How can I get the vector symbol aligned with the upright math letter using pdfTeX?




pdfTeX version



$ pdflatex --version
pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian)
kpathsea version 6.2.1


Document setup



documentclass[a4paper,12pt]{scrartcl}
usepackage[utf8]{inputenc}
usepackage{amsmath}




Complete example



documentclass[a4paper,12pt]{scrartcl}
usepackage[utf8]{inputenc}
usepackage{amsmath}

begin{document}

begin{equation*}
vec{mathrm{A}};vec{mathrm{B}};vec{mathrm{C}};vec{mathrm{D}};vec{mathrm{E}};vec{mathrm{F}};vec{mathrm{G}};vec{mathrm{H}};vec{mathrm{I}};vec{mathrm{J}};vec{mathrm{K}};vec{mathrm{L}};vec{mathrm{M}};vec{mathrm{N}};vec{mathrm{O}};vec{mathrm{P}};vec{mathrm{Q}};vec{mathrm{R}};vec{mathrm{S}};vec{mathrm{T}};vec{mathrm{U}};vec{mathrm{V}};vec{mathrm{W}};vec{mathrm{X}};vec{mathrm{Y}};vec{mathrm{Z}}
end{equation*}

end{document}









share|improve this question

























  • Show a complete minimal example, not only some snippets - this makes it much easier to test.

    – Ulrike Fischer
    Feb 4 at 8:49






  • 2





    The glyph used for the vec accent is indeed tailored for best results with italic letters, as the shape of the arrow itself shows. Katex is not a TeX engine, so it can't be used for comparison. Beware that textrm is the wrong command in that context, use mathrm.

    – egreg
    Feb 4 at 8:50













  • vec{{}<letter>} try adding the empty group (or a kern0pt) inside the argument of vec.

    – Manuel
    Feb 4 at 8:52






  • 2





    try vv{textrm{E}} from the esvect package

    – Hafid Boukhoulda
    Feb 4 at 8:56











  • @UlrikeFischer I assumed the Document setup would already contain all the necessary information. Anyway I've added the complete code that produces the posted screenshot.

    – a_guest
    Feb 4 at 16:36














4












4








4


0






So basically I need to put a vector symbol (vec) on an upright letter for which I use mathrm in math mode. For example:



vec{mathrm{E}}


While Katex seems to get the alignment right on all the letters:



Katex



My pdfTeX version doesn't do so well (using the same code):



pdflatex



Clearly the vector symbol is positioned such that it would be aligned if the letters were in italic mode.



Which leads me to the following question:




  • How can I get the vector symbol aligned with the upright math letter using pdfTeX?




pdfTeX version



$ pdflatex --version
pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian)
kpathsea version 6.2.1


Document setup



documentclass[a4paper,12pt]{scrartcl}
usepackage[utf8]{inputenc}
usepackage{amsmath}




Complete example



documentclass[a4paper,12pt]{scrartcl}
usepackage[utf8]{inputenc}
usepackage{amsmath}

begin{document}

begin{equation*}
vec{mathrm{A}};vec{mathrm{B}};vec{mathrm{C}};vec{mathrm{D}};vec{mathrm{E}};vec{mathrm{F}};vec{mathrm{G}};vec{mathrm{H}};vec{mathrm{I}};vec{mathrm{J}};vec{mathrm{K}};vec{mathrm{L}};vec{mathrm{M}};vec{mathrm{N}};vec{mathrm{O}};vec{mathrm{P}};vec{mathrm{Q}};vec{mathrm{R}};vec{mathrm{S}};vec{mathrm{T}};vec{mathrm{U}};vec{mathrm{V}};vec{mathrm{W}};vec{mathrm{X}};vec{mathrm{Y}};vec{mathrm{Z}}
end{equation*}

end{document}









share|improve this question
















So basically I need to put a vector symbol (vec) on an upright letter for which I use mathrm in math mode. For example:



vec{mathrm{E}}


While Katex seems to get the alignment right on all the letters:



Katex



My pdfTeX version doesn't do so well (using the same code):



pdflatex



Clearly the vector symbol is positioned such that it would be aligned if the letters were in italic mode.



Which leads me to the following question:




  • How can I get the vector symbol aligned with the upright math letter using pdfTeX?




pdfTeX version



$ pdflatex --version
pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian)
kpathsea version 6.2.1


Document setup



documentclass[a4paper,12pt]{scrartcl}
usepackage[utf8]{inputenc}
usepackage{amsmath}




Complete example



documentclass[a4paper,12pt]{scrartcl}
usepackage[utf8]{inputenc}
usepackage{amsmath}

begin{document}

begin{equation*}
vec{mathrm{A}};vec{mathrm{B}};vec{mathrm{C}};vec{mathrm{D}};vec{mathrm{E}};vec{mathrm{F}};vec{mathrm{G}};vec{mathrm{H}};vec{mathrm{I}};vec{mathrm{J}};vec{mathrm{K}};vec{mathrm{L}};vec{mathrm{M}};vec{mathrm{N}};vec{mathrm{O}};vec{mathrm{P}};vec{mathrm{Q}};vec{mathrm{R}};vec{mathrm{S}};vec{mathrm{T}};vec{mathrm{U}};vec{mathrm{V}};vec{mathrm{W}};vec{mathrm{X}};vec{mathrm{Y}};vec{mathrm{Z}}
end{equation*}

end{document}






math-mode fonts amsmath math-operators






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 4 at 17:06







a_guest

















asked Feb 4 at 8:38









a_guesta_guest

24929




24929













  • Show a complete minimal example, not only some snippets - this makes it much easier to test.

    – Ulrike Fischer
    Feb 4 at 8:49






  • 2





    The glyph used for the vec accent is indeed tailored for best results with italic letters, as the shape of the arrow itself shows. Katex is not a TeX engine, so it can't be used for comparison. Beware that textrm is the wrong command in that context, use mathrm.

    – egreg
    Feb 4 at 8:50













  • vec{{}<letter>} try adding the empty group (or a kern0pt) inside the argument of vec.

    – Manuel
    Feb 4 at 8:52






  • 2





    try vv{textrm{E}} from the esvect package

    – Hafid Boukhoulda
    Feb 4 at 8:56











  • @UlrikeFischer I assumed the Document setup would already contain all the necessary information. Anyway I've added the complete code that produces the posted screenshot.

    – a_guest
    Feb 4 at 16:36



















  • Show a complete minimal example, not only some snippets - this makes it much easier to test.

    – Ulrike Fischer
    Feb 4 at 8:49






  • 2





    The glyph used for the vec accent is indeed tailored for best results with italic letters, as the shape of the arrow itself shows. Katex is not a TeX engine, so it can't be used for comparison. Beware that textrm is the wrong command in that context, use mathrm.

    – egreg
    Feb 4 at 8:50













  • vec{{}<letter>} try adding the empty group (or a kern0pt) inside the argument of vec.

    – Manuel
    Feb 4 at 8:52






  • 2





    try vv{textrm{E}} from the esvect package

    – Hafid Boukhoulda
    Feb 4 at 8:56











  • @UlrikeFischer I assumed the Document setup would already contain all the necessary information. Anyway I've added the complete code that produces the posted screenshot.

    – a_guest
    Feb 4 at 16:36

















Show a complete minimal example, not only some snippets - this makes it much easier to test.

– Ulrike Fischer
Feb 4 at 8:49





Show a complete minimal example, not only some snippets - this makes it much easier to test.

– Ulrike Fischer
Feb 4 at 8:49




2




2





The glyph used for the vec accent is indeed tailored for best results with italic letters, as the shape of the arrow itself shows. Katex is not a TeX engine, so it can't be used for comparison. Beware that textrm is the wrong command in that context, use mathrm.

– egreg
Feb 4 at 8:50







The glyph used for the vec accent is indeed tailored for best results with italic letters, as the shape of the arrow itself shows. Katex is not a TeX engine, so it can't be used for comparison. Beware that textrm is the wrong command in that context, use mathrm.

– egreg
Feb 4 at 8:50















vec{{}<letter>} try adding the empty group (or a kern0pt) inside the argument of vec.

– Manuel
Feb 4 at 8:52





vec{{}<letter>} try adding the empty group (or a kern0pt) inside the argument of vec.

– Manuel
Feb 4 at 8:52




2




2





try vv{textrm{E}} from the esvect package

– Hafid Boukhoulda
Feb 4 at 8:56





try vv{textrm{E}} from the esvect package

– Hafid Boukhoulda
Feb 4 at 8:56













@UlrikeFischer I assumed the Document setup would already contain all the necessary information. Anyway I've added the complete code that produces the posted screenshot.

– a_guest
Feb 4 at 16:36





@UlrikeFischer I assumed the Document setup would already contain all the necessary information. Anyway I've added the complete code that produces the posted screenshot.

– a_guest
Feb 4 at 16:36










1 Answer
1






active

oldest

votes


















2














Before (vec) and after (upvec):



documentclass[a4paper,12pt]{scrartcl}
usepackage[utf8]{inputenc}
usepackage{amsmath}
newcommandupvec[1]{!vec{,mathrm{#1}}}
begin{document}
begin{equation*}
vec{mathrm{A}};vec{mathrm{B}};vec{mathrm{C}};vec{mathrm{D}};
vec{mathrm{E}};vec{mathrm{F}};vec{mathrm{G}};vec{mathrm{H}};
vec{mathrm{I}};vec{mathrm{J}};vec{mathrm{K}};vec{mathrm{L}};
vec{mathrm{M}};vec{mathrm{N}};vec{mathrm{O}};vec{mathrm{P}};
vec{mathrm{Q}};vec{mathrm{R}};vec{mathrm{S}};vec{mathrm{T}};
vec{mathrm{U}};vec{mathrm{V}};vec{mathrm{W}};vec{mathrm{X}};
vec{mathrm{Y}};vec{mathrm{Z}}
end{equation*}

begin{equation*}
upvec A;upvec B;upvec C;upvec D;upvec E;upvec F;upvec G;
upvec H;upvec I;upvec J;upvec K;upvec L;upvec M;upvec N;
upvec O;upvec P;upvec Q;upvec R;upvec S;upvec T;upvec U;
upvec V;upvec W;upvec X;upvec Y;upvec Z
;upvec{a}
end{equation*}

[
vec Aupvec B f = upvec D vec E g
]
end{document}


enter image description here






share|improve this answer

























    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%2f473286%2falign-vector-symbol-with-upright-math-letter%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









    2














    Before (vec) and after (upvec):



    documentclass[a4paper,12pt]{scrartcl}
    usepackage[utf8]{inputenc}
    usepackage{amsmath}
    newcommandupvec[1]{!vec{,mathrm{#1}}}
    begin{document}
    begin{equation*}
    vec{mathrm{A}};vec{mathrm{B}};vec{mathrm{C}};vec{mathrm{D}};
    vec{mathrm{E}};vec{mathrm{F}};vec{mathrm{G}};vec{mathrm{H}};
    vec{mathrm{I}};vec{mathrm{J}};vec{mathrm{K}};vec{mathrm{L}};
    vec{mathrm{M}};vec{mathrm{N}};vec{mathrm{O}};vec{mathrm{P}};
    vec{mathrm{Q}};vec{mathrm{R}};vec{mathrm{S}};vec{mathrm{T}};
    vec{mathrm{U}};vec{mathrm{V}};vec{mathrm{W}};vec{mathrm{X}};
    vec{mathrm{Y}};vec{mathrm{Z}}
    end{equation*}

    begin{equation*}
    upvec A;upvec B;upvec C;upvec D;upvec E;upvec F;upvec G;
    upvec H;upvec I;upvec J;upvec K;upvec L;upvec M;upvec N;
    upvec O;upvec P;upvec Q;upvec R;upvec S;upvec T;upvec U;
    upvec V;upvec W;upvec X;upvec Y;upvec Z
    ;upvec{a}
    end{equation*}

    [
    vec Aupvec B f = upvec D vec E g
    ]
    end{document}


    enter image description here






    share|improve this answer






























      2














      Before (vec) and after (upvec):



      documentclass[a4paper,12pt]{scrartcl}
      usepackage[utf8]{inputenc}
      usepackage{amsmath}
      newcommandupvec[1]{!vec{,mathrm{#1}}}
      begin{document}
      begin{equation*}
      vec{mathrm{A}};vec{mathrm{B}};vec{mathrm{C}};vec{mathrm{D}};
      vec{mathrm{E}};vec{mathrm{F}};vec{mathrm{G}};vec{mathrm{H}};
      vec{mathrm{I}};vec{mathrm{J}};vec{mathrm{K}};vec{mathrm{L}};
      vec{mathrm{M}};vec{mathrm{N}};vec{mathrm{O}};vec{mathrm{P}};
      vec{mathrm{Q}};vec{mathrm{R}};vec{mathrm{S}};vec{mathrm{T}};
      vec{mathrm{U}};vec{mathrm{V}};vec{mathrm{W}};vec{mathrm{X}};
      vec{mathrm{Y}};vec{mathrm{Z}}
      end{equation*}

      begin{equation*}
      upvec A;upvec B;upvec C;upvec D;upvec E;upvec F;upvec G;
      upvec H;upvec I;upvec J;upvec K;upvec L;upvec M;upvec N;
      upvec O;upvec P;upvec Q;upvec R;upvec S;upvec T;upvec U;
      upvec V;upvec W;upvec X;upvec Y;upvec Z
      ;upvec{a}
      end{equation*}

      [
      vec Aupvec B f = upvec D vec E g
      ]
      end{document}


      enter image description here






      share|improve this answer




























        2












        2








        2







        Before (vec) and after (upvec):



        documentclass[a4paper,12pt]{scrartcl}
        usepackage[utf8]{inputenc}
        usepackage{amsmath}
        newcommandupvec[1]{!vec{,mathrm{#1}}}
        begin{document}
        begin{equation*}
        vec{mathrm{A}};vec{mathrm{B}};vec{mathrm{C}};vec{mathrm{D}};
        vec{mathrm{E}};vec{mathrm{F}};vec{mathrm{G}};vec{mathrm{H}};
        vec{mathrm{I}};vec{mathrm{J}};vec{mathrm{K}};vec{mathrm{L}};
        vec{mathrm{M}};vec{mathrm{N}};vec{mathrm{O}};vec{mathrm{P}};
        vec{mathrm{Q}};vec{mathrm{R}};vec{mathrm{S}};vec{mathrm{T}};
        vec{mathrm{U}};vec{mathrm{V}};vec{mathrm{W}};vec{mathrm{X}};
        vec{mathrm{Y}};vec{mathrm{Z}}
        end{equation*}

        begin{equation*}
        upvec A;upvec B;upvec C;upvec D;upvec E;upvec F;upvec G;
        upvec H;upvec I;upvec J;upvec K;upvec L;upvec M;upvec N;
        upvec O;upvec P;upvec Q;upvec R;upvec S;upvec T;upvec U;
        upvec V;upvec W;upvec X;upvec Y;upvec Z
        ;upvec{a}
        end{equation*}

        [
        vec Aupvec B f = upvec D vec E g
        ]
        end{document}


        enter image description here






        share|improve this answer















        Before (vec) and after (upvec):



        documentclass[a4paper,12pt]{scrartcl}
        usepackage[utf8]{inputenc}
        usepackage{amsmath}
        newcommandupvec[1]{!vec{,mathrm{#1}}}
        begin{document}
        begin{equation*}
        vec{mathrm{A}};vec{mathrm{B}};vec{mathrm{C}};vec{mathrm{D}};
        vec{mathrm{E}};vec{mathrm{F}};vec{mathrm{G}};vec{mathrm{H}};
        vec{mathrm{I}};vec{mathrm{J}};vec{mathrm{K}};vec{mathrm{L}};
        vec{mathrm{M}};vec{mathrm{N}};vec{mathrm{O}};vec{mathrm{P}};
        vec{mathrm{Q}};vec{mathrm{R}};vec{mathrm{S}};vec{mathrm{T}};
        vec{mathrm{U}};vec{mathrm{V}};vec{mathrm{W}};vec{mathrm{X}};
        vec{mathrm{Y}};vec{mathrm{Z}}
        end{equation*}

        begin{equation*}
        upvec A;upvec B;upvec C;upvec D;upvec E;upvec F;upvec G;
        upvec H;upvec I;upvec J;upvec K;upvec L;upvec M;upvec N;
        upvec O;upvec P;upvec Q;upvec R;upvec S;upvec T;upvec U;
        upvec V;upvec W;upvec X;upvec Y;upvec Z
        ;upvec{a}
        end{equation*}

        [
        vec Aupvec B f = upvec D vec E g
        ]
        end{document}


        enter image description here







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Feb 4 at 18:58

























        answered Feb 4 at 18:46









        Steven B. SegletesSteven B. Segletes

        154k9198405




        154k9198405






























            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%2f473286%2falign-vector-symbol-with-upright-math-letter%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







            7 z V,T XB6m2eiz1L0JUIonL,KxN5 jdt,IBNCyYkd3CA4vm40,C3YLrP,3R9zK
            MpM2HAYLi,SPk,FAaO5,BfV8Mv5O6R nz32,J,T2XzNa wyCWUCfm,LpDxKHfIY GZro7wJzVQuzIi

            Popular posts from this blog

            mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

            How to change which sound is reproduced for terminal bell?

            Can I use Tabulator js library in my java Spring + Thymeleaf project?