bend text between ellipsoids
I want to have some text aligned to the center of the top or bottom of an ellipse. I've tried
documentclass[border=0.5]standalone
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackagemathtools,amsmath
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usetikzlibrarydecorations.text
begindocument
begintikzpicture
draw (0,0) ellipse [x radius=3, y radius = 2];
draw (0,0) ellipse [red,x radius=4, y radius = 2.66];
draw(0,0) ++(-3.5,0) [decorate,decoration=text along path, text=This text should be between the eppelipses in the bottom half] arc [start angle=-160, end angle=-10, x radius=3.5, y radius = 3];
draw(0,0) ++(-3.5,0) [decorate,decoration=text along path, text= This text should be centered and in the top half] arc [start angle=160, end angle=10, x radius=3.5, y radius = 4];
node at (0,0) center text;
endtikzpicture
enddocument
I get
tikz-pgf alignment
add a comment |
I want to have some text aligned to the center of the top or bottom of an ellipse. I've tried
documentclass[border=0.5]standalone
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackagemathtools,amsmath
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usetikzlibrarydecorations.text
begindocument
begintikzpicture
draw (0,0) ellipse [x radius=3, y radius = 2];
draw (0,0) ellipse [red,x radius=4, y radius = 2.66];
draw(0,0) ++(-3.5,0) [decorate,decoration=text along path, text=This text should be between the eppelipses in the bottom half] arc [start angle=-160, end angle=-10, x radius=3.5, y radius = 3];
draw(0,0) ++(-3.5,0) [decorate,decoration=text along path, text= This text should be centered and in the top half] arc [start angle=160, end angle=10, x radius=3.5, y radius = 4];
node at (0,0) center text;
endtikzpicture
enddocument
I get
tikz-pgf alignment
add a comment |
I want to have some text aligned to the center of the top or bottom of an ellipse. I've tried
documentclass[border=0.5]standalone
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackagemathtools,amsmath
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usetikzlibrarydecorations.text
begindocument
begintikzpicture
draw (0,0) ellipse [x radius=3, y radius = 2];
draw (0,0) ellipse [red,x radius=4, y radius = 2.66];
draw(0,0) ++(-3.5,0) [decorate,decoration=text along path, text=This text should be between the eppelipses in the bottom half] arc [start angle=-160, end angle=-10, x radius=3.5, y radius = 3];
draw(0,0) ++(-3.5,0) [decorate,decoration=text along path, text= This text should be centered and in the top half] arc [start angle=160, end angle=10, x radius=3.5, y radius = 4];
node at (0,0) center text;
endtikzpicture
enddocument
I get
tikz-pgf alignment
I want to have some text aligned to the center of the top or bottom of an ellipse. I've tried
documentclass[border=0.5]standalone
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackagemathtools,amsmath
usepackagetikz
usepackagepgfplots
pgfplotssetcompat=1.15
usetikzlibrarydecorations.text
begindocument
begintikzpicture
draw (0,0) ellipse [x radius=3, y radius = 2];
draw (0,0) ellipse [red,x radius=4, y radius = 2.66];
draw(0,0) ++(-3.5,0) [decorate,decoration=text along path, text=This text should be between the eppelipses in the bottom half] arc [start angle=-160, end angle=-10, x radius=3.5, y radius = 3];
draw(0,0) ++(-3.5,0) [decorate,decoration=text along path, text= This text should be centered and in the top half] arc [start angle=160, end angle=10, x radius=3.5, y radius = 4];
node at (0,0) center text;
endtikzpicture
enddocument
I get
tikz-pgf alignment
tikz-pgf alignment
edited Aug 28 '18 at 13:45
AndréC
10.5k11548
10.5k11548
asked Aug 28 '18 at 12:46
Thorbjørn E. K. ChristensenThorbjørn E. K. Christensen
1,107422
1,107422
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I guess you need to run the arc over the full length and also account for the height of the text. EDIT: Added text align=center
, another big thanks to Max!
documentclass[border=0.5]standalone
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackagemathtools,amsmath
usepackagetikz
usetikzlibrarydecorations.text
begindocument
begintikzpicture
draw (0,0) ellipse [x radius=3, y radius = 2];
draw (0,0) ellipse [red,x radius=4, y radius = 2.66];
pgfmathsetmacromyx(3.5cm+height("T")*0.5pt)*1pt/1cm
pgfmathsetmacromyy(2.33cm+height("T")*0.5pt)*1pt/1cm
draw [decorate,decoration=text along path,text align=center,
text=This text should be between the ellipses in the bottom half]
(-myx,0) arc [start angle=-180, end angle=00, x radius=myx, y radius = myy];
pgfmathsetmacromyx(3.5cm-height("T")*0.5pt)*1pt/1cm
pgfmathsetmacromyy(2.33cm-height("T")*0.5pt)*1pt/1cm
draw [decorate,decoration=text along path,text align=center,
text= This text
should be centered and in the top half]
(180:myx and myy) arc [start angle=180,
end angle=0, x radius=myx, y radius = myy];
node at (0,0) center text;
endtikzpicture
enddocument
I forgot to adjust the y radius, will do that in a bit.
– marmot
Aug 28 '18 at 13:04
The thing is that I want to center both to the shell, but also such that the center of the text is on the highest/lowest point on the eppelipse
– Thorbjørn E. K. Christensen
Aug 28 '18 at 13:05
@ThorbjørnE.K.Christensen Sorry, need to run now. Either someone else takes over or I'll do in a few hours.
– marmot
Aug 28 '18 at 13:29
No worries ;-) I'm not in a hurry
– Thorbjørn E. K. Christensen
Aug 28 '18 at 13:30
2
@ThorbjørnE.K.Christensen You can addtext align=center
to the decoration options. Also see section 48.6 of the pgf manual, there are a lot of cool options.
– Max
Aug 28 '18 at 14:49
|
show 1 more 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%2f448133%2fbend-text-between-ellipsoids%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
I guess you need to run the arc over the full length and also account for the height of the text. EDIT: Added text align=center
, another big thanks to Max!
documentclass[border=0.5]standalone
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackagemathtools,amsmath
usepackagetikz
usetikzlibrarydecorations.text
begindocument
begintikzpicture
draw (0,0) ellipse [x radius=3, y radius = 2];
draw (0,0) ellipse [red,x radius=4, y radius = 2.66];
pgfmathsetmacromyx(3.5cm+height("T")*0.5pt)*1pt/1cm
pgfmathsetmacromyy(2.33cm+height("T")*0.5pt)*1pt/1cm
draw [decorate,decoration=text along path,text align=center,
text=This text should be between the ellipses in the bottom half]
(-myx,0) arc [start angle=-180, end angle=00, x radius=myx, y radius = myy];
pgfmathsetmacromyx(3.5cm-height("T")*0.5pt)*1pt/1cm
pgfmathsetmacromyy(2.33cm-height("T")*0.5pt)*1pt/1cm
draw [decorate,decoration=text along path,text align=center,
text= This text
should be centered and in the top half]
(180:myx and myy) arc [start angle=180,
end angle=0, x radius=myx, y radius = myy];
node at (0,0) center text;
endtikzpicture
enddocument
I forgot to adjust the y radius, will do that in a bit.
– marmot
Aug 28 '18 at 13:04
The thing is that I want to center both to the shell, but also such that the center of the text is on the highest/lowest point on the eppelipse
– Thorbjørn E. K. Christensen
Aug 28 '18 at 13:05
@ThorbjørnE.K.Christensen Sorry, need to run now. Either someone else takes over or I'll do in a few hours.
– marmot
Aug 28 '18 at 13:29
No worries ;-) I'm not in a hurry
– Thorbjørn E. K. Christensen
Aug 28 '18 at 13:30
2
@ThorbjørnE.K.Christensen You can addtext align=center
to the decoration options. Also see section 48.6 of the pgf manual, there are a lot of cool options.
– Max
Aug 28 '18 at 14:49
|
show 1 more comment
I guess you need to run the arc over the full length and also account for the height of the text. EDIT: Added text align=center
, another big thanks to Max!
documentclass[border=0.5]standalone
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackagemathtools,amsmath
usepackagetikz
usetikzlibrarydecorations.text
begindocument
begintikzpicture
draw (0,0) ellipse [x radius=3, y radius = 2];
draw (0,0) ellipse [red,x radius=4, y radius = 2.66];
pgfmathsetmacromyx(3.5cm+height("T")*0.5pt)*1pt/1cm
pgfmathsetmacromyy(2.33cm+height("T")*0.5pt)*1pt/1cm
draw [decorate,decoration=text along path,text align=center,
text=This text should be between the ellipses in the bottom half]
(-myx,0) arc [start angle=-180, end angle=00, x radius=myx, y radius = myy];
pgfmathsetmacromyx(3.5cm-height("T")*0.5pt)*1pt/1cm
pgfmathsetmacromyy(2.33cm-height("T")*0.5pt)*1pt/1cm
draw [decorate,decoration=text along path,text align=center,
text= This text
should be centered and in the top half]
(180:myx and myy) arc [start angle=180,
end angle=0, x radius=myx, y radius = myy];
node at (0,0) center text;
endtikzpicture
enddocument
I forgot to adjust the y radius, will do that in a bit.
– marmot
Aug 28 '18 at 13:04
The thing is that I want to center both to the shell, but also such that the center of the text is on the highest/lowest point on the eppelipse
– Thorbjørn E. K. Christensen
Aug 28 '18 at 13:05
@ThorbjørnE.K.Christensen Sorry, need to run now. Either someone else takes over or I'll do in a few hours.
– marmot
Aug 28 '18 at 13:29
No worries ;-) I'm not in a hurry
– Thorbjørn E. K. Christensen
Aug 28 '18 at 13:30
2
@ThorbjørnE.K.Christensen You can addtext align=center
to the decoration options. Also see section 48.6 of the pgf manual, there are a lot of cool options.
– Max
Aug 28 '18 at 14:49
|
show 1 more comment
I guess you need to run the arc over the full length and also account for the height of the text. EDIT: Added text align=center
, another big thanks to Max!
documentclass[border=0.5]standalone
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackagemathtools,amsmath
usepackagetikz
usetikzlibrarydecorations.text
begindocument
begintikzpicture
draw (0,0) ellipse [x radius=3, y radius = 2];
draw (0,0) ellipse [red,x radius=4, y radius = 2.66];
pgfmathsetmacromyx(3.5cm+height("T")*0.5pt)*1pt/1cm
pgfmathsetmacromyy(2.33cm+height("T")*0.5pt)*1pt/1cm
draw [decorate,decoration=text along path,text align=center,
text=This text should be between the ellipses in the bottom half]
(-myx,0) arc [start angle=-180, end angle=00, x radius=myx, y radius = myy];
pgfmathsetmacromyx(3.5cm-height("T")*0.5pt)*1pt/1cm
pgfmathsetmacromyy(2.33cm-height("T")*0.5pt)*1pt/1cm
draw [decorate,decoration=text along path,text align=center,
text= This text
should be centered and in the top half]
(180:myx and myy) arc [start angle=180,
end angle=0, x radius=myx, y radius = myy];
node at (0,0) center text;
endtikzpicture
enddocument
I guess you need to run the arc over the full length and also account for the height of the text. EDIT: Added text align=center
, another big thanks to Max!
documentclass[border=0.5]standalone
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackagemathtools,amsmath
usepackagetikz
usetikzlibrarydecorations.text
begindocument
begintikzpicture
draw (0,0) ellipse [x radius=3, y radius = 2];
draw (0,0) ellipse [red,x radius=4, y radius = 2.66];
pgfmathsetmacromyx(3.5cm+height("T")*0.5pt)*1pt/1cm
pgfmathsetmacromyy(2.33cm+height("T")*0.5pt)*1pt/1cm
draw [decorate,decoration=text along path,text align=center,
text=This text should be between the ellipses in the bottom half]
(-myx,0) arc [start angle=-180, end angle=00, x radius=myx, y radius = myy];
pgfmathsetmacromyx(3.5cm-height("T")*0.5pt)*1pt/1cm
pgfmathsetmacromyy(2.33cm-height("T")*0.5pt)*1pt/1cm
draw [decorate,decoration=text along path,text align=center,
text= This text
should be centered and in the top half]
(180:myx and myy) arc [start angle=180,
end angle=0, x radius=myx, y radius = myy];
node at (0,0) center text;
endtikzpicture
enddocument
edited Aug 28 '18 at 17:07
answered Aug 28 '18 at 13:02
marmotmarmot
111k5140264
111k5140264
I forgot to adjust the y radius, will do that in a bit.
– marmot
Aug 28 '18 at 13:04
The thing is that I want to center both to the shell, but also such that the center of the text is on the highest/lowest point on the eppelipse
– Thorbjørn E. K. Christensen
Aug 28 '18 at 13:05
@ThorbjørnE.K.Christensen Sorry, need to run now. Either someone else takes over or I'll do in a few hours.
– marmot
Aug 28 '18 at 13:29
No worries ;-) I'm not in a hurry
– Thorbjørn E. K. Christensen
Aug 28 '18 at 13:30
2
@ThorbjørnE.K.Christensen You can addtext align=center
to the decoration options. Also see section 48.6 of the pgf manual, there are a lot of cool options.
– Max
Aug 28 '18 at 14:49
|
show 1 more comment
I forgot to adjust the y radius, will do that in a bit.
– marmot
Aug 28 '18 at 13:04
The thing is that I want to center both to the shell, but also such that the center of the text is on the highest/lowest point on the eppelipse
– Thorbjørn E. K. Christensen
Aug 28 '18 at 13:05
@ThorbjørnE.K.Christensen Sorry, need to run now. Either someone else takes over or I'll do in a few hours.
– marmot
Aug 28 '18 at 13:29
No worries ;-) I'm not in a hurry
– Thorbjørn E. K. Christensen
Aug 28 '18 at 13:30
2
@ThorbjørnE.K.Christensen You can addtext align=center
to the decoration options. Also see section 48.6 of the pgf manual, there are a lot of cool options.
– Max
Aug 28 '18 at 14:49
I forgot to adjust the y radius, will do that in a bit.
– marmot
Aug 28 '18 at 13:04
I forgot to adjust the y radius, will do that in a bit.
– marmot
Aug 28 '18 at 13:04
The thing is that I want to center both to the shell, but also such that the center of the text is on the highest/lowest point on the eppelipse
– Thorbjørn E. K. Christensen
Aug 28 '18 at 13:05
The thing is that I want to center both to the shell, but also such that the center of the text is on the highest/lowest point on the eppelipse
– Thorbjørn E. K. Christensen
Aug 28 '18 at 13:05
@ThorbjørnE.K.Christensen Sorry, need to run now. Either someone else takes over or I'll do in a few hours.
– marmot
Aug 28 '18 at 13:29
@ThorbjørnE.K.Christensen Sorry, need to run now. Either someone else takes over or I'll do in a few hours.
– marmot
Aug 28 '18 at 13:29
No worries ;-) I'm not in a hurry
– Thorbjørn E. K. Christensen
Aug 28 '18 at 13:30
No worries ;-) I'm not in a hurry
– Thorbjørn E. K. Christensen
Aug 28 '18 at 13:30
2
2
@ThorbjørnE.K.Christensen You can add
text align=center
to the decoration options. Also see section 48.6 of the pgf manual, there are a lot of cool options.– Max
Aug 28 '18 at 14:49
@ThorbjørnE.K.Christensen You can add
text align=center
to the decoration options. Also see section 48.6 of the pgf manual, there are a lot of cool options.– Max
Aug 28 '18 at 14:49
|
show 1 more 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%2f448133%2fbend-text-between-ellipsoids%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