Getting errors while trying to box a colored text + math with less than 6 lines of code
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
First time Latex user here
I am trying to box a text plus math using the following code
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
begindocument
sectionSection Title
fbox
colorblue This is a text [x]
boxed
colorblue This is a text [x]
enddocument
Unfortunately, in doing so, I received 10 errors.
Can anyone help me debug these mere 6 lines of code?
boxes tcolorbox box
New contributor
The man of your dream is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
2
down vote
favorite
First time Latex user here
I am trying to box a text plus math using the following code
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
begindocument
sectionSection Title
fbox
colorblue This is a text [x]
boxed
colorblue This is a text [x]
enddocument
Unfortunately, in doing so, I received 10 errors.
Can anyone help me debug these mere 6 lines of code?
boxes tcolorbox box
New contributor
The man of your dream is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
First time Latex user here
I am trying to box a text plus math using the following code
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
begindocument
sectionSection Title
fbox
colorblue This is a text [x]
boxed
colorblue This is a text [x]
enddocument
Unfortunately, in doing so, I received 10 errors.
Can anyone help me debug these mere 6 lines of code?
boxes tcolorbox box
New contributor
The man of your dream is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
First time Latex user here
I am trying to box a text plus math using the following code
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
begindocument
sectionSection Title
fbox
colorblue This is a text [x]
boxed
colorblue This is a text [x]
enddocument
Unfortunately, in doing so, I received 10 errors.
Can anyone help me debug these mere 6 lines of code?
boxes tcolorbox box
boxes tcolorbox box
New contributor
The man of your dream is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
The man of your dream is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
The man of your dream is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 3 hours ago


