How to move tikzpicture with named nodes?
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I am trying to position an image with rounded corners to a specific position on screen. However, according to the following post, yshift and xshift do not affect nodes that are named and I am still a bit confused on how to use the ++
and if this is the best approach.
Take my current situation:
documentclassarticle
usepackage[utf8]inputenc
usepackagegraphicx
usepackagetikz
usepackage[a4paper,top=3cm, bottom=3cm, left=2cm, right=2cm]geometry
begindocument
begintikzpicture
beginscope
clip [rounded corners=0.7cm] (0,0) rectangle coordinate (centerpoint) (4,4.0cm);
node [inner sep=0pt] at (centerpoint) includegraphics[width=4.0cm]dogesmall.jpg;
draw[line width=0.08cm,rounded corners=0.7cm] (0,0) rectangle (4,4.0cm);
endscope
endtikzpicture
enddocument
(Where "dogesmall.jpg" is my current image)
This produces a result that places the image in the upper left hand corner, as defined by the margins. However, I would like to tweak the position of the tikzpicture without changing the margins like so:
                                           Â
How would I go about accomplishing such a task?
I tried following this post by using the following:
newcommandsetcoordinates
coordinate (centerpoint) at (4,4.0cm);
And then referencing this coordinate by coordinate (centerpoint)
and then applying a shift
transformation, but that does not work either. Any thoughts?
tikz-pgf positioning tikz-pic
New contributor
add a comment |Â
up vote
2
down vote
favorite
I am trying to position an image with rounded corners to a specific position on screen. However, according to the following post, yshift and xshift do not affect nodes that are named and I am still a bit confused on how to use the ++
and if this is the best approach.
Take my current situation:
documentclassarticle
usepackage[utf8]inputenc
usepackagegraphicx
usepackagetikz
usepackage[a4paper,top=3cm, bottom=3cm, left=2cm, right=2cm]geometry
begindocument
begintikzpicture
beginscope
clip [rounded corners=0.7cm] (0,0) rectangle coordinate (centerpoint) (4,4.0cm);
node [inner sep=0pt] at (centerpoint) includegraphics[width=4.0cm]dogesmall.jpg;
draw[line width=0.08cm,rounded corners=0.7cm] (0,0) rectangle (4,4.0cm);
endscope
endtikzpicture
enddocument
(Where "dogesmall.jpg" is my current image)
This produces a result that places the image in the upper left hand corner, as defined by the margins. However, I would like to tweak the position of the tikzpicture without changing the margins like so:
                                           Â
How would I go about accomplishing such a task?
I tried following this post by using the following:
newcommandsetcoordinates
coordinate (centerpoint) at (4,4.0cm);
And then referencing this coordinate by coordinate (centerpoint)
and then applying a shift
transformation, but that does not work either. Any thoughts?
tikz-pgf positioning tikz-pic
New contributor
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I am trying to position an image with rounded corners to a specific position on screen. However, according to the following post, yshift and xshift do not affect nodes that are named and I am still a bit confused on how to use the ++
and if this is the best approach.
Take my current situation:
documentclassarticle
usepackage[utf8]inputenc
usepackagegraphicx
usepackagetikz
usepackage[a4paper,top=3cm, bottom=3cm, left=2cm, right=2cm]geometry
begindocument
begintikzpicture
beginscope
clip [rounded corners=0.7cm] (0,0) rectangle coordinate (centerpoint) (4,4.0cm);
node [inner sep=0pt] at (centerpoint) includegraphics[width=4.0cm]dogesmall.jpg;
draw[line width=0.08cm,rounded corners=0.7cm] (0,0) rectangle (4,4.0cm);
endscope
endtikzpicture
enddocument
(Where "dogesmall.jpg" is my current image)
This produces a result that places the image in the upper left hand corner, as defined by the margins. However, I would like to tweak the position of the tikzpicture without changing the margins like so:
                                           Â
How would I go about accomplishing such a task?
I tried following this post by using the following:
newcommandsetcoordinates
coordinate (centerpoint) at (4,4.0cm);
And then referencing this coordinate by coordinate (centerpoint)
and then applying a shift
transformation, but that does not work either. Any thoughts?
tikz-pgf positioning tikz-pic
New contributor
I am trying to position an image with rounded corners to a specific position on screen. However, according to the following post, yshift and xshift do not affect nodes that are named and I am still a bit confused on how to use the ++
and if this is the best approach.
Take my current situation:
documentclassarticle
usepackage[utf8]inputenc
usepackagegraphicx
usepackagetikz
usepackage[a4paper,top=3cm, bottom=3cm, left=2cm, right=2cm]geometry
begindocument
begintikzpicture
beginscope
clip [rounded corners=0.7cm] (0,0) rectangle coordinate (centerpoint) (4,4.0cm);
node [inner sep=0pt] at (centerpoint) includegraphics[width=4.0cm]dogesmall.jpg;
draw[line width=0.08cm,rounded corners=0.7cm] (0,0) rectangle (4,4.0cm);
endscope
endtikzpicture
enddocument
(Where "dogesmall.jpg" is my current image)
This produces a result that places the image in the upper left hand corner, as defined by the margins. However, I would like to tweak the position of the tikzpicture without changing the margins like so:
                                           Â
