How to use tikz in fbox?
I am trying to put a diagram into a box as
fbox{
begin{tikzcd}
A arrow[rd] arrow[r, "phi"] & B \
& C
end{tikzcd}
}
The whole code is
documentclass[10pt]{amsart}
usepackage{amssymb}
usepackage{mathrsfs}
usepackage{amsmath}
usepackage[new]{old-arrows}
usepackage{extpfeil}
usepackage{mathtools}
usepackage[margin = 0.5 in]{geometry}
usepackage{graphicx}
usepackage[utf8]{inputenc}
usepackage[usenames, dvipsnames]{color}
usepackage{fancyhdr}
usepackage{tikz-cd}
usetikzlibrary{cd}
begin{document}
fbox{ d}
begin{tikzcd}
A arrow[rd] arrow[r, "phi"] & B \
& C
end{tikzcd}
end{document}
But it gives me error every single time. Is there any way to put the diagram into box?
tikz-pgf tikz-cd
add a comment |
I am trying to put a diagram into a box as
fbox{
begin{tikzcd}
A arrow[rd] arrow[r, "phi"] & B \
& C
end{tikzcd}
}
The whole code is
documentclass[10pt]{amsart}
usepackage{amssymb}
usepackage{mathrsfs}
usepackage{amsmath}
usepackage[new]{old-arrows}
usepackage{extpfeil}
usepackage{mathtools}
usepackage[margin = 0.5 in]{geometry}
usepackage{graphicx}
usepackage[utf8]{inputenc}
usepackage[usenames, dvipsnames]{color}
usepackage{fancyhdr}
usepackage{tikz-cd}
usetikzlibrary{cd}
begin{document}
fbox{ d}
begin{tikzcd}
A arrow[rd] arrow[r, "phi"] & B \
& C
end{tikzcd}
end{document}
But it gives me error every single time. Is there any way to put the diagram into box?
tikz-pgf tikz-cd
3
Related: tex.stackexchange.com/questions/408497/… tex.stackexchange.com/questions/395129/…
– egreg
Mar 28 at 21:10
add a comment |
I am trying to put a diagram into a box as
fbox{
begin{tikzcd}
A arrow[rd] arrow[r, "phi"] & B \
& C
end{tikzcd}
}
The whole code is
documentclass[10pt]{amsart}
usepackage{amssymb}
usepackage{mathrsfs}
usepackage{amsmath}
usepackage[new]{old-arrows}
usepackage{extpfeil}
usepackage{mathtools}
usepackage[margin = 0.5 in]{geometry}
usepackage{graphicx}
usepackage[utf8]{inputenc}
usepackage[usenames, dvipsnames]{color}
usepackage{fancyhdr}
usepackage{tikz-cd}
usetikzlibrary{cd}
begin{document}
fbox{ d}
begin{tikzcd}
A arrow[rd] arrow[r, "phi"] & B \
& C
end{tikzcd}
end{document}
But it gives me error every single time. Is there any way to put the diagram into box?
tikz-pgf tikz-cd
I am trying to put a diagram into a box as
fbox{
begin{tikzcd}
A arrow[rd] arrow[r, "phi"] & B \
& C
end{tikzcd}
}
The whole code is
documentclass[10pt]{amsart}
usepackage{amssymb}
usepackage{mathrsfs}
usepackage{amsmath}
usepackage[new]{old-arrows}
usepackage{extpfeil}
usepackage{mathtools}
usepackage[margin = 0.5 in]{geometry}
usepackage{graphicx}
usepackage[utf8]{inputenc}
usepackage[usenames, dvipsnames]{color}
usepackage{fancyhdr}
usepackage{tikz-cd}
usetikzlibrary{cd}
begin{document}
fbox{ d}
begin{tikzcd}
A arrow[rd] arrow[r, "phi"] & B \
& C
end{tikzcd}
end{document}
But it gives me error every single time. Is there any way to put the diagram into box?
tikz-pgf tikz-cd
tikz-pgf tikz-cd
edited Mar 28 at 21:05
Sebastiano
11.2k42166
11.2k42166
asked Mar 28 at 21:00
Lev BanLev Ban
1133
1133
3
Related: tex.stackexchange.com/questions/408497/… tex.stackexchange.com/questions/395129/…
– egreg
Mar 28 at 21:10
add a comment |
3
Related: tex.stackexchange.com/questions/408497/… tex.stackexchange.com/questions/395129/…
– egreg
Mar 28 at 21:10
3
3
Related: tex.stackexchange.com/questions/408497/… tex.stackexchange.com/questions/395129/…
– egreg
Mar 28 at 21:10
Related: tex.stackexchange.com/questions/408497/… tex.stackexchange.com/questions/395129/…
– egreg
Mar 28 at 21:10
add a comment |
2 Answers
2
active
oldest
votes
By using ampersand replacement.
documentclass[10pt]{amsart}
usepackage{amssymb}
usepackage{tikz-cd}
begin{document}
fbox{
begin{tikzcd}[ampersand replacement=&]
A arrow[rd] arrow[r, "phi"] & B \
& C
end{tikzcd}}
end{document}