The man of your dream
112
112
New contributor
The man of your dream is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
The man of your dream is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
The man of your dream is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
Welcome to TeX.SX! The easiest way to do this is by using the framed
package:
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
usepackageframed
begindocument
sectionSection Title
beginframed
colorblueThis is a text [x]
endframed
enddocument
You mentioned tcolorbox
in one of your tags, so here is an alternative using the tcolorbox
package:
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
usepackagetcolorbox
begindocument
sectionSection Title
begintcolorbox
colorblueThis is a text [x]
endtcolorbox
enddocument
add a comment |Â
up vote
1
down vote
fbox
is an hbox
(LR-mode in the LaTeX book) which does not allow line breaks, and [
is (after error checking) $$
so you end up (if you scroll past errors) with
hbox text $$x$$
In in restricted hmode $$
at the primitive level so this is just the same as two $
so it is
hbox text $ empty math $ x $ empty math $
so as always to get multi-line text into a single-line context you can use a parbox
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
begindocument
sectionSection Title
noindentfboxparboxdimexprtextwidth-2fboxsep-2fboxrule%
textcolorblueThis is a text [x]%
enddocument
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
Welcome to TeX.SX! The easiest way to do this is by using the framed
package:
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
usepackageframed
begindocument
sectionSection Title
beginframed
colorblueThis is a text [x]
endframed
enddocument
You mentioned tcolorbox
in one of your tags, so here is an alternative using the tcolorbox
package:
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
usepackagetcolorbox
begindocument
sectionSection Title
begintcolorbox
colorblueThis is a text [x]
endtcolorbox
enddocument
add a comment |Â
up vote
2
down vote
Welcome to TeX.SX! The easiest way to do this is by using the framed
package:
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
usepackageframed
begindocument
sectionSection Title
beginframed
colorblueThis is a text [x]
endframed
enddocument
You mentioned tcolorbox
in one of your tags, so here is an alternative using the tcolorbox
package:
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
usepackagetcolorbox
begindocument
sectionSection Title
begintcolorbox
colorblueThis is a text [x]
endtcolorbox
enddocument
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Welcome to TeX.SX! The easiest way to do this is by using the framed
package:
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
usepackageframed
begindocument
sectionSection Title
beginframed
colorblueThis is a text [x]
endframed
enddocument
You mentioned tcolorbox
in one of your tags, so here is an alternative using the tcolorbox
package:
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
usepackagetcolorbox
begindocument
sectionSection Title
begintcolorbox
colorblueThis is a text [x]
endtcolorbox
enddocument
Welcome to TeX.SX! The easiest way to do this is by using the framed
package:
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
usepackageframed
begindocument
sectionSection Title
beginframed
colorblueThis is a text [x]
endframed
enddocument
You mentioned tcolorbox
in one of your tags, so here is an alternative using the tcolorbox
package:
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
usepackagetcolorbox
begindocument
sectionSection Title
begintcolorbox
colorblueThis is a text [x]
endtcolorbox
enddocument
edited 3 hours ago
answered 3 hours ago
Ruixi Zhang
4,101318
4,101318
add a comment |Â
add a comment |Â
up vote
1
down vote
fbox
is an hbox
(LR-mode in the LaTeX book) which does not allow line breaks, and [
is (after error checking) $$
so you end up (if you scroll past errors) with
hbox text $$x$$
In in restricted hmode $$
at the primitive level so this is just the same as two $
so it is
hbox text $ empty math $ x $ empty math $
so as always to get multi-line text into a single-line context you can use a parbox
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
begindocument
sectionSection Title
noindentfboxparboxdimexprtextwidth-2fboxsep-2fboxrule%
textcolorblueThis is a text [x]%
enddocument
add a comment |Â
up vote
1
down vote
fbox
is an hbox
(LR-mode in the LaTeX book) which does not allow line breaks, and [
is (after error checking) $$
so you end up (if you scroll past errors) with
hbox text $$x$$
In in restricted hmode $$
at the primitive level so this is just the same as two $
so it is
hbox text $ empty math $ x $ empty math $
so as always to get multi-line text into a single-line context you can use a parbox
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
begindocument
sectionSection Title
noindentfboxparboxdimexprtextwidth-2fboxsep-2fboxrule%
textcolorblueThis is a text [x]%
enddocument
add a comment |Â
up vote
1
down vote
up vote
1
down vote
fbox
is an hbox
(LR-mode in the LaTeX book) which does not allow line breaks, and [
is (after error checking) $$
so you end up (if you scroll past errors) with
hbox text $$x$$
In in restricted hmode $$
at the primitive level so this is just the same as two $
so it is
hbox text $ empty math $ x $ empty math $
so as always to get multi-line text into a single-line context you can use a parbox
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
begindocument
sectionSection Title
noindentfboxparboxdimexprtextwidth-2fboxsep-2fboxrule%
textcolorblueThis is a text [x]%
enddocument
fbox
is an hbox
(LR-mode in the LaTeX book) which does not allow line breaks, and [
is (after error checking) $$
so you end up (if you scroll past errors) with
hbox text $$x$$
In in restricted hmode $$
at the primitive level so this is just the same as two $
so it is
hbox text $ empty math $ x $ empty math $
so as always to get multi-line text into a single-line context you can use a parbox
documentclassarticle
usepackageamsmath
usepackageamsfonts
usepackagexcolor
begindocument
sectionSection Title
noindentfboxparboxdimexprtextwidth-2fboxsep-2fboxrule%
textcolorblueThis is a text [x]%
enddocument
answered 40 mins ago
David Carlisle
469k3810981823
469k3810981823
add a comment |Â
add a comment |Â
The man of your dream is a new contributor. Be nice, and check out our Code of Conduct.
The man of your dream is a new contributor. Be nice, and check out our Code of Conduct.
The man of your dream is a new contributor. Be nice, and check out our Code of Conduct.
The man of your dream is a new contributor. Be nice, and check out our Code of Conduct.
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f453269%2fgetting-errors-while-trying-to-box-a-colored-text-math-with-less-than-6-lines%23new-answer', 'question_page');
);
Post as a guest
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
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
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