How to typeset $:=$ correctly?
I like to use $:=$ for "is defined to be equal to", but this is never typeset with the symmetry one would like, as the colon is always too low relatively to the equals sign. Is there any way of getting this to appear correctly?
math-mode symbols relation-symbols
|
show 6 more comments
I like to use $:=$ for "is defined to be equal to", but this is never typeset with the symmetry one would like, as the colon is always too low relatively to the equals sign. Is there any way of getting this to appear correctly?
math-mode symbols relation-symbols
3
":=" is usually meant to be a quite different concept, namely imperative assignment.
– Charles Stewart
Oct 18 '10 at 12:58
36
@Charles: I've seen it used for both. Pure mathematicians, who have little use for imperative assignment, I think tend to use it more for definitional equality.
– Antal Spector-Zabusky
Nov 3 '10 at 19:34
6
Oh yes, they do, all the time.
– Hendrik Vogt
Nov 4 '10 at 7:26
8
@Charles: I don't think it's any sloppier than, say, an algebraist writing H < G for "H is a subgroup of G". Sure, we think of < as meaning numerically less than, but there's no ambiguity in the context. And there's a related meaning in both cases: both uses of < give rise to a poset, and both uses of := mark some "special" form of equality. And since most mathematicians have no use for the imperative :=, there's no confusion. Just my 2¢. (Personally, I'm not particularly fond of either usage of :=, preferring "we define x to be …" or "x = …" for the one and "var ← value" for the other.)
– Antal Spector-Zabusky
Nov 4 '10 at 10:28
5
@user, you were misinformed. The symbol goes much further back, to APL and the Pascal family of languages. It's meant to resemble APL's left-pointing arrow, which is of course not part of ASCII. That's why people associate it with "imperative assignment" in the discussion.
– alexis
Apr 18 '13 at 10:17
|
show 6 more comments
I like to use $:=$ for "is defined to be equal to", but this is never typeset with the symmetry one would like, as the colon is always too low relatively to the equals sign. Is there any way of getting this to appear correctly?
math-mode symbols relation-symbols
I like to use $:=$ for "is defined to be equal to", but this is never typeset with the symmetry one would like, as the colon is always too low relatively to the equals sign. Is there any way of getting this to appear correctly?
math-mode symbols relation-symbols
math-mode symbols relation-symbols
edited Mar 9 '13 at 13:26
Charles Stewart
17.2k355110
17.2k355110
asked Oct 17 '10 at 11:02
Oscar Randal-WilliamsOscar Randal-Williams
1,093284
1,093284
3
":=" is usually meant to be a quite different concept, namely imperative assignment.
– Charles Stewart
Oct 18 '10 at 12:58
36
@Charles: I've seen it used for both. Pure mathematicians, who have little use for imperative assignment, I think tend to use it more for definitional equality.
– Antal Spector-Zabusky
Nov 3 '10 at 19:34
6
Oh yes, they do, all the time.
– Hendrik Vogt
Nov 4 '10 at 7:26
8
@Charles: I don't think it's any sloppier than, say, an algebraist writing H < G for "H is a subgroup of G". Sure, we think of < as meaning numerically less than, but there's no ambiguity in the context. And there's a related meaning in both cases: both uses of < give rise to a poset, and both uses of := mark some "special" form of equality. And since most mathematicians have no use for the imperative :=, there's no confusion. Just my 2¢. (Personally, I'm not particularly fond of either usage of :=, preferring "we define x to be …" or "x = …" for the one and "var ← value" for the other.)
– Antal Spector-Zabusky
Nov 4 '10 at 10:28
5
@user, you were misinformed. The symbol goes much further back, to APL and the Pascal family of languages. It's meant to resemble APL's left-pointing arrow, which is of course not part of ASCII. That's why people associate it with "imperative assignment" in the discussion.
– alexis
Apr 18 '13 at 10:17
|
show 6 more comments
3
":=" is usually meant to be a quite different concept, namely imperative assignment.
– Charles Stewart
Oct 18 '10 at 12:58
36
@Charles: I've seen it used for both. Pure mathematicians, who have little use for imperative assignment, I think tend to use it more for definitional equality.
– Antal Spector-Zabusky
Nov 3 '10 at 19:34
6
Oh yes, they do, all the time.
– Hendrik Vogt
Nov 4 '10 at 7:26
8
@Charles: I don't think it's any sloppier than, say, an algebraist writing H < G for "H is a subgroup of G". Sure, we think of < as meaning numerically less than, but there's no ambiguity in the context. And there's a related meaning in both cases: both uses of < give rise to a poset, and both uses of := mark some "special" form of equality. And since most mathematicians have no use for the imperative :=, there's no confusion. Just my 2¢. (Personally, I'm not particularly fond of either usage of :=, preferring "we define x to be …" or "x = …" for the one and "var ← value" for the other.)
– Antal Spector-Zabusky
Nov 4 '10 at 10:28
5
@user, you were misinformed. The symbol goes much further back, to APL and the Pascal family of languages. It's meant to resemble APL's left-pointing arrow, which is of course not part of ASCII. That's why people associate it with "imperative assignment" in the discussion.
– alexis
Apr 18 '13 at 10:17
3
3
":=" is usually meant to be a quite different concept, namely imperative assignment.
– Charles Stewart
Oct 18 '10 at 12:58
":=" is usually meant to be a quite different concept, namely imperative assignment.
– Charles Stewart
Oct 18 '10 at 12:58
36
36
@Charles: I've seen it used for both. Pure mathematicians, who have little use for imperative assignment, I think tend to use it more for definitional equality.
– Antal Spector-Zabusky
Nov 3 '10 at 19:34
@Charles: I've seen it used for both. Pure mathematicians, who have little use for imperative assignment, I think tend to use it more for definitional equality.
– Antal Spector-Zabusky
Nov 3 '10 at 19:34
6
6
Oh yes, they do, all the time.
– Hendrik Vogt
Nov 4 '10 at 7:26
Oh yes, they do, all the time.
– Hendrik Vogt
Nov 4 '10 at 7:26
8
8
@Charles: I don't think it's any sloppier than, say, an algebraist writing H < G for "H is a subgroup of G". Sure, we think of < as meaning numerically less than, but there's no ambiguity in the context. And there's a related meaning in both cases: both uses of < give rise to a poset, and both uses of := mark some "special" form of equality. And since most mathematicians have no use for the imperative :=, there's no confusion. Just my 2¢. (Personally, I'm not particularly fond of either usage of :=, preferring "we define x to be …" or "x = …" for the one and "var ← value" for the other.)
– Antal Spector-Zabusky
Nov 4 '10 at 10:28
@Charles: I don't think it's any sloppier than, say, an algebraist writing H < G for "H is a subgroup of G". Sure, we think of < as meaning numerically less than, but there's no ambiguity in the context. And there's a related meaning in both cases: both uses of < give rise to a poset, and both uses of := mark some "special" form of equality. And since most mathematicians have no use for the imperative :=, there's no confusion. Just my 2¢. (Personally, I'm not particularly fond of either usage of :=, preferring "we define x to be …" or "x = …" for the one and "var ← value" for the other.)
– Antal Spector-Zabusky
Nov 4 '10 at 10:28
5
5
@user, you were misinformed. The symbol goes much further back, to APL and the Pascal family of languages. It's meant to resemble APL's left-pointing arrow, which is of course not part of ASCII. That's why people associate it with "imperative assignment" in the discussion.
– alexis
Apr 18 '13 at 10:17
@user, you were misinformed. The symbol goes much further back, to APL and the Pascal family of languages. It's meant to resemble APL's left-pointing arrow, which is of course not part of ASCII. That's why people associate it with "imperative assignment" in the discussion.
– alexis
Apr 18 '13 at 10:17
|
show 6 more comments
11 Answers
11
active
oldest
votes
See the mathtools package, which offers the macro coloneqq for this purpose.
documentclass{standalone}
usepackage{mathtools}
begin{document}
( b := 10 ) emph{versus} ( b coloneqq 10 ).
end{document}
yields