How would I go about accomplishing such a task?
I tried following this post by using the following:
newcommandsetcoordinates
coordinate (centerpoint) at (4,4.0cm);
And then referencing this coordinate by coordinate (centerpoint)
and then applying a shift
transformation, but that does not work either. Any thoughts?
tikz-pgf positioning tikz-pic
tikz-pgf positioning tikz-pic
New contributor
New contributor
New contributor
asked 2 hours ago
Dan Hoynoski
1113
1113
New contributor
New contributor
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
Welcome to TeX.SE! Are you looking for overlay
, which allows you to position stuff at absolute coordinates?
documentclassarticle
usepackage[utf8]inputenc
usepackagetikzpagenodes
usepackage[a4paper,top=3cm, bottom=3cm, left=2cm, right=2cm]geometry
begindocument
begintikzpicture[overlay,remember picture]
beginscope
clip [rounded corners=0.7cm] (current page text area.north west) coordinate (centerpoint) rectangle ++(4,-4);
node [inner sep=0pt,anchor=north west] at (centerpoint)
includegraphics[width=4.0cm,height=4cm]example-image-duck;
endscope
draw[line width=0.08cm,rounded corners=0.7cm] (centerpoint) rectangle ++(4,-4);
endtikzpicture
enddocument
If you want to place the image at the upper left corner of the page (rather than the upper left corner of the of the text area), replace (current page text area.north west)
by (current page.north west)
.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
Welcome to TeX.SE! Are you looking for overlay
, which allows you to position stuff at absolute coordinates?
documentclassarticle
usepackage[utf8]inputenc
usepackagetikzpagenodes
usepackage[a4paper,top=3cm, bottom=3cm, left=2cm, right=2cm]geometry
begindocument
begintikzpicture[overlay,remember picture]
beginscope
clip [rounded corners=0.7cm] (current page text area.north west) coordinate (centerpoint) rectangle ++(4,-4);
node [inner sep=0pt,anchor=north west] at (centerpoint)
includegraphics[width=4.0cm,height=4cm]example-image-duck;
endscope
draw[line width=0.08cm,rounded corners=0.7cm] (centerpoint) rectangle ++(4,-4);
endtikzpicture
enddocument
If you want to place the image at the upper left corner of the page (rather than the upper left corner of the of the text area), replace (current page text area.north west)
by (current page.north west)
.
add a comment |Â
up vote
3
down vote
Welcome to TeX.SE! Are you looking for overlay
, which allows you to position stuff at absolute coordinates?
documentclassarticle
usepackage[utf8]inputenc
usepackagetikzpagenodes
usepackage[a4paper,top=3cm, bottom=3cm, left=2cm, right=2cm]geometry
begindocument
begintikzpicture[overlay,remember picture]
beginscope
clip [rounded corners=0.7cm] (current page text area.north west) coordinate (centerpoint) rectangle ++(4,-4);
node [inner sep=0pt,anchor=north west] at (centerpoint)
includegraphics[width=4.0cm,height=4cm]example-image-duck;
endscope
draw[line width=0.08cm,rounded corners=0.7cm] (centerpoint) rectangle ++(4,-4);
endtikzpicture
enddocument
If you want to place the image at the upper left corner of the page (rather than the upper left corner of the of the text area), replace (current page text area.north west)
by (current page.north west)
.
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Welcome to TeX.SE! Are you looking for overlay
, which allows you to position stuff at absolute coordinates?
documentclassarticle
usepackage[utf8]inputenc
usepackagetikzpagenodes
usepackage[a4paper,top=3cm, bottom=3cm, left=2cm, right=2cm]geometry
begindocument
begintikzpicture[overlay,remember picture]
beginscope
clip [rounded corners=0.7cm] (current page text area.north west) coordinate (centerpoint) rectangle ++(4,-4);
node [inner sep=0pt,anchor=north west] at (centerpoint)
includegraphics[width=4.0cm,height=4cm]example-image-duck;
endscope
draw[line width=0.08cm,rounded corners=0.7cm] (centerpoint) rectangle ++(4,-4);
endtikzpicture
enddocument
If you want to place the image at the upper left corner of the page (rather than the upper left corner of the of the text area), replace (current page text area.north west)
by (current page.north west)
.
Welcome to TeX.SE! Are you looking for overlay
, which allows you to position stuff at absolute coordinates?
documentclassarticle
usepackage[utf8]inputenc
usepackagetikzpagenodes
usepackage[a4paper,top=3cm, bottom=3cm, left=2cm, right=2cm]geometry
begindocument
begintikzpicture[overlay,remember picture]
beginscope
clip [rounded corners=0.7cm] (current page text area.north west) coordinate (centerpoint) rectangle ++(4,-4);
node [inner sep=0pt,anchor=north west] at (centerpoint)
includegraphics[width=4.0cm,height=4cm]example-image-duck;
endscope
draw[line width=0.08cm,rounded corners=0.7cm] (centerpoint) rectangle ++(4,-4);
endtikzpicture
enddocument
If you want to place the image at the upper left corner of the page (rather than the upper left corner of the of the text area), replace (current page text area.north west)
by (current page.north west)
.
answered 1 hour ago
marmot
63.1k468135
63.1k468135
add a comment |Â
add a comment |Â
Dan Hoynoski is a new contributor. Be nice, and check out our Code of Conduct.
Dan Hoynoski is a new contributor. Be nice, and check out our Code of Conduct.
Dan Hoynoski is a new contributor. Be nice, and check out our Code of Conduct.
Dan Hoynoski 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%2f454066%2fhow-to-move-tikzpicture-with-named-nodes%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