How can I reduce the gap between left and right of cdot with a macro? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)“Closed” (square) root symbolSpacing around left and right Use column-separator & (ampersand) inside newenvironmentMacro for left( and right)Allow macro to end without new lineHow can I influence the spacing of mathematical functions by an own macro?Failure After Using Latexdiff Script: latexdiff marking up lstlisting environmentHow do I reduce the space between operators in math mode?Xparse k argument to parse options at end of environmentleft and right with arrayWhat is the difference between 'macro' and 'command'?

An adverb for when you're not exaggerating

Has negative voting ever been officially implemented in elections, or seriously proposed, or even studied?

What was the first language to use conditional keywords?

ArcGIS Pro Python arcpy.CreatePersonalGDB_management

Why should I vote and accept answers?

What is the difference between globalisation and imperialism?

Disembodied hand growing fangs

Sum letters are not two different

Selecting user stories during sprint planning

SF book about people trapped in a series of worlds they imagine

How come Sam didn't become Lord of Horn Hill?

Why is it faster to reheat something than it is to cook it?

How were pictures turned from film to a big picture in a picture frame before digital scanning?

What is the font for "b" letter?

Do I really need to have a message in a novel to appeal to readers?

Did Krishna say in Bhagavad Gita "I am in every living being"

Most bit efficient text communication method?

Hangman Game with C++

Why is my ESD wriststrap failing with nitrile gloves on?

How does the math work when buying airline miles?

A term for a woman complaining about things/begging in a cute/childish way

Project Euler #1 in C++

Central Vacuuming: Is it worth it, and how does it compare to normal vacuuming?

What would you call this weird metallic apparatus that allows you to lift people?



How can I reduce the gap between left and right of cdot with a macro?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)“Closed” (square) root symbolSpacing around left and right Use column-separator & (ampersand) inside newenvironmentMacro for left( and right)Allow macro to end without new lineHow can I influence the spacing of mathematical functions by an own macro?Failure After Using Latexdiff Script: latexdiff marking up lstlisting environmentHow do I reduce the space between operators in math mode?Xparse k argument to parse options at end of environmentleft and right with arrayWhat is the difference between 'macro' and 'command'?










6















MWE



documentclass[a4paper,11pt,border=1pt]standalone
%LetLtxMacrooldcdotcdot
%renewcommandcdot!cdot! <-- Like this
begindocument
$3cdot 10^8$ m/s
enddocument


I'm getting the following output.



enter image description here



However cdot as there are many spaces between left and right. How do I get the following image should I have a macro?



enter image description here



Related to: https://tex.stackexchange.com/a/29838/33075










share|improve this question

















  • 4





    $3cdot 10^8$ m/s kills the mathbin space before and after cdot.

    – Phelype Oleinik
    8 hours ago











  • @PhelypeOleinik, How simple!

    – Özgür
    8 hours ago















6















MWE



documentclass[a4paper,11pt,border=1pt]standalone
%LetLtxMacrooldcdotcdot
%renewcommandcdot!cdot! <-- Like this
begindocument
$3cdot 10^8$ m/s
enddocument


I'm getting the following output.



enter image description here



However cdot as there are many spaces between left and right. How do I get the following image should I have a macro?



enter image description here



Related to: https://tex.stackexchange.com/a/29838/33075










share|improve this question

















  • 4





    $3cdot 10^8$ m/s kills the mathbin space before and after cdot.

    – Phelype Oleinik
    8 hours ago











  • @PhelypeOleinik, How simple!

    – Özgür
    8 hours ago













6












6








6


0






MWE



documentclass[a4paper,11pt,border=1pt]standalone
%LetLtxMacrooldcdotcdot
%renewcommandcdot!cdot! <-- Like this
begindocument
$3cdot 10^8$ m/s
enddocument


I'm getting the following output.



enter image description here



However cdot as there are many spaces between left and right. How do I get the following image should I have a macro?



enter image description here



Related to: https://tex.stackexchange.com/a/29838/33075










share|improve this question














MWE



documentclass[a4paper,11pt,border=1pt]standalone
%LetLtxMacrooldcdotcdot
%renewcommandcdot!cdot! <-- Like this
begindocument
$3cdot 10^8$ m/s
enddocument