Click image or right here to see it at full size (1600×133).
Note that the colon is slightly too low on the left, but vertically centered on the right.
1
I don’t get it. Isn’t the coloneqq in the image just as asymetric as the := on the left? What does the package solve, then?
– Emil Jeřábek
May 20 '14 at 16:48
14
@EmilJeřábek Perhaps you can't see it very well in the image, but if you run the code and zoom in on the PDF you'll find the second version has the:and=on the same axis whereas the first one doesn't.
– Joseph Wright♦
May 20 '14 at 16:55
3
Is there a unicode symbol for :=, with same benefits as coloneqq? Yes: U+2254
– phs
Mar 7 '17 at 12:12
add a comment |
This answer is an attempt to make Matthew happy, who doesn't like that the dots in the colon are so far apart. (@Matthew: I do understand that you don't like it.)
makeatletter
newcommand*{defeq}{mathrel{rlap{%
raisebox{0.3ex}{$m@thcdot$}}%
raisebox{-0.3ex}{$m@thcdot$}}%
=}
makeatother

EDIT:
To make Matthew even happier, I provide yet another answer that uses a different approach (motivated by the definition of vdots) where the dots are smaller:
newcommand*{defeq}{mathrel{vcenter{baselineskip0.5ex lineskiplimit0pt
hbox{scriptsize.}hbox{scriptsize.}}}%
=}

