
원형 그림 주위에 텍스트를 감쌌습니다. 그림을 원형으로 감싸는 텍스트와 함께 페이지 중앙으로 가져와 그림의 위치를 수평으로 조정해야 합니다.
\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은 항상 하이픈을 연결하는 것이 어려웠습니다.
\holeshape
pgfmath를 사용하여 설정하려고 했지만 \edef
. OTOH, 정의를 파일에 쓰고 다시 읽는 것이 가능해야 합니다.
\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}