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'?
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.
However cdot
as there are many spaces between left and right. How do I get the following image should I have a macro?
Related to: https://tex.stackexchange.com/a/29838/33075
macros math-operators
add a comment |
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.
However cdot
as there are many spaces between left and right. How do I get the following image should I have a macro?
Related to: https://tex.stackexchange.com/a/29838/33075
macros math-operators
4
$3cdot 10^8$ m/s
kills themathbin
space before and aftercdot
.
– Phelype Oleinik
8 hours ago
@PhelypeOleinik, How simple!
– Özgür
8 hours ago
add a comment |
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.
However cdot
as there are many spaces between left and right. How do I get the following image should I have a macro?
Related to: https://tex.stackexchange.com/a/29838/33075
macros math-operators
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.
However cdot
as there are many spaces between left and right. How do I get the following image should I have a macro?
Related to: https://tex.stackexchange.com/a/29838/33075
macros math-operators
macros math-operators
asked 8 hours ago
ÖzgürÖzgür
1,4911020
1,4911020
4
$3cdot 10^8$ m/s
kills themathbin
space before and aftercdot
.
– Phelype Oleinik
8 hours ago
@PhelypeOleinik, How simple!
– Özgür
8 hours ago
add a comment |
4
$3cdot 10^8$ m/s
kills themathbin
space before and aftercdot
.
– 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
add a comment |
2 Answers
2
active
oldest
votes
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.
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
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 runsisetupexponent-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 executesisetuptight-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
add a comment |
cdot
is defined in fontmath.ltx
with:
DeclareMathSymbolcdotmathbinsymbols"01
which means it is a bin
ary 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 ord
inary 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.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%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
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.
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
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 runsisetupexponent-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 executesisetuptight-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
add a comment |
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.
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
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 runsisetupexponent-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 executesisetuptight-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
add a comment |
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.
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
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.
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
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 runsisetupexponent-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 executesisetuptight-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
add a comment |
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 runsisetupexponent-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 executesisetuptight-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
add a comment |
cdot
is defined in fontmath.ltx
with:
DeclareMathSymbolcdotmathbinsymbols"01
which means it is a bin
ary 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 ord
inary 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.
add a comment |
cdot
is defined in fontmath.ltx
with:
DeclareMathSymbolcdotmathbinsymbols"01
which means it is a bin
ary 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 ord
inary 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.
add a comment |
cdot
is defined in fontmath.ltx
with:
DeclareMathSymbolcdotmathbinsymbols"01
which means it is a bin
ary 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 ord
inary 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.
cdot
is defined in fontmath.ltx
with:
DeclareMathSymbolcdotmathbinsymbols"01
which means it is a bin
ary 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 ord
inary 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.
answered 8 hours ago
Phelype OleinikPhelype Oleinik
25.6k54690
25.6k54690
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
4
$3cdot 10^8$ m/s
kills themathbin
space before and aftercdot
.– Phelype Oleinik
8 hours ago
@PhelypeOleinik, How simple!
– Özgür
8 hours ago