
円形の図の周りにテキストを折り返しました。テキストを円形に折り返した図をページの中央に移動して、図の位置を水平に調整する必要があります。
\hspace*{-5cm}\includegraphics
... が動作しません。どうすればいいですか?
\documentclass{article}
\usepackage{lipsum}
\usepackage{graphicx,wrapfig}
\begin{document}
\null\hfill\smash{
\raisebox{\dimexpr-\height+\baselineskip}{%
\includegraphics[width=2in]{magmag2.png}}}%
\par\vspace*{\dimexpr-\baselineskip-\parskip}%
\parshape 12 0pt 0.7\textwidth
0pt \dimexpr0.5\textwidth+4.5\baselineskip\relax
0pt \dimexpr0.5\textwidth+3.75\baselineskip\relax
0pt \dimexpr0.5\textwidth+3.25\baselineskip\relax
0pt \dimexpr0.5\textwidth+3.00\baselineskip\relax
0pt \dimexpr0.5\textwidth+3.0\baselineskip\relax
0pt \dimexpr0.5\textwidth+3.20\baselineskip\relax
0pt \dimexpr0.5\textwidth+3.5\baselineskip\relax
0pt \dimexpr0.5\textwidth+4.25\baselineskip\relax
0pt \dimexpr0.5\textwidth+6.0\baselineskip\relax
0pt \dimexpr0.5\textwidth+6.75\baselineskip\relax
0pt \textwidth
\noindent\lipsum[1]
\end{document}
答え1
これは、ある程度の余裕を持たせるために、穴の半径を 1.1 インチとしています。lipsum はハイフンで区切るのが難しいことに注意してください。
pgfmath を使用して設定しようとしました\holeshape
が、は使用できません\edef
。一方、定義をファイルに書き込んで読み戻すことはできるはずです。
\documentclass{article}
\usepackage{lipsum}
\usepackage{shapepar}
\usepackage{tikz}
\usepackage{showframe}
\marginparsep=0.5in
\def\holeshape{{14.375}% h center
{0}b{0}\\
{0}t{0}{28.75}\\
{1}t{0}{11.566}st{17.184}{11.566}\\
{2}t{0}{10.029}t{18.721}{10.029}\\
{3}t{0}{9.0941}t{19.655}{9.0941}\\
{4}t{0}{8.4684}t{20.281}{8.4684}\\
{5}t{0}{8.0593}t{20.690}{8.0593}\\
{6}t{0}{7.836}t{20.924}{7.826}\\
{7}t{0}{7.750}t{20.999}{7.750}\\
{8}t{0}{7.836}t{20.924}{7.826}\\
{9}t{0}{8.0593}t{20.690}{8.0593}\\
{10}t{0}{8.4684}t{20.281}{8.4684}\\
{11}t{0}{9.0941}t{19.655}{9.0941}\\
{12}t{0}{10.029}t{18.721}{10.029}\\
{13}t{0}{11.566}jt{17.184}{11.566}\\
{14}t{0}{28.75}\\
{16}t{0}{28.75}\\
{16}e{28.75}}
\begin{document}
By using \verb|\baselineskip| as the scale, one can use $\sqrt{r^2-n^2}$ for $n=0,1,\dots$
to compute the offset startng at the center.
radius = \pgfmathparse{1.1in/\baselineskip}\pgfmathresult\par
text width = \pgfmathparse{\textwidth/\baselineskip}\pgfmathresult
\noindent\begin{tikzpicture}[overlay,baseline=(origin)]
\coordinate (origin) at (0,3pt);% ad hoc fudge factor
\draw (0.5\textwidth,-7\baselineskip) circle[radius=1in];
\end{tikzpicture}%
\shapepar[\baselineskip]{\holeshape}\lipsum[1]
\end{document}
答え2
\documentclass{article}
\usepackage{lipsum}
\usepackage{shapepar}
\usepackage{tikz}
%\usepackage{showframe}
\marginparsep=0.5in
\def\holeshape{{14.375}% h center
{0}b{0}\\
{0}t{0}{28.75}\\
{1}t{0}{11.566}st{17.184}{11.566}\\
{2}t{0}{10.029}t{18.721}{10.029}\\
{3}t{0}{9.0941}t{19.655}{9.0941}\\
{4}t{0}{8.4684}t{20.281}{8.4684}\\
{5}t{0}{8.0593}t{20.690}{8.0593}\\
{6}t{0}{7.836}t{20.924}{7.826}\\
{7}t{0}{7.750}t{20.999}{7.750}\\
{8}t{0}{7.836}t{20.924}{7.826}\\
{9}t{0}{8.0593}t{20.690}{8.0593}\\
{10}t{0}{8.4684}t{20.281}{8.4684}\\
{11}t{0}{9.0941}t{19.655}{9.0941}\\
{12}t{0}{10.029}t{18.721}{10.029}\\
{13}t{0}{11.566}jt{17.184}{11.566}\\
{14}t{0}{28.75}\\
{16}t{0}{28.75}\\
{16}e{28.75}}
\begin{document}
By using \verb|\baselineskip| as the scale, one can use $\sqrt{r^2-n^2}$ for
$n=0,1,\dots$
to compute the offset starting at the center.
radius = \pgfmathparse{1.1in/\baselineskip}\pgfmathresult\par
text width = \pgfmathparse{\textwidth/\baselineskip}\pgfmathresult
\noindent\begin{tikzpicture}[overlay,baseline=(origin)]
\coordinate (origin) at (0,3pt);% ad hoc fudge factor
\fill [white] (0.5\textwidth,-7\baselineskip) circle[radius=1in];
\node[inner sep=0pt] (magmag2) at (6,-3)[opacity=1]
{\includegraphics[width=.4\textwidth]{magmag2.png}
};
\end{tikzpicture}%
\shapepar[\baselineskip]{\holeshape}\lipsum[1]
\end{document}