I'm getting the following output.



enter image description here



However cdot as there are many spaces between left and right. How do I get the following image should I have a macro?



enter image description here



Related to: https://tex.stackexchange.com/a/29838/33075







macros math-operators






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 8 hours ago









ÖzgürÖzgür

1,4911020




1,4911020







  • 4





    $3cdot 10^8$ m/s kills the mathbin space before and after cdot.

    – Phelype Oleinik
    8 hours ago











  • @PhelypeOleinik, How simple!

    – Özgür
    8 hours ago












  • 4





    $3cdot 10^8$ m/s kills the mathbin space before and after cdot.

    – Phelype Oleinik
    8 hours ago











  • @PhelypeOleinik, How simple!

    – Özgür
    8 hours ago







4




4





$3cdot 10^8$ m/s kills the mathbin space before and after cdot.

– Phelype Oleinik
8 hours ago





$3cdot 10^8$ m/s kills the mathbin space before and after cdot.

– Phelype Oleinik
8 hours ago













@PhelypeOleinik, How simple!

– Özgür
8 hours ago





@PhelypeOleinik, How simple!

– Özgür
8 hours ago










2 Answers
2






active

oldest

votes


















7














For this I recommend siunitx, that ensures uniformity in numbers and units.



documentclassarticle
usepackageamsmath
usepackagesiunitx

sisetup
exponent-product=cdot, % double brace for avoiding the space
per-mode=symbol,


begindocument

SI3e8meterpersecond % long form

SI3e8m/s % abbreviated form

SI[per-mode=reciprocal]3e8meterpersecond % long form

enddocument


Note that it's easy to change from a representation to another, when the long form is used (which is recommended).



Also this has the advantage that you just need to change the option in the preamble if you change your mind about how to represent that product.



enter image description here



The same effect can be obtained with the option tight-spacing, which however will act also on all binary operations, for instance uncertainties.



documentclassarticle
usepackageamsmath
usepackagesiunitx

sisetup
exponent-product=cdot,
tight-spacing,
per-mode=symbol,


begindocument

SI3e8meterpersecond % long form

SI3e8m/s % abbreviated form

SI[per-mode=reciprocal]3e8meterpersecond % long form

enddocument





share|improve this answer

























  • Now this is the proper way to do it :-)

    – Phelype Oleinik
    6 hours ago











  • +1. Instead of hard-coding the tightly-spaced behavior, one could also run sisetupexponent-product=cdot, tight-spacing=true. Then, if at some point in the document it becomes necessary to switch to non-tight spacing, one can simply execute sisetuptight-spacing=false.

    – Mico
    5 hours ago












  • @Mico Thanks for the hint. I added it, but noted that this acts also in other places.

    – egreg
    1 hour ago


















4














cdot is defined in fontmath.ltx with:



DeclareMathSymbolcdotmathbinsymbols"01


which means it is a binary operator (mathbin) so it will have an extra space before and after as other binary operators, such as + and -.



TeX will not insert that space if you “hide” cdot within braces:



documentclass[11pt,border=1pt]standalone
begindocument
$3cdot 10^8$ m/s
enddocument


If you will use that symbol multiple times you can define an ordinary math symbol (mathord) with the same glyph as cdot:



documentclass[11pt,border=1pt]standalone
DeclareMathSymbolcodotmathordsymbols"01
begindocument
$3codot 10^8$ m/s
enddocument


