How to draw this rectangle using tikzpicture environment
up vote
1
down vote
favorite
I want to draw this kind of rectangle using tikzpicture
environment:
a
could change to b
, c
, d
, etc.
We should also be able to insert a new line.
If MWE is needed please let me know.
Thanks!
tikz-pgf
add a comment |
up vote
1
down vote
favorite
I want to draw this kind of rectangle using tikzpicture
environment:
a
could change to b
, c
, d
, etc.
We should also be able to insert a new line.
If MWE is needed please let me know.
Thanks!
tikz-pgf
1
I don't really understand what you're trying to do. Are you trying to draw several of these in a singletikzpicture
? What does the 'optional' bit mean? Nodes are rectangular by default and they adjust to the width of the text by default, so the only even slight complication seems to be placing the label in the corner. You need to use another node for that. At least, that'd be simplest.
– cfr
Dec 7 at 1:20
@cfr sorry for the inaccuracies. I want to draw the rectangle of the image. By "optional" I mean that the straight line could be drawn or not. Yes, you are right that the text adjust to the width of it by default. The two things are the label and the line.
– manooooh
Dec 7 at 1:25
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I want to draw this kind of rectangle using tikzpicture
environment:
a
could change to b
, c
, d
, etc.
We should also be able to insert a new line.
If MWE is needed please let me know.
Thanks!
tikz-pgf
I want to draw this kind of rectangle using tikzpicture
environment:
a
could change to b
, c
, d
, etc.
We should also be able to insert a new line.
If MWE is needed please let me know.
Thanks!
tikz-pgf
tikz-pgf
edited Dec 7 at 1:23
asked Dec 7 at 1:15
manooooh
8801315
8801315
1
I don't really understand what you're trying to do. Are you trying to draw several of these in a singletikzpicture
? What does the 'optional' bit mean? Nodes are rectangular by default and they adjust to the width of the text by default, so the only even slight complication seems to be placing the label in the corner. You need to use another node for that. At least, that'd be simplest.
– cfr
Dec 7 at 1:20
@cfr sorry for the inaccuracies. I want to draw the rectangle of the image. By "optional" I mean that the straight line could be drawn or not. Yes, you are right that the text adjust to the width of it by default. The two things are the label and the line.
– manooooh
Dec 7 at 1:25
add a comment |
1
I don't really understand what you're trying to do. Are you trying to draw several of these in a singletikzpicture
? What does the 'optional' bit mean? Nodes are rectangular by default and they adjust to the width of the text by default, so the only even slight complication seems to be placing the label in the corner. You need to use another node for that. At least, that'd be simplest.
– cfr
Dec 7 at 1:20
@cfr sorry for the inaccuracies. I want to draw the rectangle of the image. By "optional" I mean that the straight line could be drawn or not. Yes, you are right that the text adjust to the width of it by default. The two things are the label and the line.
– manooooh
Dec 7 at 1:25
1
1
I don't really understand what you're trying to do. Are you trying to draw several of these in a single
tikzpicture
? What does the 'optional' bit mean? Nodes are rectangular by default and they adjust to the width of the text by default, so the only even slight complication seems to be placing the label in the corner. You need to use another node for that. At least, that'd be simplest.– cfr
Dec 7 at 1:20
I don't really understand what you're trying to do. Are you trying to draw several of these in a single
tikzpicture
? What does the 'optional' bit mean? Nodes are rectangular by default and they adjust to the width of the text by default, so the only even slight complication seems to be placing the label in the corner. You need to use another node for that. At least, that'd be simplest.– cfr
Dec 7 at 1:20
@cfr sorry for the inaccuracies. I want to draw the rectangle of the image. By "optional" I mean that the straight line could be drawn or not. Yes, you are right that the text adjust to the width of it by default. The two things are the label and the line.
– manooooh
Dec 7 at 1:25
@cfr sorry for the inaccuracies. I want to draw the rectangle of the image. By "optional" I mean that the straight line could be drawn or not. Yes, you are right that the text adjust to the width of it by default. The two things are the label and the line.
– manooooh
Dec 7 at 1:25
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
There are already folder symbols on the market that do something like this, e.g. here. That is, if you want to define a new shape, there are answers that give you good start. However, if you want to do it the quick and dirty way, you could do
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[fluffy with corner/.style={draw,inner ysep=3mm,inner
xsep=3mm,align=center,
path picture={
draw ([xshift=3mm]path picture bounding box.north west)
-- ([yshift=-3mm]path picture bounding box.north west);
node[anchor=north east,inner sep=2pt] at (path picture bounding box.north east)
{#1};}},fluffy/.style={draw,inner ysep=3mm,inner xsep=3mm,align=center,
path picture={
node[anchor=north east,inner sep=2pt] at (path picture bounding box.north east) {#1};}}]
node[fluffy=b] at (0,0){text here};
node[fluffy with corner=a] at (4,0){text here\ second line\ third line};
end{tikzpicture}
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',
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%2f463612%2fhow-to-draw-this-rectangle-using-tikzpicture-environment%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
up vote
2
down vote
accepted
There are already folder symbols on the market that do something like this, e.g. here. That is, if you want to define a new shape, there are answers that give you good start. However, if you want to do it the quick and dirty way, you could do
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[fluffy with corner/.style={draw,inner ysep=3mm,inner
xsep=3mm,align=center,
path picture={
draw ([xshift=3mm]path picture bounding box.north west)
-- ([yshift=-3mm]path picture bounding box.north west);
node[anchor=north east,inner sep=2pt] at (path picture bounding box.north east)
{#1};}},fluffy/.style={draw,inner ysep=3mm,inner xsep=3mm,align=center,
path picture={
node[anchor=north east,inner sep=2pt] at (path picture bounding box.north east) {#1};}}]
node[fluffy=b] at (0,0){text here};
node[fluffy with corner=a] at (4,0){text here\ second line\ third line};
end{tikzpicture}
end{document}
add a comment |
up vote
2
down vote
accepted
There are already folder symbols on the market that do something like this, e.g. here. That is, if you want to define a new shape, there are answers that give you good start. However, if you want to do it the quick and dirty way, you could do
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[fluffy with corner/.style={draw,inner ysep=3mm,inner
xsep=3mm,align=center,
path picture={
draw ([xshift=3mm]path picture bounding box.north west)
-- ([yshift=-3mm]path picture bounding box.north west);
node[anchor=north east,inner sep=2pt] at (path picture bounding box.north east)
{#1};}},fluffy/.style={draw,inner ysep=3mm,inner xsep=3mm,align=center,
path picture={
node[anchor=north east,inner sep=2pt] at (path picture bounding box.north east) {#1};}}]
node[fluffy=b] at (0,0){text here};
node[fluffy with corner=a] at (4,0){text here\ second line\ third line};
end{tikzpicture}
end{document}
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
There are already folder symbols on the market that do something like this, e.g. here. That is, if you want to define a new shape, there are answers that give you good start. However, if you want to do it the quick and dirty way, you could do
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[fluffy with corner/.style={draw,inner ysep=3mm,inner
xsep=3mm,align=center,
path picture={
draw ([xshift=3mm]path picture bounding box.north west)
-- ([yshift=-3mm]path picture bounding box.north west);
node[anchor=north east,inner sep=2pt] at (path picture bounding box.north east)
{#1};}},fluffy/.style={draw,inner ysep=3mm,inner xsep=3mm,align=center,
path picture={
node[anchor=north east,inner sep=2pt] at (path picture bounding box.north east) {#1};}}]
node[fluffy=b] at (0,0){text here};
node[fluffy with corner=a] at (4,0){text here\ second line\ third line};
end{tikzpicture}
end{document}
There are already folder symbols on the market that do something like this, e.g. here. That is, if you want to define a new shape, there are answers that give you good start. However, if you want to do it the quick and dirty way, you could do
documentclass[tikz,border=3.14mm]{standalone}
begin{document}
begin{tikzpicture}[fluffy with corner/.style={draw,inner ysep=3mm,inner
xsep=3mm,align=center,
path picture={
draw ([xshift=3mm]path picture bounding box.north west)
-- ([yshift=-3mm]path picture bounding box.north west);
node[anchor=north east,inner sep=2pt] at (path picture bounding box.north east)
{#1};}},fluffy/.style={draw,inner ysep=3mm,inner xsep=3mm,align=center,
path picture={
node[anchor=north east,inner sep=2pt] at (path picture bounding box.north east) {#1};}}]
node[fluffy=b] at (0,0){text here};
node[fluffy with corner=a] at (4,0){text here\ second line\ third line};
end{tikzpicture}
end{document}
edited Dec 7 at 1:48
answered Dec 7 at 1:29
marmot
83.1k493178
83.1k493178
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f463612%2fhow-to-draw-this-rectangle-using-tikzpicture-environment%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
1
I don't really understand what you're trying to do. Are you trying to draw several of these in a single
tikzpicture
? What does the 'optional' bit mean? Nodes are rectangular by default and they adjust to the width of the text by default, so the only even slight complication seems to be placing the label in the corner. You need to use another node for that. At least, that'd be simplest.– cfr
Dec 7 at 1:20
@cfr sorry for the inaccuracies. I want to draw the rectangle of the image. By "optional" I mean that the straight line could be drawn or not. Yes, you are right that the text adjust to the width of it by default. The two things are the label and the line.
– manooooh
Dec 7 at 1:25