add a comment |
The problem is, that the category codes are fixed if the contents are grabbed as an argument once. The following uses the grabbox package, to define an alternative form of fbox that doesn't grab its contents as an argument but as a hbox (you could use the collectbox package, too).
documentclass[10pt]{amsart}
usepackage{amssymb}
usepackage{mathrsfs}
usepackage{amsmath}
usepackage[new]{old-arrows}
usepackage{extpfeil}
usepackage{mathtools}
usepackage[margin = 0.5 in]{geometry}
usepackage{graphicx}
usepackage[utf8]{inputenc}
usepackage[usenames, dvipsnames]{color}
usepackage{fancyhdr}
usepackage{tikz-cd}
usetikzlibrary{cd}
usepackage{grabbox}
newcommandFbox
{%
grabbox0hbox{fbox{usebox0}}%
}
begin{document}
Fbox{begin{tikzcd}
A arrow[rd] arrow[r, "phi"] & B \
& C
end{tikzcd}}
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%2f481986%2fhow-to-use-tikz-in-fbox%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
By using ampersand replacement.
documentclass[10pt]{amsart}
usepackage{amssymb}
usepackage{tikz-cd}
begin{document}
fbox{
begin{tikzcd}[ampersand replacement=&]
A arrow[rd] arrow[r, "phi"] & B \
& C
end{tikzcd}}
end{document}

add a comment |
By using ampersand replacement.
documentclass[10pt]{amsart}
usepackage{amssymb}
usepackage{tikz-cd}
begin{document}
fbox{
begin{tikzcd}[ampersand replacement=&]
A arrow[rd] arrow[r, "phi"] & B \
& C
end{tikzcd}}
end{document}

add a comment |
By using ampersand replacement.
documentclass[10pt]{amsart}
usepackage{amssymb}
usepackage{tikz-cd}
begin{document}
fbox{
begin{tikzcd}[ampersand replacement=&]
A arrow[rd] arrow[r, "phi"] & B \
& C
end{tikzcd}}
end{document}

By using ampersand replacement.
documentclass[10pt]{amsart}
usepackage{amssymb}
usepackage{tikz-cd}
begin{document}
fbox{
begin{tikzcd}[ampersand replacement=&]
A arrow[rd] arrow[r, "phi"] & B \
& C
end{tikzcd}}
end{document}