or you can redefine cdot with the same command.






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%2f485479%2fhow-can-i-reduce-the-gap-between-left-and-right-of-cdot-with-a-macro%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









    7














    For this I recommend siunitx, that ensures uniformity in numbers and units.



    documentclassarticle
    usepackageamsmath
    usepackagesiunitx

    sisetup
    exponent-product=cdot, % double brace for avoiding the space
    per-mode=symbol,


    begindocument

    SI3e8meterpersecond % long form

    SI3e8m/s % abbreviated form

    SI[per-mode=reciprocal]3e8meterpersecond % long form

    enddocument


    Note that it's easy to change from a representation to another, when the long form is used (which is recommended).



    Also this has the advantage that you just need to change the option in the preamble if you change your mind about how to represent that product.



    enter image description here



    The same effect can be obtained with the option tight-spacing, which however will act also on all binary operations, for instance uncertainties.



    documentclassarticle
    usepackageamsmath
    usepackagesiunitx

    sisetup
    exponent-product=cdot,
    tight-spacing,
    per-mode=symbol,


    begindocument

    SI3e8meterpersecond % long form

    SI3e8m/s % abbreviated form

    SI[per-mode=reciprocal]3e8meterpersecond % long form

    enddocument





    share|improve this answer

























    • Now this is the proper way to do it :-)

      – Phelype Oleinik
      6 hours ago











    • +1. Instead of hard-coding the tightly-spaced behavior, one could also run sisetupexponent-product=cdot, tight-spacing=true. Then, if at some point in the document it becomes necessary to switch to non-tight spacing, one can simply execute sisetuptight-spacing=false.

      – Mico
      5 hours ago












    • @Mico Thanks for the hint. I added it, but noted that this acts also in other places.

      – egreg
      1 hour ago















    7














    For this I recommend siunitx, that ensures uniformity in numbers and units.



    documentclassarticle
    usepackageamsmath
    usepackagesiunitx

    sisetup
    exponent-product=cdot, % double brace for avoiding the space
    per-mode=symbol,


    begindocument

    SI3e8meterpersecond % long form

    SI3e8m/s % abbreviated form

    SI[per-mode=reciprocal]3e8meterpersecond % long form

    enddocument


    Note that it's easy to change from a representation to another, when the long form is used (which is recommended).



    Also this has the advantage that you just need to change the option in the preamble if you change your mind about how to represent that product.



    enter image description here



    The same effect can be obtained with the option tight-spacing, which however will act also on all binary operations, for instance uncertainties.



    documentclassarticle
    usepackageamsmath
    usepackagesiunitx

    sisetup
    exponent-product=cdot,
    tight-spacing,
    per-mode=symbol,


    begindocument

    SI3e8meterpersecond % long form

    SI3e8m/s % abbreviated form

    SI[per-mode=reciprocal]3e8meterpersecond % long form

    enddocument





    share|improve this answer

























    • Now this is the proper way to do it :-)

      – Phelype Oleinik
      6 hours ago











    • +1. Instead of hard-coding the tightly-spaced behavior, one could also run sisetupexponent-product=cdot, tight-spacing=true. Then, if at some point in the document it becomes necessary to switch to non-tight spacing, one can simply execute sisetuptight-spacing=false.

      – Mico
      5 hours ago












    • @Mico Thanks for the hint. I added it, but noted that this acts also in other places.

      – egreg
      1 hour ago













    7












    7








    7







    For this I recommend siunitx, that ensures uniformity in numbers and units.



    documentclassarticle
    usepackageamsmath
    usepackagesiunitx

    sisetup
    exponent-product=cdot, % double brace for avoiding the space
    per-mode=symbol,


    begindocument

    SI3e8meterpersecond % long form

    SI3e8m/s % abbreviated form

    SI[per-mode=reciprocal]3e8meterpersecond % long form

    enddocument


    Note that it's easy to change from a representation to another, when the long form is used (which is recommended).



    Also this has the advantage that you just need to change the option in the preamble if you change your mind about how to represent that product.



    enter image description here



    The same effect can be obtained with the option tight-spacing, which however will act also on all binary operations, for instance uncertainties.



    documentclassarticle
    usepackageamsmath
    usepackagesiunitx

    sisetup
    exponent-product=cdot,
    tight-spacing,
    per-mode=symbol,


    begindocument

    SI3e8meterpersecond % long form

    SI3e8m/s % abbreviated form

    SI[per-mode=reciprocal]3e8meterpersecond % long form

    enddocument





    share|improve this answer















    For this I recommend siunitx, that ensures uniformity in numbers and units.



    documentclassarticle
    usepackageamsmath
    usepackagesiunitx

    sisetup
    exponent-product=cdot, % double brace for avoiding the space
    per-mode=symbol,


    begindocument

    SI3e8meterpersecond % long form

    SI3e8m/s % abbreviated form

    SI[per-mode=reciprocal]3e8meterpersecond % long form

    enddocument


    Note that it's easy to change from a representation to another, when the long form is used (which is recommended).



    Also this has the advantage that you just need to change the option in the preamble if you change your mind about how to represent that product.



    enter image description here



    The same effect can be obtained with the option tight-spacing, which however will act also on all binary operations, for instance uncertainties.



    documentclassarticle
    usepackageamsmath
    usepackagesiunitx

    sisetup
    exponent-product=cdot,
    tight-spacing,
    per-mode=symbol,


    begindocument

    SI3e8meterpersecond % long form

    SI3e8m/s % abbreviated form

    SI[per-mode=reciprocal]3e8meterpersecond % long form

    enddocument






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited 1 hour ago

























    answered 7 hours ago









    egregegreg

    735k8919343257




    735k8919343257












    • Now this is the proper way to do it :-)

      – Phelype Oleinik
      6 hours ago











    • +1. Instead of hard-coding the tightly-spaced behavior, one could also run sisetupexponent-product=cdot, tight-spacing=true. Then, if at some point in the document it becomes necessary to switch to non-tight spacing, one can simply execute sisetuptight-spacing=false.

      – Mico
      5 hours ago












    • @Mico Thanks for the hint. I added it, but noted that this acts also in other places.

      – egreg
      1 hour ago

















    • Now this is the proper way to do it :-)

      – Phelype Oleinik
      6 hours ago











    • +1. Instead of hard-coding the tightly-spaced behavior, one could also run sisetupexponent-product=cdot, tight-spacing=true. Then, if at some point in the document it becomes necessary to switch to non-tight spacing, one can simply execute sisetuptight-spacing=false.

      – Mico
      5 hours ago












    • @Mico Thanks for the hint. I added it, but noted that this acts also in other places.

      – egreg
      1 hour ago
















    Now this is the proper way to do it :-)

    – Phelype Oleinik
    6 hours ago





    Now this is the proper way to do it :-)

    – Phelype Oleinik
    6 hours ago













    +1. Instead of hard-coding the tightly-spaced behavior, one could also run sisetupexponent-product=cdot, tight-spacing=true. Then, if at some point in the document it becomes necessary to switch to non-tight spacing, one can simply execute sisetuptight-spacing=false.

    – Mico
    5 hours ago






    +1. Instead of hard-coding the tightly-spaced behavior, one could also run sisetupexponent-product=cdot, tight-spacing=true. Then, if at some point in the document it becomes necessary to switch to non-tight spacing, one can simply execute sisetuptight-spacing=false.

    – Mico
    5 hours ago














    @Mico Thanks for the hint. I added it, but noted that this acts also in other places.

    – egreg
    1 hour ago





    @Mico Thanks for the hint. I added it, but noted that this acts also in other places.

    – egreg
    1 hour ago











    4














    cdot is defined in fontmath.ltx with:



    DeclareMathSymbolcdotmathbinsymbols"01


    which means it is a binary operator (mathbin) so it will have an extra space before and after as other binary operators, such as + and -.



    TeX will not insert that space if you “hide” cdot within braces:



    documentclass[11pt,border=1pt]standalone
    begindocument
    $3cdot 10^8$ m/s
    enddocument


    If you will use that symbol multiple times you can define an ordinary math symbol (mathord) with the same glyph as cdot:



    documentclass[11pt,border=1pt]standalone
    DeclareMathSymbolcodotmathordsymbols"01
    begindocument
    $3codot 10^8$ m/s
    enddocument


    or you can redefine cdot with the same command.






    share|improve this answer



























      4














      cdot is defined in fontmath.ltx with:



      DeclareMathSymbolcdotmathbinsymbols"01


      which means it is a binary operator (mathbin) so it will have an extra space before and after as other binary operators, such as + and -.



      TeX will not insert that space if you “hide” cdot within braces:



      documentclass[11pt,border=1pt]standalone
      begindocument
      $3cdot 10^8$ m/s
      enddocument


      If you will use that symbol multiple times you can define an ordinary math symbol (mathord) with the same glyph as cdot:



      documentclass[11pt,border=1pt]standalone
      DeclareMathSymbolcodotmathordsymbols"01
      begindocument
      $3codot 10^8$ m/s
      enddocument


      or you can redefine cdot with the same command.






      share|improve this answer

























        4












        4








        4







        cdot is defined in fontmath.ltx with:



        DeclareMathSymbolcdotmathbinsymbols"01


        which means it is a binary operator (mathbin) so it will have an extra space before and after as other binary operators, such as + and -.



        TeX will not insert that space if you “hide” cdot within braces:



        documentclass[11pt,border=1pt]standalone
        begindocument
        $3cdot 10^8$ m/s
        enddocument


        If you will use that symbol multiple times you can define an ordinary math symbol (mathord) with the same glyph as cdot:



        documentclass[11pt,border=1pt]standalone
        DeclareMathSymbolcodotmathordsymbols"01
        begindocument
        $3codot 10^8$ m/s
        enddocument


        or you can redefine cdot with the same command.






        share|improve this answer













        cdot is defined in fontmath.ltx with:



        DeclareMathSymbolcdotmathbinsymbols"01


        which means it is a binary operator (mathbin) so it will have an extra space before and after as other binary operators, such as + and -.



        TeX will not insert that space if you “hide” cdot within braces:



        documentclass[11pt,border=1pt]standalone
        begindocument
        $3cdot 10^8$ m/s
        enddocument


        If you will use that symbol multiple times you can define an ordinary math symbol (mathord) with the same glyph as cdot:



        documentclass[11pt,border=1pt]standalone
        DeclareMathSymbolcodotmathordsymbols"01
        begindocument
        $3codot 10^8$ m/s
        enddocument


        or you can redefine cdot with the same command.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 8 hours ago









        Phelype OleinikPhelype Oleinik

        25.6k54690




        25.6k54690



























            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%2f485479%2fhow-can-i-reduce-the-gap-between-left-and-right-of-cdot-with-a-macro%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

            How to create a command for the “strange m” symbol in latex? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)How do you make your own symbol when Detexify fails?Writing bold small caps with mathpazo packageplus-minus symbol with parenthesis around the minus signGreek character in Beamer document titleHow to create dashed right arrow over symbol?Currency symbol: Turkish LiraDouble prec as a single symbol?Plus Sign Too Big; How to Call adfbullet?Is there a TeX macro for three-legged pi?How do I get my integral-like symbol to align like the integral?How to selectively substitute a letter with another symbol representing the same letterHow do I generate a less than symbol and vertical bar that are the same height?

            Българска екзархия Съдържание История | Български екзарси | Вижте също | Външни препратки | Литература | Бележки | НавигацияУстав за управлението на българската екзархия. Цариград, 1870Слово на Ловешкия митрополит Иларион при откриването на Българския народен събор в Цариград на 23. II. 1870 г.Българската правда и гръцката кривда. От С. М. (= Софийски Мелетий). Цариград, 1872Предстоятели на Българската екзархияПодмененият ВеликденИнформационна агенция „Фокус“Димитър Ризов. Българите в техните исторически, етнографически и политически граници (Атлас съдържащ 40 карти). Berlin, Königliche Hoflithographie, Hof-Buch- und -Steindruckerei Wilhelm Greve, 1917Report of the International Commission to Inquire into the Causes and Conduct of the Balkan Wars

            Чепеларе Съдържание География | История | Население | Спортни и природни забележителности | Културни и исторически обекти | Религии | Обществени институции | Известни личности | Редовни събития | Галерия | Източници | Литература | Външни препратки | Навигация41°43′23.99″ с. ш. 24°41′09.99″ и. д. / 41.723333° с. ш. 24.686111° и. д.*ЧепелареЧепеларски Linux fest 2002Начало на Зимен сезон 2005/06Национални хайдушки празници „Капитан Петко Войвода“Град ЧепелареЧепеларе – народният ски курортbgrod.orgwww.terranatura.hit.bgСправка за населението на гр. Исперих, общ. Исперих, обл. РазградМузей на родопския карстМузей на спорта и скитеЧепеларебългарскибългарскианглийскитукИстория на градаСки писти в ЧепелареВремето в ЧепелареРадио и телевизия в ЧепелареЧепеларе мами с родопски чар и добри пистиЕвтин туризъм и снежни атракции в ЧепелареМестоположениеИнформация и снимки от музея на родопския карст3D панорами от ЧепелареЧепелареррр