How to write mathematics with boxes?
I want to write the mathematics inside the box as written below.
See my code given below:
documentclass{article}
begin{document}
\fbox{text}
framebox[width][pos]{text}
makebox[textwidth]{X_1 X_2} par
makebox[textwidth]{X_3 X_4} par
cdots
makebox[textwidth]{X_4 X_6} par
end{document}
Question: I want to write the above maths, How to write it properly?
boxes
add a comment |
I want to write the mathematics inside the box as written below.
See my code given below:
documentclass{article}
begin{document}
\fbox{text}
framebox[width][pos]{text}
makebox[textwidth]{X_1 X_2} par
makebox[textwidth]{X_3 X_4} par
cdots
makebox[textwidth]{X_4 X_6} par
end{document}
Question: I want to write the above maths, How to write it properly?
boxes
add a comment |
I want to write the mathematics inside the box as written below.
See my code given below:
documentclass{article}
begin{document}
\fbox{text}
framebox[width][pos]{text}
makebox[textwidth]{X_1 X_2} par
makebox[textwidth]{X_3 X_4} par
cdots
makebox[textwidth]{X_4 X_6} par
end{document}
Question: I want to write the above maths, How to write it properly?
boxes
I want to write the mathematics inside the box as written below.
See my code given below:
documentclass{article}
begin{document}
\fbox{text}
framebox[width][pos]{text}
makebox[textwidth]{X_1 X_2} par
makebox[textwidth]{X_3 X_4} par
cdots
makebox[textwidth]{X_4 X_6} par
end{document}
Question: I want to write the above maths, How to write it properly?
boxes
boxes
edited 1 hour ago
marmot
95.7k4110210
95.7k4110210
asked 1 hour ago
Isla_BonitaIsla_Bonita
20215
20215
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You can use boxed
command from amsmath
package
documentclass{article}
usepackage{amsmath}
begin{document}
begin{equation*}
X=boxed{X_1 X_2}quad boxed{X_3 X_4}cdotsboxed{X_5 X_6}
end{equation*}
end{document}
To add labels below boxes
documentclass{article}
usepackage{amsmath,tcolorbox}
tcbuselibrary{theorems,skins}
usetikzlibrary{arrows.meta}
newlengthmylabelshift
setlengthmylabelshift{3mm} % to be adjusted if needed
newcommand{drawlabel}[1]{draw[Stealth-Stealth]([yshift=-mylabelshift]frame.south west)--node[fill=white]{(#1)}([yshift=-mylabelshift]frame.south east);}
newtcbox{mymathbox}[1][l]{
enhanced,
nobeforeafter,
math upper,
tcbox raise base,
colback=blue!30,
size=small,
geometry nodes,
overlay={drawlabel{#1}}
}
begin{document}
begin{equation*}
X=mymathbox{X_1 X_2}quad mymathbox{X_3 X_4}cdotsmymathbox{X_5 X_6}
end{equation*}
vspace{1cm}
begin{equation*}
X=mymathbox[a]{X_1 X_2}quad mymathbox[b]{X_3 X_4}cdotsmymathbox[c]{X_5 X_6}
end{equation*}
end{document}
1
@Isla_Bonita I have updated my answer.
– Hafid Boukhoulda
12 mins ago
I would like to change the color of each box
– Isla_Bonita
8 mins ago
One problem is I have added three symbol in the second box. It is getting bigger. Is it possible to fix the size of each of the box irrespective of the text entered.
– Isla_Bonita
6 mins ago
I think you misunderstood me, I mean to say in the second box put three symbols and then see
– Isla_Bonita
3 mins ago
add a comment |
Depends on how fancy you want to go. In principle you do not need any packages for that.
documentclass{article}
begin{document}
[
X=
raisebox{-1.5ex}{$begin{array}{c}
hline
multicolumn{1}{|c|}{X_1 X_2}\
hline
leftarrowellrightarrow\
end{array}$}~
raisebox{-1.5ex}{$begin{array}{c}
hline
multicolumn{1}{|c|}{X_3 X_4}\
hline
leftarrowellrightarrow\
end{array}$}cdots
raisebox{-1.5ex}{$begin{array}{c}
hline
multicolumn{1}{|c|}{X_5 X_6}\
hline
leftarrowellrightarrow\
end{array}$}
]
end{document}
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%2f472679%2fhow-to-write-mathematics-with-boxes%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
You can use boxed
command from amsmath
package
documentclass{article}
usepackage{amsmath}
begin{document}
begin{equation*}
X=boxed{X_1 X_2}quad boxed{X_3 X_4}cdotsboxed{X_5 X_6}
end{equation*}
end{document}
To add labels below boxes
documentclass{article}
usepackage{amsmath,tcolorbox}
tcbuselibrary{theorems,skins}
usetikzlibrary{arrows.meta}
newlengthmylabelshift
setlengthmylabelshift{3mm} % to be adjusted if needed
newcommand{drawlabel}[1]{draw[Stealth-Stealth]([yshift=-mylabelshift]frame.south west)--node[fill=white]{(#1)}([yshift=-mylabelshift]frame.south east);}
newtcbox{mymathbox}[1][l]{
enhanced,
nobeforeafter,
math upper,
tcbox raise base,
colback=blue!30,
size=small,
geometry nodes,
overlay={drawlabel{#1}}
}
begin{document}
begin{equation*}
X=mymathbox{X_1 X_2}quad mymathbox{X_3 X_4}cdotsmymathbox{X_5 X_6}
end{equation*}
vspace{1cm}
begin{equation*}
X=mymathbox[a]{X_1 X_2}quad mymathbox[b]{X_3 X_4}cdotsmymathbox[c]{X_5 X_6}
end{equation*}
end{document}
1
@Isla_Bonita I have updated my answer.
– Hafid Boukhoulda
12 mins ago
I would like to change the color of each box
– Isla_Bonita
8 mins ago
One problem is I have added three symbol in the second box. It is getting bigger. Is it possible to fix the size of each of the box irrespective of the text entered.
– Isla_Bonita
6 mins ago
I think you misunderstood me, I mean to say in the second box put three symbols and then see
– Isla_Bonita
3 mins ago
add a comment |
You can use boxed
command from amsmath
package
documentclass{article}
usepackage{amsmath}
begin{document}
begin{equation*}
X=boxed{X_1 X_2}quad boxed{X_3 X_4}cdotsboxed{X_5 X_6}
end{equation*}
end{document}
To add labels below boxes
documentclass{article}
usepackage{amsmath,tcolorbox}
tcbuselibrary{theorems,skins}
usetikzlibrary{arrows.meta}
newlengthmylabelshift
setlengthmylabelshift{3mm} % to be adjusted if needed
newcommand{drawlabel}[1]{draw[Stealth-Stealth]([yshift=-mylabelshift]frame.south west)--node[fill=white]{(#1)}([yshift=-mylabelshift]frame.south east);}
newtcbox{mymathbox}[1][l]{
enhanced,
nobeforeafter,
math upper,
tcbox raise base,
colback=blue!30,
size=small,
geometry nodes,
overlay={drawlabel{#1}}
}
begin{document}
begin{equation*}
X=mymathbox{X_1 X_2}quad mymathbox{X_3 X_4}cdotsmymathbox{X_5 X_6}
end{equation*}
vspace{1cm}
begin{equation*}
X=mymathbox[a]{X_1 X_2}quad mymathbox[b]{X_3 X_4}cdotsmymathbox[c]{X_5 X_6}
end{equation*}
end{document}
1
@Isla_Bonita I have updated my answer.
– Hafid Boukhoulda
12 mins ago
I would like to change the color of each box
– Isla_Bonita
8 mins ago
One problem is I have added three symbol in the second box. It is getting bigger. Is it possible to fix the size of each of the box irrespective of the text entered.
– Isla_Bonita
6 mins ago
I think you misunderstood me, I mean to say in the second box put three symbols and then see
– Isla_Bonita
3 mins ago
add a comment |
You can use boxed
command from amsmath
package
documentclass{article}
usepackage{amsmath}
begin{document}
begin{equation*}
X=boxed{X_1 X_2}quad boxed{X_3 X_4}cdotsboxed{X_5 X_6}
end{equation*}
end{document}
To add labels below boxes
documentclass{article}
usepackage{amsmath,tcolorbox}
tcbuselibrary{theorems,skins}
usetikzlibrary{arrows.meta}
newlengthmylabelshift
setlengthmylabelshift{3mm} % to be adjusted if needed
newcommand{drawlabel}[1]{draw[Stealth-Stealth]([yshift=-mylabelshift]frame.south west)--node[fill=white]{(#1)}([yshift=-mylabelshift]frame.south east);}
newtcbox{mymathbox}[1][l]{
enhanced,
nobeforeafter,
math upper,
tcbox raise base,
colback=blue!30,
size=small,
geometry nodes,
overlay={drawlabel{#1}}
}
begin{document}
begin{equation*}
X=mymathbox{X_1 X_2}quad mymathbox{X_3 X_4}cdotsmymathbox{X_5 X_6}
end{equation*}
vspace{1cm}
begin{equation*}
X=mymathbox[a]{X_1 X_2}quad mymathbox[b]{X_3 X_4}cdotsmymathbox[c]{X_5 X_6}
end{equation*}
end{document}
You can use boxed
command from amsmath
package
documentclass{article}
usepackage{amsmath}
begin{document}
begin{equation*}
X=boxed{X_1 X_2}quad boxed{X_3 X_4}cdotsboxed{X_5 X_6}
end{equation*}
end{document}
To add labels below boxes
documentclass{article}
usepackage{amsmath,tcolorbox}
tcbuselibrary{theorems,skins}
usetikzlibrary{arrows.meta}
newlengthmylabelshift
setlengthmylabelshift{3mm} % to be adjusted if needed
newcommand{drawlabel}[1]{draw[Stealth-Stealth]([yshift=-mylabelshift]frame.south west)--node[fill=white]{(#1)}([yshift=-mylabelshift]frame.south east);}
newtcbox{mymathbox}[1][l]{
enhanced,
nobeforeafter,
math upper,
tcbox raise base,
colback=blue!30,
size=small,
geometry nodes,
overlay={drawlabel{#1}}
}
begin{document}
begin{equation*}
X=mymathbox{X_1 X_2}quad mymathbox{X_3 X_4}cdotsmymathbox{X_5 X_6}
end{equation*}
vspace{1cm}
begin{equation*}
X=mymathbox[a]{X_1 X_2}quad mymathbox[b]{X_3 X_4}cdotsmymathbox[c]{X_5 X_6}
end{equation*}
end{document}
edited 4 mins ago
answered 1 hour ago
Hafid BoukhouldaHafid Boukhoulda
2,7271519
2,7271519
1
@Isla_Bonita I have updated my answer.
– Hafid Boukhoulda
12 mins ago
I would like to change the color of each box
– Isla_Bonita
8 mins ago
One problem is I have added three symbol in the second box. It is getting bigger. Is it possible to fix the size of each of the box irrespective of the text entered.
– Isla_Bonita
6 mins ago
I think you misunderstood me, I mean to say in the second box put three symbols and then see
– Isla_Bonita
3 mins ago
add a comment |
1
@Isla_Bonita I have updated my answer.
– Hafid Boukhoulda
12 mins ago
I would like to change the color of each box
– Isla_Bonita
8 mins ago
One problem is I have added three symbol in the second box. It is getting bigger. Is it possible to fix the size of each of the box irrespective of the text entered.
– Isla_Bonita
6 mins ago
I think you misunderstood me, I mean to say in the second box put three symbols and then see
– Isla_Bonita
3 mins ago
1
1
@Isla_Bonita I have updated my answer.
– Hafid Boukhoulda
12 mins ago
@Isla_Bonita I have updated my answer.
– Hafid Boukhoulda
12 mins ago
I would like to change the color of each box
– Isla_Bonita
8 mins ago
I would like to change the color of each box
– Isla_Bonita
8 mins ago
One problem is I have added three symbol in the second box. It is getting bigger. Is it possible to fix the size of each of the box irrespective of the text entered.
– Isla_Bonita
6 mins ago
One problem is I have added three symbol in the second box. It is getting bigger. Is it possible to fix the size of each of the box irrespective of the text entered.
– Isla_Bonita
6 mins ago
I think you misunderstood me, I mean to say in the second box put three symbols and then see
– Isla_Bonita
3 mins ago
I think you misunderstood me, I mean to say in the second box put three symbols and then see
– Isla_Bonita
3 mins ago
add a comment |
Depends on how fancy you want to go. In principle you do not need any packages for that.
documentclass{article}
begin{document}
[
X=
raisebox{-1.5ex}{$begin{array}{c}
hline
multicolumn{1}{|c|}{X_1 X_2}\
hline
leftarrowellrightarrow\
end{array}$}~
raisebox{-1.5ex}{$begin{array}{c}
hline
multicolumn{1}{|c|}{X_3 X_4}\
hline
leftarrowellrightarrow\
end{array}$}cdots
raisebox{-1.5ex}{$begin{array}{c}
hline
multicolumn{1}{|c|}{X_5 X_6}\
hline
leftarrowellrightarrow\
end{array}$}
]
end{document}
add a comment |
Depends on how fancy you want to go. In principle you do not need any packages for that.
documentclass{article}
begin{document}
[
X=
raisebox{-1.5ex}{$begin{array}{c}
hline
multicolumn{1}{|c|}{X_1 X_2}\
hline
leftarrowellrightarrow\
end{array}$}~
raisebox{-1.5ex}{$begin{array}{c}
hline
multicolumn{1}{|c|}{X_3 X_4}\
hline
leftarrowellrightarrow\
end{array}$}cdots
raisebox{-1.5ex}{$begin{array}{c}
hline
multicolumn{1}{|c|}{X_5 X_6}\
hline
leftarrowellrightarrow\
end{array}$}
]
end{document}
add a comment |
Depends on how fancy you want to go. In principle you do not need any packages for that.
documentclass{article}
begin{document}
[
X=
raisebox{-1.5ex}{$begin{array}{c}
hline
multicolumn{1}{|c|}{X_1 X_2}\
hline
leftarrowellrightarrow\
end{array}$}~
raisebox{-1.5ex}{$begin{array}{c}
hline
multicolumn{1}{|c|}{X_3 X_4}\
hline
leftarrowellrightarrow\
end{array}$}cdots
raisebox{-1.5ex}{$begin{array}{c}
hline
multicolumn{1}{|c|}{X_5 X_6}\
hline
leftarrowellrightarrow\
end{array}$}
]
end{document}
Depends on how fancy you want to go. In principle you do not need any packages for that.
documentclass{article}
begin{document}
[
X=
raisebox{-1.5ex}{$begin{array}{c}
hline
multicolumn{1}{|c|}{X_1 X_2}\
hline
leftarrowellrightarrow\
end{array}$}~
raisebox{-1.5ex}{$begin{array}{c}
hline
multicolumn{1}{|c|}{X_3 X_4}\
hline
leftarrowellrightarrow\
end{array}$}cdots
raisebox{-1.5ex}{$begin{array}{c}
hline
multicolumn{1}{|c|}{X_5 X_6}\
hline
leftarrowellrightarrow\
end{array}$}
]
end{document}
answered 1 hour ago
marmotmarmot
95.7k4110210
95.7k4110210
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%2f472679%2fhow-to-write-mathematics-with-boxes%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