answered Mar 28 at 21:07
marmotmarmot
116k5146277
116k5146277
add a comment |
add a comment |
The problem is, that the category codes are fixed if the contents are grabbed as an argument once. The following uses the grabbox package, to define an alternative form of fbox that doesn't grab its contents as an argument but as a hbox (you could use the collectbox package, too).
documentclass[10pt]{amsart}
usepackage{amssymb}
usepackage{mathrsfs}
usepackage{amsmath}
usepackage[new]{old-arrows}
usepackage{extpfeil}
usepackage{mathtools}
usepackage[margin = 0.5 in]{geometry}
usepackage{graphicx}
usepackage[utf8]{inputenc}
usepackage[usenames, dvipsnames]{color}
usepackage{fancyhdr}
usepackage{tikz-cd}
usetikzlibrary{cd}
usepackage{grabbox}
newcommandFbox
{%
grabbox0hbox{fbox{usebox0}}%
}
begin{document}
Fbox{begin{tikzcd}
A arrow[rd] arrow[r, "phi"] & B \
& C
end{tikzcd}}
end{document}

add a comment |
The problem is, that the category codes are fixed if the contents are grabbed as an argument once. The following uses the grabbox package, to define an alternative form of fbox that doesn't grab its contents as an argument but as a hbox (you could use the collectbox package, too).
documentclass[10pt]{amsart}
usepackage{amssymb}
usepackage{mathrsfs}
usepackage{amsmath}
usepackage[new]{old-arrows}
usepackage{extpfeil}
usepackage{mathtools}
usepackage[margin = 0.5 in]{geometry}
usepackage{graphicx}
usepackage[utf8]{inputenc}
usepackage[usenames, dvipsnames]{color}
usepackage{fancyhdr}
usepackage{tikz-cd}
usetikzlibrary{cd}
usepackage{grabbox}
newcommandFbox
{%
grabbox0hbox{fbox{usebox0}}%
}
begin{document}
Fbox{begin{tikzcd}
A arrow[rd] arrow[r, "phi"] & B \
& C
end{tikzcd}}
end{document}

add a comment |
The problem is, that the category codes are fixed if the contents are grabbed as an argument once. The following uses the grabbox package, to define an alternative form of fbox that doesn't grab its contents as an argument but as a hbox (you could use the collectbox package, too).
documentclass[10pt]{amsart}
usepackage{amssymb}
usepackage{mathrsfs}
usepackage{amsmath}
usepackage[new]{old-arrows}
usepackage{extpfeil}
usepackage{mathtools}
usepackage[margin = 0.5 in]{geometry}
usepackage{graphicx}
usepackage[utf8]{inputenc}
usepackage[usenames, dvipsnames]{color}
usepackage{fancyhdr}
usepackage{tikz-cd}
usetikzlibrary{cd}
usepackage{grabbox}
newcommandFbox
{%
grabbox0hbox{fbox{usebox0}}%
}
begin{document}
Fbox{begin{tikzcd}
A arrow[rd] arrow[r, "phi"] & B \
& C
end{tikzcd}}
end{document}

The problem is, that the category codes are fixed if the contents are grabbed as an argument once. The following uses the grabbox package, to define an alternative form of fbox that doesn't grab its contents as an argument but as a hbox (you could use the collectbox package, too).
documentclass[10pt]{amsart}
usepackage{amssymb}
usepackage{mathrsfs}
usepackage{amsmath}
usepackage[new]{old-arrows}
usepackage{extpfeil}
usepackage{mathtools}
usepackage[margin = 0.5 in]{geometry}
usepackage{graphicx}
usepackage[utf8]{inputenc}
usepackage[usenames, dvipsnames]{color}
usepackage{fancyhdr}
usepackage{tikz-cd}
usetikzlibrary{cd}
usepackage{grabbox}
newcommandFbox
{%
grabbox0hbox{fbox{usebox0}}%
}
begin{document}
Fbox{begin{tikzcd}
A arrow[rd] arrow[r, "phi"] & B \
& C
end{tikzcd}}
end{document}

edited Mar 28 at 21:19
answered Mar 28 at 21:09
SkillmonSkillmon
24.3k12250
24.3k12250
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%2f481986%2fhow-to-use-tikz-in-fbox%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
Related: tex.stackexchange.com/questions/408497/… tex.stackexchange.com/questions/395129/…
– egreg
Mar 28 at 21:10