What is the difference between textcolor and color?
I would like to define a new command to work as an alert command. If I want to alert some part of my text I would simply write alert{}
. But I want the result in red color.
What is the best way to do this? I tried
defalert#1{{color{red}{#1}}}
but I know that there is textcolor
also. I want my command to work both for text and math contents.
What is the difference between them?
color
add a comment |
I would like to define a new command to work as an alert command. If I want to alert some part of my text I would simply write alert{}
. But I want the result in red color.
What is the best way to do this? I tried
defalert#1{{color{red}{#1}}}
but I know that there is textcolor
also. I want my command to work both for text and math contents.
What is the difference between them?
color
add a comment |
I would like to define a new command to work as an alert command. If I want to alert some part of my text I would simply write alert{}
. But I want the result in red color.
What is the best way to do this? I tried
defalert#1{{color{red}{#1}}}
but I know that there is textcolor
also. I want my command to work both for text and math contents.
What is the difference between them?
color
I would like to define a new command to work as an alert command. If I want to alert some part of my text I would simply write alert{}
. But I want the result in red color.
What is the best way to do this? I tried
defalert#1{{color{red}{#1}}}
but I know that there is textcolor
also. I want my command to work both for text and math contents.
What is the difference between them?
color
color
asked Dec 8 '12 at 0:25
SigurSigur
25.8k457140
25.8k457140
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Despite the name textcolor
also works in math mode. The main difference is just one of syntax, textcolor
takes text as an argument (like textrm
) color
affects all text to the end of the group (like rmfamily
). However textcolor
also executes leavevmode
which makes the color special occur in a much less destructive place as part of the paragraph rather than on a vertical list. So textcolor
is usually a better choice unless you are setting a colour for a large amount of text, such as the whole document.
Thanks. I noticed thatcolor
package is required. Is there some color commands which needs only basic packages?
– Sigur
Dec 8 '12 at 0:38
6
There is basic underlying support for colour in the latex format but no actual top level colour commands. color is part of the required latex distribution so it is as basic as say article.cls
– David Carlisle
Dec 8 '12 at 0:39
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%2f86039%2fwhat-is-the-difference-between-textcolor-and-color%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Despite the name textcolor
also works in math mode. The main difference is just one of syntax, textcolor
takes text as an argument (like textrm
) color
affects all text to the end of the group (like rmfamily
). However textcolor
also executes leavevmode
which makes the color special occur in a much less destructive place as part of the paragraph rather than on a vertical list. So textcolor
is usually a better choice unless you are setting a colour for a large amount of text, such as the whole document.
Thanks. I noticed thatcolor
package is required. Is there some color commands which needs only basic packages?
– Sigur
Dec 8 '12 at 0:38
6
There is basic underlying support for colour in the latex format but no actual top level colour commands. color is part of the required latex distribution so it is as basic as say article.cls
– David Carlisle
Dec 8 '12 at 0:39
add a comment |
Despite the name textcolor
also works in math mode. The main difference is just one of syntax, textcolor
takes text as an argument (like textrm
) color
affects all text to the end of the group (like rmfamily
). However textcolor
also executes leavevmode
which makes the color special occur in a much less destructive place as part of the paragraph rather than on a vertical list. So textcolor
is usually a better choice unless you are setting a colour for a large amount of text, such as the whole document.
Thanks. I noticed thatcolor
package is required. Is there some color commands which needs only basic packages?
– Sigur
Dec 8 '12 at 0:38
6
There is basic underlying support for colour in the latex format but no actual top level colour commands. color is part of the required latex distribution so it is as basic as say article.cls
– David Carlisle
Dec 8 '12 at 0:39
add a comment |
Despite the name textcolor
also works in math mode. The main difference is just one of syntax, textcolor
takes text as an argument (like textrm
) color
affects all text to the end of the group (like rmfamily
). However textcolor
also executes leavevmode
which makes the color special occur in a much less destructive place as part of the paragraph rather than on a vertical list. So textcolor
is usually a better choice unless you are setting a colour for a large amount of text, such as the whole document.
Despite the name textcolor
also works in math mode. The main difference is just one of syntax, textcolor
takes text as an argument (like textrm
) color
affects all text to the end of the group (like rmfamily
). However textcolor
also executes leavevmode
which makes the color special occur in a much less destructive place as part of the paragraph rather than on a vertical list. So textcolor
is usually a better choice unless you are setting a colour for a large amount of text, such as the whole document.
answered Dec 8 '12 at 0:32
David CarlisleDavid Carlisle
494k4111371885
494k4111371885
Thanks. I noticed thatcolor
package is required. Is there some color commands which needs only basic packages?
– Sigur
Dec 8 '12 at 0:38
6
There is basic underlying support for colour in the latex format but no actual top level colour commands. color is part of the required latex distribution so it is as basic as say article.cls
– David Carlisle
Dec 8 '12 at 0:39
add a comment |
Thanks. I noticed thatcolor
package is required. Is there some color commands which needs only basic packages?
– Sigur
Dec 8 '12 at 0:38
6
There is basic underlying support for colour in the latex format but no actual top level colour commands. color is part of the required latex distribution so it is as basic as say article.cls
– David Carlisle
Dec 8 '12 at 0:39
Thanks. I noticed that
color
package is required. Is there some color commands which needs only basic packages?– Sigur
Dec 8 '12 at 0:38
Thanks. I noticed that
color
package is required. Is there some color commands which needs only basic packages?– Sigur
Dec 8 '12 at 0:38
6
6
There is basic underlying support for colour in the latex format but no actual top level colour commands. color is part of the required latex distribution so it is as basic as say article.cls
– David Carlisle
Dec 8 '12 at 0:39
There is basic underlying support for colour in the latex format but no actual top level colour commands. color is part of the required latex distribution so it is as basic as say article.cls
– David Carlisle
Dec 8 '12 at 0:39
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%2f86039%2fwhat-is-the-difference-between-textcolor-and-color%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