1
thanks for caring about my happiness. :-) In addition to the dots being the same distance apart as the lines, I were writing ":=" with chalk or pencil I think the diameter of the dots would be about the same as the line width. Can you do that?
– Matthew Leingang
Nov 3 '10 at 18:12
4
@Matthew: Happy now?
– Hendrik Vogt
Nov 3 '10 at 19:13
1
Not bad at all.
– Matthew Leingang
Nov 3 '10 at 19:18
4
Fantastic! I've been looking for this for ages. +++++1
– Glen Wheeler
Sep 6 '11 at 7:45
2
@tohecz: You're right, but do you really want to define something in an index? Or is there some other usage of the symbol?
– Hendrik Vogt
Feb 10 '13 at 8:00
|
show 2 more comments
I prefer Donald Arseneau's hack that can be found on the TeX FAQ (sorry, this links to a page in German):
mathchardefordinarycolonmathcode`:
mathcode`:=string"8000
begingroup catcode`:=active
gdef:{mathrel{mathopordinarycolon}}
endgroup
Just put this code into your preamble. Then you can use := as usual, and you'll get horizontal symmetry. Much easier to use than coloneqq, in my opinion.
35
This is already part of mathtools:mathtoolsset{centercolon}
– Will Robertson
Oct 17 '10 at 14:34
@Will Robertson: Thanks for the tip. I already thought that this should be in some package, but didn't find it.
– Hendrik Vogt
Oct 17 '10 at 14:40
add a comment |
Obligatory ConTeXt solution: colonequals; which uses a composed character in MkII and the proper unicode math character in MkIV
add a comment |
There is also a package by Heiko Oberdiek: colonequals
Some fonts have dedicated characters for these symbols. Unfortunately, there are name clashes concerning coloneq, which may refer to :- or to ≔ (U+2254, :=).
3
pxfonts is one of the fonts with this already in.
– Loop Space
Oct 18 '10 at 8:03
add a comment |
I actually think that symbol looks ugly. It would be OK if the spacing between the dots were the same as that between the lines of the equals. But I use
newcommand{defeq}{stackrel{text{def}}{=}}
instead.
7
Whereas I think that the overset "def" is ugly (and illegible from any distance)! There's no accounting for taste ...
– Loop Space
Oct 18 '10 at 8:04
18
One advantage of := is that ir is bidirectional. := and =: mean different things. defeq and triangleeq loose that distinction.
– Aditya
Oct 18 '10 at 13:41
4
+1 for this. ":=" is programming jargon and, as Charles Stewart points out, misused programming jargon. Personally, I prefer newcommand{defeq}{stackrel{textup{tiny def}}{=}}. Then Andrew Stacey can't see it at all, and everyone's happy.
– Mephisto
Oct 19 '10 at 0:08
2
@Charles: thanks for matching my braces. @Aditya: I see your point of view, but I think bidirectional means the opposite of the way you're using it.
– Matthew Leingang
Oct 21 '10 at 1:08
2
@Matthew: I'd use yourdefeqto indicate that an equality holds by definition (i.e., by a definition stated earlier). I've posted another answer that changes the spacing of the dots.
– Hendrik Vogt
Nov 3 '10 at 16:49
|
show 2 more comments
A way to get this with pxfonts without including the whole package:
DeclareSymbolFont{symbolsC}{U}{pxsyc}{m}{n}
DeclareMathSymbol{coloneqq}{mathrel}{symbolsC}{"42}
and you get:

add a comment |
My solution is
defdefeq{mathrel{mathop:}=}
This is not a good solution because you can have a line break between the : and the = (mathtoolshad this bug a while back, see groups.google.com/group/comp.text.tex/msg/…).
– Aditya
Nov 3 '10 at 17:54
6
@Aditya: something likemathrel{mathop:}=does not break between lines, but usingmathrel{mathop:}mkern-1.2mu=as inmathtoolsdoes introduce a breaking point at themkern(and can be solved by putting anobreakjust beforemkernor by wrapping everything in amathrel).
– Philippe Goutet
Dec 11 '10 at 23:24
add a comment |
I tried quite some of the solutions given here but none of those seemed satisfactory to me. Most of them only solve the problem of the vertical alignment of the colon but do not respect the length of all the other binary relations, that is ":=" is much longer than "=" and the like.
My suggestion hence is the following:
newcommand{eqcolon}{mathrel{resizebox{widthof{$mathord{=}$}}{height}{ $!!=!!resizebox{1.2width}{0.8height}{raisebox{0.23ex}{$mathop{:}$}}!!$ }}}
newcommand{coloneq}{mathrel{resizebox{widthof{$mathord{=}$}}{height}{ $!!resizebox{1.2width}{0.8height}{raisebox{0.23ex}{$mathop{:}$}}!!=!!$ }}}
This will result in ":=" beeing equally long as "=" so it will align properly in multiline math equations. Below is a comparisson of the approach newcommand{eqcolon}{ensuremath{mathrel{=!!mathop{:}}}} with my suggestion. Note how the lines align properly in amsmath align environments.
Before:

After:

Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Martin Schröder
Oct 28 '15 at 14:47
This looks like an answer to a slightly different question...
– Martin Schröder
Oct 28 '15 at 14:48
2
@MartinSchröder Why is that? I had the same problem to typeset $:=$ for "defined as". I use this sometimes to define auxillary variables that I only use locally. I just wanted to share my result as I was not satisfied with the typographic quality of other solutions here and in similar questions (e.g. Typesetting the “define equals” symbol).
– jenom
Oct 28 '15 at 15:24
add a comment |
I use vcentcolon= from the mathtools package. I like it better than coloneqq because with the former, there is more spacing between the colon and the equals sign.

add a comment |
You may try coloneq (as well as eqcolon) from unicode-math package:

Note that unicode-math requires XeLaTeX/LuaLaTeX.
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%2f4216%2fhow-to-typeset-correctly%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
11 Answers
11
active
oldest
votes
11 Answers
11
active
oldest
votes
active
oldest
votes
active
oldest
votes
See the mathtools package, which offers the macro coloneqq for this purpose.
documentclass{standalone}
usepackage{mathtools}
begin{document}
( b := 10 ) emph{versus} ( b coloneqq 10 ).
end{document}
yields

Click image or right here to see it at full size (1600×133).
Note that the colon is slightly too low on the left, but vertically centered on the right.
1
I don’t get it. Isn’t the coloneqq in the image just as asymetric as the := on the left? What does the package solve, then?
– Emil Jeřábek
May 20 '14 at 16:48
14
@EmilJeřábek Perhaps you can't see it very well in the image, but if you run the code and zoom in on the PDF you'll find the second version has the:and=on the same axis whereas the first one doesn't.
– Joseph Wright♦
May 20 '14 at 16:55
3
Is there a unicode symbol for :=, with same benefits as coloneqq? Yes: U+2254
– phs
Mar 7 '17 at 12:12
add a comment |
See the mathtools package, which offers the macro coloneqq for this purpose.
documentclass{standalone}
usepackage{mathtools}
begin{document}
( b := 10 ) emph{versus} ( b coloneqq 10 ).
end{document}
yields

Click image or right here to see it at full size (1600×133).
Note that the colon is slightly too low on the left, but vertically centered on the right.
1
I don’t get it. Isn’t the coloneqq in the image just as asymetric as the := on the left? What does the package solve, then?
– Emil Jeřábek
May 20 '14 at 16:48
14
@EmilJeřábek Perhaps you can't see it very well in the image, but if you run the code and zoom in on the PDF you'll find the second version has the:and=on the same axis whereas the first one doesn't.
– Joseph Wright♦
May 20 '14 at 16:55
3
Is there a unicode symbol for :=, with same benefits as coloneqq? Yes: U+2254
– phs
Mar 7 '17 at 12:12
add a comment |
See the mathtools package, which offers the macro coloneqq for this purpose.
documentclass{standalone}
usepackage{mathtools}
begin{document}
( b := 10 ) emph{versus} ( b coloneqq 10 ).
end{document}
yields

Click image or right here to see it at full size (1600×133).
Note that the colon is slightly too low on the left, but vertically centered on the right.
See the mathtools package, which offers the macro coloneqq for this purpose.
documentclass{standalone}
usepackage{mathtools}
begin{document}
( b := 10 ) emph{versus} ( b coloneqq 10 ).
end{document}
yields

Click image or right here to see it at full size (1600×133).
Note that the colon is slightly too low on the left, but vertically centered on the right.
edited Oct 28 '14 at 5:05
wchargin
1,7791130
1,7791130
answered Oct 17 '10 at 11:04
Joseph Wright♦Joseph Wright
203k21558884
203k21558884
1
I don’t get it. Isn’t the coloneqq in the image just as asymetric as the := on the left? What does the package solve, then?
– Emil Jeřábek
May 20 '14 at 16:48
14
@EmilJeřábek Perhaps you can't see it very well in the image, but if you run the code and zoom in on the PDF you'll find the second version has the:and=on the same axis whereas the first one doesn't.
– Joseph Wright♦
May 20 '14 at 16:55
3
Is there a unicode symbol for :=, with same benefits as coloneqq? Yes: U+2254
– phs
Mar 7 '17 at 12:12
add a comment |
1
I don’t get it. Isn’t the coloneqq in the image just as asymetric as the := on the left? What does the package solve, then?
– Emil Jeřábek
May 20 '14 at 16:48
14
@EmilJeřábek Perhaps you can't see it very well in the image, but if you run the code and zoom in on the PDF you'll find the second version has the:and=on the same axis whereas the first one doesn't.
– Joseph Wright♦
May 20 '14 at 16:55
3
Is there a unicode symbol for :=, with same benefits as coloneqq? Yes: U+2254
– phs
Mar 7 '17 at 12:12
1
1
I don’t get it. Isn’t the coloneqq in the image just as asymetric as the := on the left? What does the package solve, then?
– Emil Jeřábek
May 20 '14 at 16:48
I don’t get it. Isn’t the coloneqq in the image just as asymetric as the := on the left? What does the package solve, then?
– Emil Jeřábek
May 20 '14 at 16:48
14
14
@EmilJeřábek Perhaps you can't see it very well in the image, but if you run the code and zoom in on the PDF you'll find the second version has the
: and = on the same axis whereas the first one doesn't.– Joseph Wright♦
May 20 '14 at 16:55
@EmilJeřábek Perhaps you can't see it very well in the image, but if you run the code and zoom in on the PDF you'll find the second version has the
: and = on the same axis whereas the first one doesn't.– Joseph Wright♦
May 20 '14 at 16:55
3
3
Is there a unicode symbol for :=, with same benefits as coloneqq? Yes: U+2254
– phs
Mar 7 '17 at 12:12
Is there a unicode symbol for :=, with same benefits as coloneqq? Yes: U+2254
– phs
Mar 7 '17 at 12:12
add a comment |
This answer is an attempt to make Matthew happy, who doesn't like that the dots in the colon are so far apart. (@Matthew: I do understand that you don't like it.)
makeatletter
newcommand*{defeq}{mathrel{rlap{%
raisebox{0.3ex}{$m@thcdot$}}%
raisebox{-0.3ex}{$m@thcdot$}}%
=}
makeatother

EDIT:
To make Matthew even happier, I provide yet another answer that uses a different approach (motivated by the definition of vdots) where the dots are smaller:
newcommand*{defeq}{mathrel{vcenter{baselineskip0.5ex lineskiplimit0pt
hbox{scriptsize.}hbox{scriptsize.}}}%
=}

1
thanks for caring about my happiness. :-) In addition to the dots being the same distance apart as the lines, I were writing ":=" with chalk or pencil I think the diameter of the dots would be about the same as the line width. Can you do that?
– Matthew Leingang
Nov 3 '10 at 18:12
4
@Matthew: Happy now?
– Hendrik Vogt
Nov 3 '10 at 19:13
1
Not bad at all.
– Matthew Leingang
Nov 3 '10 at 19:18
4
Fantastic! I've been looking for this for ages. +++++1
– Glen Wheeler
Sep 6 '11 at 7:45
2
@tohecz: You're right, but do you really want to define something in an index? Or is there some other usage of the symbol?
– Hendrik Vogt
Feb 10 '13 at 8:00
|
show 2 more comments
This answer is an attempt to make Matthew happy, who doesn't like that the dots in the colon are so far apart. (@Matthew: I do understand that you don't like it.)
makeatletter
newcommand*{defeq}{mathrel{rlap{%
raisebox{0.3ex}{$m@thcdot$}}%
raisebox{-0.3ex}{$m@thcdot$}}%
=}
makeatother

EDIT:
To make Matthew even happier, I provide yet another answer that uses a different approach (motivated by the definition of vdots) where the dots are smaller:
newcommand*{defeq}{mathrel{vcenter{baselineskip0.5ex lineskiplimit0pt
hbox{scriptsize.}hbox{scriptsize.}}}%
=}

1
thanks for caring about my happiness. :-) In addition to the dots being the same distance apart as the lines, I were writing ":=" with chalk or pencil I think the diameter of the dots would be about the same as the line width. Can you do that?
– Matthew Leingang
Nov 3 '10 at 18:12
4
@Matthew: Happy now?
– Hendrik Vogt
Nov 3 '10 at 19:13
1
Not bad at all.
– Matthew Leingang
Nov 3 '10 at 19:18
4
Fantastic! I've been looking for this for ages. +++++1
– Glen Wheeler
Sep 6 '11 at 7:45
2
@tohecz: You're right, but do you really want to define something in an index? Or is there some other usage of the symbol?
– Hendrik Vogt
Feb 10 '13 at 8:00
|
show 2 more comments
This answer is an attempt to make Matthew happy, who doesn't like that the dots in the colon are so far apart. (@Matthew: I do understand that you don't like it.)
makeatletter
newcommand*{defeq}{mathrel{rlap{%
raisebox{0.3ex}{$m@thcdot$}}%
raisebox{-0.3ex}{$m@thcdot$}}%
=}
makeatother

EDIT:
To make Matthew even happier, I provide yet another answer that uses a different approach (motivated by the definition of vdots) where the dots are smaller:
newcommand*{defeq}{mathrel{vcenter{baselineskip0.5ex lineskiplimit0pt
hbox{scriptsize.}hbox{scriptsize.}}}%
=}

This answer is an attempt to make Matthew happy, who doesn't like that the dots in the colon are so far apart. (@Matthew: I do understand that you don't like it.)
makeatletter
newcommand*{defeq}{mathrel{rlap{%
raisebox{0.3ex}{$m@thcdot$}}%
raisebox{-0.3ex}{$m@thcdot$}}%
=}
makeatother

EDIT:
To make Matthew even happier, I provide yet another answer that uses a different approach (motivated by the definition of vdots) where the dots are smaller:
newcommand*{defeq}{mathrel{vcenter{baselineskip0.5ex lineskiplimit0pt
hbox{scriptsize.}hbox{scriptsize.}}}%
=}

edited Nov 3 '10 at 19:13
answered Nov 3 '10 at 16:36
Hendrik VogtHendrik Vogt
28.8k4107190
28.8k4107190
1
thanks for caring about my happiness. :-) In addition to the dots being the same distance apart as the lines, I were writing ":=" with chalk or pencil I think the diameter of the dots would be about the same as the line width. Can you do that?
– Matthew Leingang
Nov 3 '10 at 18:12
4
@Matthew: Happy now?
– Hendrik Vogt
Nov 3 '10 at 19:13
1
Not bad at all.
– Matthew Leingang
Nov 3 '10 at 19:18
4
Fantastic! I've been looking for this for ages. +++++1
– Glen Wheeler
Sep 6 '11 at 7:45
2
@tohecz: You're right, but do you really want to define something in an index? Or is there some other usage of the symbol?
– Hendrik Vogt
Feb 10 '13 at 8:00
|
show 2 more comments
1
thanks for caring about my happiness. :-) In addition to the dots being the same distance apart as the lines, I were writing ":=" with chalk or pencil I think the diameter of the dots would be about the same as the line width. Can you do that?
– Matthew Leingang
Nov 3 '10 at 18:12
4
@Matthew: Happy now?
– Hendrik Vogt
Nov 3 '10 at 19:13
1
Not bad at all.
– Matthew Leingang
Nov 3 '10 at 19:18
4
Fantastic! I've been looking for this for ages. +++++1
– Glen Wheeler
Sep 6 '11 at 7:45
2
@tohecz: You're right, but do you really want to define something in an index? Or is there some other usage of the symbol?
– Hendrik Vogt
Feb 10 '13 at 8:00
1
1
thanks for caring about my happiness. :-) In addition to the dots being the same distance apart as the lines, I were writing ":=" with chalk or pencil I think the diameter of the dots would be about the same as the line width. Can you do that?
– Matthew Leingang
Nov 3 '10 at 18:12
thanks for caring about my happiness. :-) In addition to the dots being the same distance apart as the lines, I were writing ":=" with chalk or pencil I think the diameter of the dots would be about the same as the line width. Can you do that?
– Matthew Leingang
Nov 3 '10 at 18:12
4
4
@Matthew: Happy now?
– Hendrik Vogt
Nov 3 '10 at 19:13
@Matthew: Happy now?
– Hendrik Vogt
Nov 3 '10 at 19:13
1
1
Not bad at all.
– Matthew Leingang
Nov 3 '10 at 19:18
Not bad at all.
– Matthew Leingang
Nov 3 '10 at 19:18
4
4
Fantastic! I've been looking for this for ages. +++++1
– Glen Wheeler
Sep 6 '11 at 7:45
Fantastic! I've been looking for this for ages. +++++1
– Glen Wheeler
Sep 6 '11 at 7:45
2
2
@tohecz: You're right, but do you really want to define something in an index? Or is there some other usage of the symbol?
– Hendrik Vogt
Feb 10 '13 at 8:00
@tohecz: You're right, but do you really want to define something in an index? Or is there some other usage of the symbol?
– Hendrik Vogt
Feb 10 '13 at 8:00
|
show 2 more comments
I prefer Donald Arseneau's hack that can be found on the TeX FAQ (sorry, this links to a page in German):
mathchardefordinarycolonmathcode`:
mathcode`:=string"8000
begingroup catcode`:=active
gdef:{mathrel{mathopordinarycolon}}
endgroup
Just put this code into your preamble. Then you can use := as usual, and you'll get horizontal symmetry. Much easier to use than coloneqq, in my opinion.
35
This is already part of mathtools:mathtoolsset{centercolon}
– Will Robertson
Oct 17 '10 at 14:34
@Will Robertson: Thanks for the tip. I already thought that this should be in some package, but didn't find it.
– Hendrik Vogt
Oct 17 '10 at 14:40
add a comment |
I prefer Donald Arseneau's hack that can be found on the TeX FAQ (sorry, this links to a page in German):
mathchardefordinarycolonmathcode`:
mathcode`:=string"8000
begingroup catcode`:=active
gdef:{mathrel{mathopordinarycolon}}
endgroup
Just put this code into your preamble. Then you can use := as usual, and you'll get horizontal symmetry. Much easier to use than coloneqq, in my opinion.
35
This is already part of mathtools:mathtoolsset{centercolon}
– Will Robertson
Oct 17 '10 at 14:34
@Will Robertson: Thanks for the tip. I already thought that this should be in some package, but didn't find it.
– Hendrik Vogt
Oct 17 '10 at 14:40
add a comment |
I prefer Donald Arseneau's hack that can be found on the TeX FAQ (sorry, this links to a page in German):
mathchardefordinarycolonmathcode`:
mathcode`:=string"8000
begingroup catcode`:=active
gdef:{mathrel{mathopordinarycolon}}
endgroup
Just put this code into your preamble. Then you can use := as usual, and you'll get horizontal symmetry. Much easier to use than coloneqq, in my opinion.
I prefer Donald Arseneau's hack that can be found on the TeX FAQ (sorry, this links to a page in German):
mathchardefordinarycolonmathcode`:
mathcode`:=string"8000
begingroup catcode`:=active
gdef:{mathrel{mathopordinarycolon}}
endgroup
Just put this code into your preamble. Then you can use := as usual, and you'll get horizontal symmetry. Much easier to use than coloneqq, in my opinion.
answered Oct 17 '10 at 11:17
Hendrik VogtHendrik Vogt
28.8k4107190
28.8k4107190
35
This is already part of mathtools:mathtoolsset{centercolon}
– Will Robertson
Oct 17 '10 at 14:34
@Will Robertson: Thanks for the tip. I already thought that this should be in some package, but didn't find it.
– Hendrik Vogt
Oct 17 '10 at 14:40
add a comment |
35
This is already part of mathtools:mathtoolsset{centercolon}
– Will Robertson
Oct 17 '10 at 14:34
@Will Robertson: Thanks for the tip. I already thought that this should be in some package, but didn't find it.
– Hendrik Vogt
Oct 17 '10 at 14:40
35
35
This is already part of mathtools:
mathtoolsset{centercolon}– Will Robertson
Oct 17 '10 at 14:34
This is already part of mathtools:
mathtoolsset{centercolon}– Will Robertson
Oct 17 '10 at 14:34
@Will Robertson: Thanks for the tip. I already thought that this should be in some package, but didn't find it.
– Hendrik Vogt
Oct 17 '10 at 14:40
@Will Robertson: Thanks for the tip. I already thought that this should be in some package, but didn't find it.
– Hendrik Vogt
Oct 17 '10 at 14:40
add a comment |
Obligatory ConTeXt solution: colonequals; which uses a composed character in MkII and the proper unicode math character in MkIV
add a comment |
Obligatory ConTeXt solution: colonequals; which uses a composed character in MkII and the proper unicode math character in MkIV
add a comment |
Obligatory ConTeXt solution: colonequals; which uses a composed character in MkII and the proper unicode math character in MkIV
Obligatory ConTeXt solution: colonequals; which uses a composed character in MkII and the proper unicode math character in MkIV
edited Sep 27 '11 at 10:49
doncherry
34.8k23135208
34.8k23135208
answered Oct 17 '10 at 17:02
AdityaAditya
55.1k2109235
55.1k2109235
add a comment |
add a comment |
There is also a package by Heiko Oberdiek: colonequals
Some fonts have dedicated characters for these symbols. Unfortunately, there are name clashes concerning coloneq, which may refer to :- or to ≔ (U+2254, :=).
3
pxfonts is one of the fonts with this already in.
– Loop Space
Oct 18 '10 at 8:03
add a comment |
There is also a package by Heiko Oberdiek: colonequals
Some fonts have dedicated characters for these symbols. Unfortunately, there are name clashes concerning coloneq, which may refer to :- or to ≔ (U+2254, :=).
3
pxfonts is one of the fonts with this already in.
– Loop Space
Oct 18 '10 at 8:03
add a comment |
There is also a package by Heiko Oberdiek: colonequals
Some fonts have dedicated characters for these symbols. Unfortunately, there are name clashes concerning coloneq, which may refer to :- or to ≔ (U+2254, :=).
There is also a package by Heiko Oberdiek: colonequals
Some fonts have dedicated characters for these symbols. Unfortunately, there are name clashes concerning coloneq, which may refer to :- or to ≔ (U+2254, :=).
edited Sep 27 '11 at 10:50
doncherry
34.8k23135208
34.8k23135208
answered Oct 17 '10 at 13:54
PhilippPhilipp
15k34356
15k34356
3
pxfonts is one of the fonts with this already in.
– Loop Space
Oct 18 '10 at 8:03
add a comment |
3
pxfonts is one of the fonts with this already in.
– Loop Space
Oct 18 '10 at 8:03
3
3
pxfonts is one of the fonts with this already in.
– Loop Space
Oct 18 '10 at 8:03
pxfonts is one of the fonts with this already in.
– Loop Space
Oct 18 '10 at 8:03
add a comment |
I actually think that symbol looks ugly. It would be OK if the spacing between the dots were the same as that between the lines of the equals. But I use
newcommand{defeq}{stackrel{text{def}}{=}}
instead.
7
Whereas I think that the overset "def" is ugly (and illegible from any distance)! There's no accounting for taste ...
– Loop Space
Oct 18 '10 at 8:04
18
One advantage of := is that ir is bidirectional. := and =: mean different things. defeq and triangleeq loose that distinction.
– Aditya
Oct 18 '10 at 13:41
4
+1 for this. ":=" is programming jargon and, as Charles Stewart points out, misused programming jargon. Personally, I prefer newcommand{defeq}{stackrel{textup{tiny def}}{=}}. Then Andrew Stacey can't see it at all, and everyone's happy.
– Mephisto
Oct 19 '10 at 0:08
2
@Charles: thanks for matching my braces. @Aditya: I see your point of view, but I think bidirectional means the opposite of the way you're using it.
– Matthew Leingang
Oct 21 '10 at 1:08
2
@Matthew: I'd use yourdefeqto indicate that an equality holds by definition (i.e., by a definition stated earlier). I've posted another answer that changes the spacing of the dots.
– Hendrik Vogt
Nov 3 '10 at 16:49
|
show 2 more comments
I actually think that symbol looks ugly. It would be OK if the spacing between the dots were the same as that between the lines of the equals. But I use
newcommand{defeq}{stackrel{text{def}}{=}}
instead.
7
Whereas I think that the overset "def" is ugly (and illegible from any distance)! There's no accounting for taste ...
– Loop Space
Oct 18 '10 at 8:04
18
One advantage of := is that ir is bidirectional. := and =: mean different things. defeq and triangleeq loose that distinction.
– Aditya
Oct 18 '10 at 13:41
4
+1 for this. ":=" is programming jargon and, as Charles Stewart points out, misused programming jargon. Personally, I prefer newcommand{defeq}{stackrel{textup{tiny def}}{=}}. Then Andrew Stacey can't see it at all, and everyone's happy.
– Mephisto
Oct 19 '10 at 0:08
2
@Charles: thanks for matching my braces. @Aditya: I see your point of view, but I think bidirectional means the opposite of the way you're using it.
– Matthew Leingang
Oct 21 '10 at 1:08
2
@Matthew: I'd use yourdefeqto indicate that an equality holds by definition (i.e., by a definition stated earlier). I've posted another answer that changes the spacing of the dots.
– Hendrik Vogt
Nov 3 '10 at 16:49
|
show 2 more comments
I actually think that symbol looks ugly. It would be OK if the spacing between the dots were the same as that between the lines of the equals. But I use
newcommand{defeq}{stackrel{text{def}}{=}}
instead.
I actually think that symbol looks ugly. It would be OK if the spacing between the dots were the same as that between the lines of the equals. But I use
newcommand{defeq}{stackrel{text{def}}{=}}
instead.
edited Oct 18 '10 at 12:56
Charles Stewart
17.2k355110
17.2k355110
answered Oct 18 '10 at 4:14
Matthew LeingangMatthew Leingang
34.9k10106177
34.9k10106177
7
Whereas I think that the overset "def" is ugly (and illegible from any distance)! There's no accounting for taste ...
– Loop Space
Oct 18 '10 at 8:04
18
One advantage of := is that ir is bidirectional. := and =: mean different things. defeq and triangleeq loose that distinction.
– Aditya
Oct 18 '10 at 13:41
4
+1 for this. ":=" is programming jargon and, as Charles Stewart points out, misused programming jargon. Personally, I prefer newcommand{defeq}{stackrel{textup{tiny def}}{=}}. Then Andrew Stacey can't see it at all, and everyone's happy.
– Mephisto
Oct 19 '10 at 0:08
2
@Charles: thanks for matching my braces. @Aditya: I see your point of view, but I think bidirectional means the opposite of the way you're using it.
– Matthew Leingang
Oct 21 '10 at 1:08
2
@Matthew: I'd use yourdefeqto indicate that an equality holds by definition (i.e., by a definition stated earlier). I've posted another answer that changes the spacing of the dots.
– Hendrik Vogt
Nov 3 '10 at 16:49
|
show 2 more comments
7
Whereas I think that the overset "def" is ugly (and illegible from any distance)! There's no accounting for taste ...
– Loop Space
Oct 18 '10 at 8:04
18
One advantage of := is that ir is bidirectional. := and =: mean different things. defeq and triangleeq loose that distinction.
– Aditya
Oct 18 '10 at 13:41
4
+1 for this. ":=" is programming jargon and, as Charles Stewart points out, misused programming jargon. Personally, I prefer newcommand{defeq}{stackrel{textup{tiny def}}{=}}. Then Andrew Stacey can't see it at all, and everyone's happy.
– Mephisto
Oct 19 '10 at 0:08
2
@Charles: thanks for matching my braces. @Aditya: I see your point of view, but I think bidirectional means the opposite of the way you're using it.
– Matthew Leingang
Oct 21 '10 at 1:08
2
@Matthew: I'd use yourdefeqto indicate that an equality holds by definition (i.e., by a definition stated earlier). I've posted another answer that changes the spacing of the dots.
– Hendrik Vogt
Nov 3 '10 at 16:49
7
7
Whereas I think that the overset "def" is ugly (and illegible from any distance)! There's no accounting for taste ...
– Loop Space
Oct 18 '10 at 8:04
Whereas I think that the overset "def" is ugly (and illegible from any distance)! There's no accounting for taste ...
– Loop Space
Oct 18 '10 at 8:04
18
18
One advantage of := is that ir is bidirectional. := and =: mean different things. defeq and triangleeq loose that distinction.
– Aditya
Oct 18 '10 at 13:41
One advantage of := is that ir is bidirectional. := and =: mean different things. defeq and triangleeq loose that distinction.
– Aditya
Oct 18 '10 at 13:41
4
4
+1 for this. ":=" is programming jargon and, as Charles Stewart points out, misused programming jargon. Personally, I prefer newcommand{defeq}{stackrel{textup{tiny def}}{=}}. Then Andrew Stacey can't see it at all, and everyone's happy.
– Mephisto
Oct 19 '10 at 0:08
+1 for this. ":=" is programming jargon and, as Charles Stewart points out, misused programming jargon. Personally, I prefer newcommand{defeq}{stackrel{textup{tiny def}}{=}}. Then Andrew Stacey can't see it at all, and everyone's happy.
– Mephisto
Oct 19 '10 at 0:08
2
2
@Charles: thanks for matching my braces. @Aditya: I see your point of view, but I think bidirectional means the opposite of the way you're using it.
– Matthew Leingang
Oct 21 '10 at 1:08
@Charles: thanks for matching my braces. @Aditya: I see your point of view, but I think bidirectional means the opposite of the way you're using it.
– Matthew Leingang
Oct 21 '10 at 1:08
2
2
@Matthew: I'd use your
defeq to indicate that an equality holds by definition (i.e., by a definition stated earlier). I've posted another answer that changes the spacing of the dots.– Hendrik Vogt
Nov 3 '10 at 16:49
@Matthew: I'd use your
defeq to indicate that an equality holds by definition (i.e., by a definition stated earlier). I've posted another answer that changes the spacing of the dots.– Hendrik Vogt
Nov 3 '10 at 16:49
|
show 2 more comments
A way to get this with pxfonts without including the whole package:
DeclareSymbolFont{symbolsC}{U}{pxsyc}{m}{n}
DeclareMathSymbol{coloneqq}{mathrel}{symbolsC}{"42}
and you get:

add a comment |
A way to get this with pxfonts without including the whole package:
DeclareSymbolFont{symbolsC}{U}{pxsyc}{m}{n}
DeclareMathSymbol{coloneqq}{mathrel}{symbolsC}{"42}
and you get:

add a comment |
A way to get this with pxfonts without including the whole package:
DeclareSymbolFont{symbolsC}{U}{pxsyc}{m}{n}
DeclareMathSymbol{coloneqq}{mathrel}{symbolsC}{"42}
and you get:

A way to get this with pxfonts without including the whole package:
DeclareSymbolFont{symbolsC}{U}{pxsyc}{m}{n}
DeclareMathSymbol{coloneqq}{mathrel}{symbolsC}{"42}
and you get:

edited Mar 19 '12 at 22:25
diabonas
21.2k384130
21.2k384130
answered Oct 1 '11 at 11:57
einpoklumeinpoklum
4,81953578
4,81953578
add a comment |
add a comment |
My solution is
defdefeq{mathrel{mathop:}=}
This is not a good solution because you can have a line break between the : and the = (mathtoolshad this bug a while back, see groups.google.com/group/comp.text.tex/msg/…).
– Aditya
Nov 3 '10 at 17:54
6
@Aditya: something likemathrel{mathop:}=does not break between lines, but usingmathrel{mathop:}mkern-1.2mu=as inmathtoolsdoes introduce a breaking point at themkern(and can be solved by putting anobreakjust beforemkernor by wrapping everything in amathrel).
– Philippe Goutet
Dec 11 '10 at 23:24
add a comment |
My solution is
defdefeq{mathrel{mathop:}=}
This is not a good solution because you can have a line break between the : and the = (mathtoolshad this bug a while back, see groups.google.com/group/comp.text.tex/msg/…).
– Aditya
Nov 3 '10 at 17:54
6
@Aditya: something likemathrel{mathop:}=does not break between lines, but usingmathrel{mathop:}mkern-1.2mu=as inmathtoolsdoes introduce a breaking point at themkern(and can be solved by putting anobreakjust beforemkernor by wrapping everything in amathrel).
– Philippe Goutet
Dec 11 '10 at 23:24
add a comment |
My solution is
defdefeq{mathrel{mathop:}=}
My solution is
defdefeq{mathrel{mathop:}=}
edited Dec 12 '10 at 20:45
Matthew Leingang
34.9k10106177
34.9k10106177
answered Oct 20 '10 at 2:51
Daniel MoskovichDaniel Moskovich
321138
321138
This is not a good solution because you can have a line break between the : and the = (mathtoolshad this bug a while back, see groups.google.com/group/comp.text.tex/msg/…).
– Aditya
Nov 3 '10 at 17:54
6
@Aditya: something likemathrel{mathop:}=does not break between lines, but usingmathrel{mathop:}mkern-1.2mu=as inmathtoolsdoes introduce a breaking point at themkern(and can be solved by putting anobreakjust beforemkernor by wrapping everything in amathrel).
– Philippe Goutet
Dec 11 '10 at 23:24
add a comment |
This is not a good solution because you can have a line break between the : and the = (mathtoolshad this bug a while back, see groups.google.com/group/comp.text.tex/msg/…).
– Aditya
Nov 3 '10 at 17:54
6
@Aditya: something likemathrel{mathop:}=does not break between lines, but usingmathrel{mathop:}mkern-1.2mu=as inmathtoolsdoes introduce a breaking point at themkern(and can be solved by putting anobreakjust beforemkernor by wrapping everything in amathrel).
– Philippe Goutet
Dec 11 '10 at 23:24
This is not a good solution because you can have a line break between the : and the = (
mathtools had this bug a while back, see groups.google.com/group/comp.text.tex/msg/…).– Aditya
Nov 3 '10 at 17:54
This is not a good solution because you can have a line break between the : and the = (
mathtools had this bug a while back, see groups.google.com/group/comp.text.tex/msg/…).– Aditya
Nov 3 '10 at 17:54
6
6
@Aditya: something like
mathrel{mathop:}= does not break between lines, but using mathrel{mathop:}mkern-1.2mu= as in mathtools does introduce a breaking point at the mkern (and can be solved by putting a nobreak just before mkern or by wrapping everything in a mathrel).– Philippe Goutet
Dec 11 '10 at 23:24
@Aditya: something like
mathrel{mathop:}= does not break between lines, but using mathrel{mathop:}mkern-1.2mu= as in mathtools does introduce a breaking point at the mkern (and can be solved by putting a nobreak just before mkern or by wrapping everything in a mathrel).– Philippe Goutet
Dec 11 '10 at 23:24
add a comment |
I tried quite some of the solutions given here but none of those seemed satisfactory to me. Most of them only solve the problem of the vertical alignment of the colon but do not respect the length of all the other binary relations, that is ":=" is much longer than "=" and the like.
My suggestion hence is the following:
newcommand{eqcolon}{mathrel{resizebox{widthof{$mathord{=}$}}{height}{ $!!=!!resizebox{1.2width}{0.8height}{raisebox{0.23ex}{$mathop{:}$}}!!$ }}}
newcommand{coloneq}{mathrel{resizebox{widthof{$mathord{=}$}}{height}{ $!!resizebox{1.2width}{0.8height}{raisebox{0.23ex}{$mathop{:}$}}!!=!!$ }}}
This will result in ":=" beeing equally long as "=" so it will align properly in multiline math equations. Below is a comparisson of the approach newcommand{eqcolon}{ensuremath{mathrel{=!!mathop{:}}}} with my suggestion. Note how the lines align properly in amsmath align environments.
Before:

After:

Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Martin Schröder
Oct 28 '15 at 14:47
This looks like an answer to a slightly different question...
– Martin Schröder
Oct 28 '15 at 14:48
2
@MartinSchröder Why is that? I had the same problem to typeset $:=$ for "defined as". I use this sometimes to define auxillary variables that I only use locally. I just wanted to share my result as I was not satisfied with the typographic quality of other solutions here and in similar questions (e.g. Typesetting the “define equals” symbol).
– jenom
Oct 28 '15 at 15:24
add a comment |
I tried quite some of the solutions given here but none of those seemed satisfactory to me. Most of them only solve the problem of the vertical alignment of the colon but do not respect the length of all the other binary relations, that is ":=" is much longer than "=" and the like.
My suggestion hence is the following:
newcommand{eqcolon}{mathrel{resizebox{widthof{$mathord{=}$}}{height}{ $!!=!!resizebox{1.2width}{0.8height}{raisebox{0.23ex}{$mathop{:}$}}!!$ }}}
newcommand{coloneq}{mathrel{resizebox{widthof{$mathord{=}$}}{height}{ $!!resizebox{1.2width}{0.8height}{raisebox{0.23ex}{$mathop{:}$}}!!=!!$ }}}
This will result in ":=" beeing equally long as "=" so it will align properly in multiline math equations. Below is a comparisson of the approach newcommand{eqcolon}{ensuremath{mathrel{=!!mathop{:}}}} with my suggestion. Note how the lines align properly in amsmath align environments.
Before:

After:

Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Martin Schröder
Oct 28 '15 at 14:47
This looks like an answer to a slightly different question...
– Martin Schröder
Oct 28 '15 at 14:48
2
@MartinSchröder Why is that? I had the same problem to typeset $:=$ for "defined as". I use this sometimes to define auxillary variables that I only use locally. I just wanted to share my result as I was not satisfied with the typographic quality of other solutions here and in similar questions (e.g. Typesetting the “define equals” symbol).
– jenom
Oct 28 '15 at 15:24
add a comment |
I tried quite some of the solutions given here but none of those seemed satisfactory to me. Most of them only solve the problem of the vertical alignment of the colon but do not respect the length of all the other binary relations, that is ":=" is much longer than "=" and the like.
My suggestion hence is the following:
newcommand{eqcolon}{mathrel{resizebox{widthof{$mathord{=}$}}{height}{ $!!=!!resizebox{1.2width}{0.8height}{raisebox{0.23ex}{$mathop{:}$}}!!$ }}}
newcommand{coloneq}{mathrel{resizebox{widthof{$mathord{=}$}}{height}{ $!!resizebox{1.2width}{0.8height}{raisebox{0.23ex}{$mathop{:}$}}!!=!!$ }}}
This will result in ":=" beeing equally long as "=" so it will align properly in multiline math equations. Below is a comparisson of the approach newcommand{eqcolon}{ensuremath{mathrel{=!!mathop{:}}}} with my suggestion. Note how the lines align properly in amsmath align environments.
Before:

After:

I tried quite some of the solutions given here but none of those seemed satisfactory to me. Most of them only solve the problem of the vertical alignment of the colon but do not respect the length of all the other binary relations, that is ":=" is much longer than "=" and the like.
My suggestion hence is the following:
newcommand{eqcolon}{mathrel{resizebox{widthof{$mathord{=}$}}{height}{ $!!=!!resizebox{1.2width}{0.8height}{raisebox{0.23ex}{$mathop{:}$}}!!$ }}}
newcommand{coloneq}{mathrel{resizebox{widthof{$mathord{=}$}}{height}{ $!!resizebox{1.2width}{0.8height}{raisebox{0.23ex}{$mathop{:}$}}!!=!!$ }}}
This will result in ":=" beeing equally long as "=" so it will align properly in multiline math equations. Below is a comparisson of the approach newcommand{eqcolon}{ensuremath{mathrel{=!!mathop{:}}}} with my suggestion. Note how the lines align properly in amsmath align environments.
Before:

After:

answered Oct 28 '15 at 14:12
jenomjenom
5112
5112
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Martin Schröder
Oct 28 '15 at 14:47
This looks like an answer to a slightly different question...
– Martin Schröder
Oct 28 '15 at 14:48
2
@MartinSchröder Why is that? I had the same problem to typeset $:=$ for "defined as". I use this sometimes to define auxillary variables that I only use locally. I just wanted to share my result as I was not satisfied with the typographic quality of other solutions here and in similar questions (e.g. Typesetting the “define equals” symbol).
– jenom
Oct 28 '15 at 15:24
add a comment |
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Martin Schröder
Oct 28 '15 at 14:47
This looks like an answer to a slightly different question...
– Martin Schröder
Oct 28 '15 at 14:48
2
@MartinSchröder Why is that? I had the same problem to typeset $:=$ for "defined as". I use this sometimes to define auxillary variables that I only use locally. I just wanted to share my result as I was not satisfied with the typographic quality of other solutions here and in similar questions (e.g. Typesetting the “define equals” symbol).
– jenom
Oct 28 '15 at 15:24
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Martin Schröder
Oct 28 '15 at 14:47
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
– Martin Schröder
Oct 28 '15 at 14:47
This looks like an answer to a slightly different question...
– Martin Schröder
Oct 28 '15 at 14:48
This looks like an answer to a slightly different question...
– Martin Schröder
Oct 28 '15 at 14:48
2
2
@MartinSchröder Why is that? I had the same problem to typeset $:=$ for "defined as". I use this sometimes to define auxillary variables that I only use locally. I just wanted to share my result as I was not satisfied with the typographic quality of other solutions here and in similar questions (e.g. Typesetting the “define equals” symbol).
– jenom
Oct 28 '15 at 15:24
@MartinSchröder Why is that? I had the same problem to typeset $:=$ for "defined as". I use this sometimes to define auxillary variables that I only use locally. I just wanted to share my result as I was not satisfied with the typographic quality of other solutions here and in similar questions (e.g. Typesetting the “define equals” symbol).
– jenom
Oct 28 '15 at 15:24
add a comment |
I use vcentcolon= from the mathtools package. I like it better than coloneqq because with the former, there is more spacing between the colon and the equals sign.

add a comment |
I use vcentcolon= from the mathtools package. I like it better than coloneqq because with the former, there is more spacing between the colon and the equals sign.

add a comment |
I use vcentcolon= from the mathtools package. I like it better than coloneqq because with the former, there is more spacing between the colon and the equals sign.

I use vcentcolon= from the mathtools package. I like it better than coloneqq because with the former, there is more spacing between the colon and the equals sign.

answered Jun 12 '18 at 11:19
Ingo BlechschmidtIngo Blechschmidt
1212
1212
add a comment |
add a comment |
You may try coloneq (as well as eqcolon) from unicode-math package:

Note that unicode-math requires XeLaTeX/LuaLaTeX.
add a comment |
You may try coloneq (as well as eqcolon) from unicode-math package:

Note that unicode-math requires XeLaTeX/LuaLaTeX.
add a comment |
You may try coloneq (as well as eqcolon) from unicode-math package:

Note that unicode-math requires XeLaTeX/LuaLaTeX.
You may try coloneq (as well as eqcolon) from unicode-math package:

Note that unicode-math requires XeLaTeX/LuaLaTeX.
answered Jan 13 at 8:29
Stone-ZengStone-Zeng
1,225417
1,225417
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%2f4216%2fhow-to-typeset-correctly%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
3
":=" is usually meant to be a quite different concept, namely imperative assignment.
– Charles Stewart
Oct 18 '10 at 12:58
36
@Charles: I've seen it used for both. Pure mathematicians, who have little use for imperative assignment, I think tend to use it more for definitional equality.
– Antal Spector-Zabusky
Nov 3 '10 at 19:34
6
Oh yes, they do, all the time.
– Hendrik Vogt
Nov 4 '10 at 7:26
8
@Charles: I don't think it's any sloppier than, say, an algebraist writing H < G for "H is a subgroup of G". Sure, we think of < as meaning numerically less than, but there's no ambiguity in the context. And there's a related meaning in both cases: both uses of < give rise to a poset, and both uses of := mark some "special" form of equality. And since most mathematicians have no use for the imperative :=, there's no confusion. Just my 2¢. (Personally, I'm not particularly fond of either usage of :=, preferring "we define x to be …" or "x = …" for the one and "var ← value" for the other.)
– Antal Spector-Zabusky
Nov 4 '10 at 10:28
5
@user, you were misinformed. The symbol goes much further back, to APL and the Pascal family of languages. It's meant to resemble APL's left-pointing arrow, which is of course not part of ASCII. That's why people associate it with "imperative assignment" in the discussion.
– alexis
Apr 18 '13 at 10:17