tikz block diagonally divideda divided rectangle in tikzUML StatediagramHow to define the default vertical...
Unsolved Problems due to Lack of Computational Power
Why don't politicians push for fossil fuel reduction by pointing out their scarcity?
Can 'in-' mean both 'in' and 'no'?
Why is the name Bergson pronounced like Berksonne?
Metal that glows when near pieces of itself
Starships without computers?
Can I check a small array of bools in one go?
Chess software to analyze games
Killer Neighbors
Vegetarian dishes on Russian trains (European part)
The Lucky House
Show two plots together: a two dimensional curve tangent to the maxima of a three dimensional plot
Is there such a thing as too inconvenient?
iPad or iPhone doesn't charge until unlocked?
Why Won't my Serial Read value stay the same
Control GPIO pins from C
Saying something to a foreign coworker who uses "you people"
How to shade a polygon with curved lines in tikz?
Hiker's Cabin Mystery | Pt. XV
On the relation between the asymptotics of a Dirichlet series' coefficients and the series' analytic continuability
Why do aircraft leave the cruising altitude long before landing just to circle?
Are there reliable, formulaic ways to form chords on the guitar?
Is recepted a word?
How do you call it when two celestial bodies come as close to each other as they will in their current orbits?
tikz block diagonally divided
a divided rectangle in tikzUML StatediagramHow to define the default vertical distance between nodes?Numerical conditional within tikz keys?TikZ/ERD: node (=Entity) label on the insideHow to draw integrator block with Tikz?Tikz: Shading a rectangle diagonally,Line up nested tikz enviroments or how to get rid of them
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I'm trying to draw the following diagram:
What I could do so far:
The code:
documentclass[tikz,border=20pt]{standalone}
usetikzlibrary{shapes,arrows}
usetikzlibrary{decorations.pathreplacing}
usetikzlibrary{babel}
usetikzlibrary{calc,arrows.meta,patterns,backgrounds}
usetikzlibrary{shapes.multipart}
tikzstyle{block} = [draw, rectangle, rounded corners, minimum size=1cm, text centered]
tikzstyle{transform} = [draw, block, path picture={draw (path picture bounding box.south west)--(path picture bounding box.north east);}]
tikzstyle{state} = [draw, rectangle split,rectangle split parts=2,rounded corners, minimum size=1cm, text centered]
begin{document}
begin{tikzpicture}
node at (0.0,0.0) [transform](inverter){$qd0$};
node at (2.0,0.0) [state] {$qd0$ nodepart{two} $abc$};
end{tikzpicture}
end{document}
I need some help :)
tikz-pgf tikz-styles
add a comment |
I'm trying to draw the following diagram:
What I could do so far:
The code:
documentclass[tikz,border=20pt]{standalone}
usetikzlibrary{shapes,arrows}
usetikzlibrary{decorations.pathreplacing}
usetikzlibrary{babel}
usetikzlibrary{calc,arrows.meta,patterns,backgrounds}
usetikzlibrary{shapes.multipart}
tikzstyle{block} = [draw, rectangle, rounded corners, minimum size=1cm, text centered]
tikzstyle{transform} = [draw, block, path picture={draw (path picture bounding box.south west)--(path picture bounding box.north east);}]
tikzstyle{state} = [draw, rectangle split,rectangle split parts=2,rounded corners, minimum size=1cm, text centered]
begin{document}
begin{tikzpicture}
node at (0.0,0.0) [transform](inverter){$qd0$};
node at (2.0,0.0) [state] {$qd0$ nodepart{two} $abc$};
end{tikzpicture}
end{document}
I need some help :)
tikz-pgf tikz-styles
add a comment |
I'm trying to draw the following diagram:
What I could do so far:
The code:
documentclass[tikz,border=20pt]{standalone}
usetikzlibrary{shapes,arrows}
usetikzlibrary{decorations.pathreplacing}
usetikzlibrary{babel}
usetikzlibrary{calc,arrows.meta,patterns,backgrounds}
usetikzlibrary{shapes.multipart}
tikzstyle{block} = [draw, rectangle, rounded corners, minimum size=1cm, text centered]
tikzstyle{transform} = [draw, block, path picture={draw (path picture bounding box.south west)--(path picture bounding box.north east);}]
tikzstyle{state} = [draw, rectangle split,rectangle split parts=2,rounded corners, minimum size=1cm, text centered]
begin{document}
begin{tikzpicture}
node at (0.0,0.0) [transform](inverter){$qd0$};
node at (2.0,0.0) [state] {$qd0$ nodepart{two} $abc$};
end{tikzpicture}
end{document}
I need some help :)
tikz-pgf tikz-styles
I'm trying to draw the following diagram:
What I could do so far:
The code:
documentclass[tikz,border=20pt]{standalone}
usetikzlibrary{shapes,arrows}
usetikzlibrary{decorations.pathreplacing}
usetikzlibrary{babel}
usetikzlibrary{calc,arrows.meta,patterns,backgrounds}
usetikzlibrary{shapes.multipart}
tikzstyle{block} = [draw, rectangle, rounded corners, minimum size=1cm, text centered]
tikzstyle{transform} = [draw, block, path picture={draw (path picture bounding box.south west)--(path picture bounding box.north east);}]
tikzstyle{state} = [draw, rectangle split,rectangle split parts=2,rounded corners, minimum size=1cm, text centered]
begin{document}
begin{tikzpicture}
node at (0.0,0.0) [transform](inverter){$qd0$};
node at (2.0,0.0) [state] {$qd0$ nodepart{two} $abc$};
end{tikzpicture}
end{document}
I need some help :)
tikz-pgf tikz-styles
tikz-pgf tikz-styles
edited 2 days ago
Bernard
188k7 gold badges85 silver badges223 bronze badges
188k7 gold badges85 silver badges223 bronze badges
asked Aug 16 at 0:05
Clecio JungClecio Jung
1025 bronze badges
1025 bronze badges
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
The computations are basic,
and if you consider using a pic
instead of a full-fledged the node shape, the implementation is straightforward, too. The free parameter is taken to be the height of the full shape. The width is then computed in such a way that the diagonal does not cut any of the nodes (where the "safety distance" is given by the inner sep
).
documentclass{article}
usepackage{tikz}
tikzset{pics/dbox/.style 2 args={code={%
pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
(width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
path[pic actions] (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
node[above right] {#2}
rectangle
(w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
node[below left] {#1} (-w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
-- (w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2) ;
}},dbox/.cd,height/.initial=2cm}
begin{document}
begin{tikzpicture}
path pic[draw]{dbox={abc}{xyzuv}} (3,0) pic[draw,blue]{dbox={abc}{xyz}}
(6,0) pic[draw,red,thick]{dbox={abcdefgh}{xyz}};
end{tikzpicture}
end{document}
You can give this shape the usual anchors with a simple trick: just turn it into a node using fit
. The names have then to be set using dbox/name=<name>
.
documentclass{article}
usepackage{tikz}
usetikzlibrary{fit}
tikzset{pics/dbox/.style 2 args={code={%
pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
(width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
path (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
node[above right] (bl) {#2}
rectangle
(w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
node[below left] (tr) {#1};
node[pic actions,inner sep=0pt,fit=(bl)(tr),path picture={path[pic actions]
(path picture bounding box.north west)
-- (path picture bounding box.south east);}]
(pgfkeysvalueof{/tikz/dbox/name}){};
}},dbox/.cd,height/.initial=2cm,name/.initial=}
begin{document}
begin{tikzpicture}
path pic[draw] {dbox={abc}{xyzuv}} (3,0)
pic[draw,blue,dbox/name=A] {dbox={abc}{xyz}}
(6,0) pic[draw,red,thick,rounded corners,dbox/name=B] {dbox={abcdefgh}{xyz}};
draw[stealth-stealth] (A.north) to[out=80,in=100](B.100);
end{tikzpicture}
end{document}
New contributor
add a comment |
Are you looking for a simple code like this? Think geometrically: just a (scaling) square with some text inside that can be manually adjusted.
documentclass[border=5mm]{standalone}
usepackage{tikz}
begin{document}
begin{tikzpicture}[xscale=.8,yscale=1.5]
draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
path[magenta]
(0,0)+(.3,.3) node{$dq$}
(1,1)+(-.4,-.15) node{$abc$};
end{tikzpicture}
begin{tikzpicture}[xscale=2.5,yscale=1.5]
draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
path[blue]
(0,0)+(.2,.15) node{$TikZ$}
(1,1)+(-.4,-.15) node{$Asymptote$};
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',
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%2f504386%2ftikz-block-diagonally-divided%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
The computations are basic,
and if you consider using a pic
instead of a full-fledged the node shape, the implementation is straightforward, too. The free parameter is taken to be the height of the full shape. The width is then computed in such a way that the diagonal does not cut any of the nodes (where the "safety distance" is given by the inner sep
).
documentclass{article}
usepackage{tikz}
tikzset{pics/dbox/.style 2 args={code={%
pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
(width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
path[pic actions] (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
node[above right] {#2}
rectangle
(w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
node[below left] {#1} (-w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
-- (w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2) ;
}},dbox/.cd,height/.initial=2cm}
begin{document}
begin{tikzpicture}
path pic[draw]{dbox={abc}{xyzuv}} (3,0) pic[draw,blue]{dbox={abc}{xyz}}
(6,0) pic[draw,red,thick]{dbox={abcdefgh}{xyz}};
end{tikzpicture}
end{document}
You can give this shape the usual anchors with a simple trick: just turn it into a node using fit
. The names have then to be set using dbox/name=<name>
.
documentclass{article}
usepackage{tikz}
usetikzlibrary{fit}
tikzset{pics/dbox/.style 2 args={code={%
pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
(width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
path (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
node[above right] (bl) {#2}
rectangle
(w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
node[below left] (tr) {#1};
node[pic actions,inner sep=0pt,fit=(bl)(tr),path picture={path[pic actions]
(path picture bounding box.north west)
-- (path picture bounding box.south east);}]
(pgfkeysvalueof{/tikz/dbox/name}){};
}},dbox/.cd,height/.initial=2cm,name/.initial=}
begin{document}
begin{tikzpicture}
path pic[draw] {dbox={abc}{xyzuv}} (3,0)
pic[draw,blue,dbox/name=A] {dbox={abc}{xyz}}
(6,0) pic[draw,red,thick,rounded corners,dbox/name=B] {dbox={abcdefgh}{xyz}};
draw[stealth-stealth] (A.north) to[out=80,in=100](B.100);
end{tikzpicture}
end{document}
New contributor
add a comment |
The computations are basic,
and if you consider using a pic
instead of a full-fledged the node shape, the implementation is straightforward, too. The free parameter is taken to be the height of the full shape. The width is then computed in such a way that the diagonal does not cut any of the nodes (where the "safety distance" is given by the inner sep
).
documentclass{article}
usepackage{tikz}
tikzset{pics/dbox/.style 2 args={code={%
pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
(width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
path[pic actions] (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
node[above right] {#2}
rectangle
(w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
node[below left] {#1} (-w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
-- (w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2) ;
}},dbox/.cd,height/.initial=2cm}
begin{document}
begin{tikzpicture}
path pic[draw]{dbox={abc}{xyzuv}} (3,0) pic[draw,blue]{dbox={abc}{xyz}}
(6,0) pic[draw,red,thick]{dbox={abcdefgh}{xyz}};
end{tikzpicture}
end{document}
You can give this shape the usual anchors with a simple trick: just turn it into a node using fit
. The names have then to be set using dbox/name=<name>
.
documentclass{article}
usepackage{tikz}
usetikzlibrary{fit}
tikzset{pics/dbox/.style 2 args={code={%
pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
(width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
path (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
node[above right] (bl) {#2}
rectangle
(w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
node[below left] (tr) {#1};
node[pic actions,inner sep=0pt,fit=(bl)(tr),path picture={path[pic actions]
(path picture bounding box.north west)
-- (path picture bounding box.south east);}]
(pgfkeysvalueof{/tikz/dbox/name}){};
}},dbox/.cd,height/.initial=2cm,name/.initial=}
begin{document}
begin{tikzpicture}
path pic[draw] {dbox={abc}{xyzuv}} (3,0)
pic[draw,blue,dbox/name=A] {dbox={abc}{xyz}}
(6,0) pic[draw,red,thick,rounded corners,dbox/name=B] {dbox={abcdefgh}{xyz}};
draw[stealth-stealth] (A.north) to[out=80,in=100](B.100);
end{tikzpicture}
end{document}
New contributor
add a comment |
The computations are basic,
and if you consider using a pic
instead of a full-fledged the node shape, the implementation is straightforward, too. The free parameter is taken to be the height of the full shape. The width is then computed in such a way that the diagonal does not cut any of the nodes (where the "safety distance" is given by the inner sep
).
documentclass{article}
usepackage{tikz}
tikzset{pics/dbox/.style 2 args={code={%
pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
(width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
path[pic actions] (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
node[above right] {#2}
rectangle
(w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
node[below left] {#1} (-w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
-- (w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2) ;
}},dbox/.cd,height/.initial=2cm}
begin{document}
begin{tikzpicture}
path pic[draw]{dbox={abc}{xyzuv}} (3,0) pic[draw,blue]{dbox={abc}{xyz}}
(6,0) pic[draw,red,thick]{dbox={abcdefgh}{xyz}};
end{tikzpicture}
end{document}
You can give this shape the usual anchors with a simple trick: just turn it into a node using fit
. The names have then to be set using dbox/name=<name>
.
documentclass{article}
usepackage{tikz}
usetikzlibrary{fit}
tikzset{pics/dbox/.style 2 args={code={%
pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
(width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
path (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
node[above right] (bl) {#2}
rectangle
(w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
node[below left] (tr) {#1};
node[pic actions,inner sep=0pt,fit=(bl)(tr),path picture={path[pic actions]
(path picture bounding box.north west)
-- (path picture bounding box.south east);}]
(pgfkeysvalueof{/tikz/dbox/name}){};
}},dbox/.cd,height/.initial=2cm,name/.initial=}
begin{document}
begin{tikzpicture}
path pic[draw] {dbox={abc}{xyzuv}} (3,0)
pic[draw,blue,dbox/name=A] {dbox={abc}{xyz}}
(6,0) pic[draw,red,thick,rounded corners,dbox/name=B] {dbox={abcdefgh}{xyz}};
draw[stealth-stealth] (A.north) to[out=80,in=100](B.100);
end{tikzpicture}
end{document}
New contributor
The computations are basic,
and if you consider using a pic
instead of a full-fledged the node shape, the implementation is straightforward, too. The free parameter is taken to be the height of the full shape. The width is then computed in such a way that the diagonal does not cut any of the nodes (where the "safety distance" is given by the inner sep
).
documentclass{article}
usepackage{tikz}
tikzset{pics/dbox/.style 2 args={code={%
pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
(width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
path[pic actions] (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
node[above right] {#2}
rectangle
(w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
node[below left] {#1} (-w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
-- (w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2) ;
}},dbox/.cd,height/.initial=2cm}
begin{document}
begin{tikzpicture}
path pic[draw]{dbox={abc}{xyzuv}} (3,0) pic[draw,blue]{dbox={abc}{xyz}}
(6,0) pic[draw,red,thick]{dbox={abcdefgh}{xyz}};
end{tikzpicture}
end{document}
You can give this shape the usual anchors with a simple trick: just turn it into a node using fit
. The names have then to be set using dbox/name=<name>
.
documentclass{article}
usepackage{tikz}
usetikzlibrary{fit}
tikzset{pics/dbox/.style 2 args={code={%
pgfmathsetmacro{w}{max((width("#1")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#1")),%
(width("#2")+2*pgfkeysvalueof{/pgf/inner xsep})/(pgfkeysvalueof{/tikz/dbox/height}-2*pgfkeysvalueof{/pgf/inner xsep}-height("#2")))*pgfkeysvalueof{/tikz/dbox/height}}
path (-w*1pt/2,-pgfkeysvalueof{/tikz/dbox/height}/2)
node[above right] (bl) {#2}
rectangle
(w*1pt/2,pgfkeysvalueof{/tikz/dbox/height}/2)
node[below left] (tr) {#1};
node[pic actions,inner sep=0pt,fit=(bl)(tr),path picture={path[pic actions]
(path picture bounding box.north west)
-- (path picture bounding box.south east);}]
(pgfkeysvalueof{/tikz/dbox/name}){};
}},dbox/.cd,height/.initial=2cm,name/.initial=}
begin{document}
begin{tikzpicture}
path pic[draw] {dbox={abc}{xyzuv}} (3,0)
pic[draw,blue,dbox/name=A] {dbox={abc}{xyz}}
(6,0) pic[draw,red,thick,rounded corners,dbox/name=B] {dbox={abcdefgh}{xyz}};
draw[stealth-stealth] (A.north) to[out=80,in=100](B.100);
end{tikzpicture}
end{document}
New contributor
edited Aug 16 at 4:54
New contributor
answered Aug 16 at 3:04
Schrödinger's catSchrödinger's cat
7363 silver badges9 bronze badges
7363 silver badges9 bronze badges
New contributor
New contributor
add a comment |
add a comment |
Are you looking for a simple code like this? Think geometrically: just a (scaling) square with some text inside that can be manually adjusted.
documentclass[border=5mm]{standalone}
usepackage{tikz}
begin{document}
begin{tikzpicture}[xscale=.8,yscale=1.5]
draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
path[magenta]
(0,0)+(.3,.3) node{$dq$}
(1,1)+(-.4,-.15) node{$abc$};
end{tikzpicture}
begin{tikzpicture}[xscale=2.5,yscale=1.5]
draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
path[blue]
(0,0)+(.2,.15) node{$TikZ$}
(1,1)+(-.4,-.15) node{$Asymptote$};
end{tikzpicture}
end{document}
add a comment |
Are you looking for a simple code like this? Think geometrically: just a (scaling) square with some text inside that can be manually adjusted.
documentclass[border=5mm]{standalone}
usepackage{tikz}
begin{document}
begin{tikzpicture}[xscale=.8,yscale=1.5]
draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
path[magenta]
(0,0)+(.3,.3) node{$dq$}
(1,1)+(-.4,-.15) node{$abc$};
end{tikzpicture}
begin{tikzpicture}[xscale=2.5,yscale=1.5]
draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
path[blue]
(0,0)+(.2,.15) node{$TikZ$}
(1,1)+(-.4,-.15) node{$Asymptote$};
end{tikzpicture}
end{document}
add a comment |
Are you looking for a simple code like this? Think geometrically: just a (scaling) square with some text inside that can be manually adjusted.
documentclass[border=5mm]{standalone}
usepackage{tikz}
begin{document}
begin{tikzpicture}[xscale=.8,yscale=1.5]
draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
path[magenta]
(0,0)+(.3,.3) node{$dq$}
(1,1)+(-.4,-.15) node{$abc$};
end{tikzpicture}
begin{tikzpicture}[xscale=2.5,yscale=1.5]
draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
path[blue]
(0,0)+(.2,.15) node{$TikZ$}
(1,1)+(-.4,-.15) node{$Asymptote$};
end{tikzpicture}
end{document}
Are you looking for a simple code like this? Think geometrically: just a (scaling) square with some text inside that can be manually adjusted.
documentclass[border=5mm]{standalone}
usepackage{tikz}
begin{document}
begin{tikzpicture}[xscale=.8,yscale=1.5]
draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
path[magenta]
(0,0)+(.3,.3) node{$dq$}
(1,1)+(-.4,-.15) node{$abc$};
end{tikzpicture}
begin{tikzpicture}[xscale=2.5,yscale=1.5]
draw[thick] (1,0)--(0,1) (0,0) rectangle (1,1);
path[blue]
(0,0)+(.2,.15) node{$TikZ$}
(1,1)+(-.4,-.15) node{$Asymptote$};
end{tikzpicture}
end{document}
answered 2 days ago
Black MildBlack Mild
1,8569 silver badges15 bronze badges
1,8569 silver badges15 bronze badges
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%2f504386%2ftikz-block-diagonally-divided%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