考虑下面这幅打开的书的图片,我根据发表在如何在乳胶中生成开放的圣经图像?---
该图像是由 Latex 代码生成的:
\documentclass{article}
\usepackage{tikz}
\newcommand{\openbook}[1][black]
{\begin{tikzpicture}
\fill[#1] (-0.4,0) rectangle (0.4,0.6) (180:0.03cm) arc (180:360:0.03cm);
\begin{pgfinterruptboundingbox}
\draw[line width=0.02cm,#1,fill=white,miter limit=1]
(0,0.03) to[controls={+(150:0.15cm) and +(25:0.15cm)}] (-0.36,0.04) --
(-0.36,0.64) to[controls={+(25:0.15cm) and +(150:0.15cm)}]
(0,0.6) to[controls={+(30:0.15cm) and +(155:0.15cm)}] (0.36,0.64) --
(0.36,0.04) to[controls={+(155:0.15cm) and +(30:0.15cm)}]
(0,0.03) -- (0,0.6);
\end{pgfinterruptboundingbox}
\end{tikzpicture}}
\begin{document}
\thispagestyle{empty}
\scalebox{15}{\openbook[brown]}
\Large
\vspace*{-245pt}\hskip 30pt \begin{minipage}{1.75in}
Here are words.
\vskip 10pt
\hskip 12pt I would like to be able to add even more words---so that they appear as a natural part of this open book illustration.
\vskip 10pt
\hskip 12pt Thank you.
\end{minipage}
\end{document}
问题:有人能告诉我如何在图片上添加一些文字,让它们在显示的页面上以自然的方式“拱起”吗?另外,我不知道我是否以最便捷的方式(使用小页面和这个结合空间和跳过)---任何有关改进的建议都将受到赞赏。
谢谢。
答案1
你可以用 TikZ 文本装饰获得类似于你喜欢的东西:
\documentclass{article}
\usepackage{geometry}
\usepackage{tikz}
\usetikzlibrary{decorations.text}
\tikzset{mydecor/.style 2 args={decoration={text along path,
text align={left indent=2em},
text={|\Large|#2},
},
yshift=#1,
decorate}}
\begin{document}
\thispagestyle{empty}
\begin{tikzpicture}
\fill[brown] (-6,0) rectangle (6,9) (180:0.45cm) arc (180:360:0.45cm);
\draw[line width=0.3cm,brown,fill=white,miter limit=1]
(0,0.45) to[controls={+(150:2.25cm) and +(25:2.25cm)}] (-5.4,0.6) --
(-5.4,9.6) to[controls={+(25:2.25cm) and +(150:2.25cm)}]
(0,9) to[controls={+(30:2.25cm) and +(155:2.25cm)}] (5.4,9.6) --
(5.4,0.6) to[controls={+(155:2.25cm) and +(30:2.25cm)}]
(0,0.45) -- (0,9);
% Left page
\path[mydecor={-7ex}{Here are the words}] (-5.4,9.6) to[controls={+(25:2.25cm) and +(150:2.25cm)}] (0,9);
\path[mydecor={-7ex-2\baselineskip}{This is not perfect}] (-5.4,9.6) to[controls={+(25:2.25cm) and +(150:2.25cm)}] (0,9);
\path[mydecor={-7ex-4\baselineskip}{but it could be}] (-5.4,9.6) to[controls={+(25:2.25cm) and +(150:2.25cm)}] (0,9);
\path[mydecor={-7ex-6\baselineskip}{an approximation}] (-5.4,9.6) to[controls={+(25:2.25cm) and +(150:2.25cm)}] (0,9);
\path[mydecor={-7ex-8\baselineskip}{of what you like.}] (-5.4,9.6) to[controls={+(25:2.25cm) and +(150:2.25cm)}] (0,9);
% Right page
\path[mydecor={-7ex}{You can write also}] (0,9) to[controls={+(30:2.25cm) and +(155:2.25cm)}] (5.4,9.6);
\path[mydecor={-7ex-2\baselineskip}{on the right page,}] (0,9) to[controls={+(30:2.25cm) and +(155:2.25cm)}] (5.4,9.6);
\path[mydecor={-7ex-4\baselineskip}{of course!}] (0,9) to[controls={+(30:2.25cm) and +(155:2.25cm)}] (5.4,9.6);
\end{tikzpicture}
\end{document}