我试图将图形放置在一些文本的右侧,并环绕图形。
但是当我编写以下代码时,图形最终出现在文本后面(在左边?!)。为什么这不起作用?
谢谢。
\documentclass[letterpaper,11pt,oneside]{article}
\usepackage[utf8]{inputenc}
\usepackage{setspace}
\usepackage{hyperref}
\usepackage[ampersand]{easylist}
\usepackage{graphicx}
\usepackage[danish]{babel}
\usepackage{longtable}
\graphicspath{ {images/}}
\usepackage{wrapfig}
\usepackage[left=0.9in, right=1in, bottom=1.25in, top=1.25in]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\chead{Name \\ Address \\ Phone \textbar \hspace{0cm} Mail}
\end{center}}
\renewcommand{\familydefault}{\sfdefault}
\pagenumbering{gobble}
\begin{document}
\vspace*{0.5cm}
\centering\LARGE{\textbf{Curriculum Vitae}} \\
\normalsize
\noindent \flushleft \subsection*{\Large{Profile}}\\
\begin{wrapfigure}{R}{0.3\textwidth}
\centering
\includegraphics[width=0.25\textwidth]{Foto.jpg}
\end{wrapfigure}
The text I wish to wrap around the figure.
\end{document}
答案1
输入中存在几个错误,其中大多数会在日志中生成错误或警告,一旦修复,wrapfiggure 就会按预期工作。主要错误是您不能在列表中使用 wrapfigure,并且误用的命令\flushleft
会启动列表环境。
\documentclass[letterpaper,11pt,oneside]{article}
\usepackage[utf8]{inputenc}
\usepackage{setspace}
\usepackage{hyperref}
\usepackage[ampersand]{easylist}
\usepackage{graphicx}
\usepackage[danish]{babel}
\usepackage{longtable}
\graphicspath{ {images/}}
\usepackage{wrapfig}
\usepackage[left=0.9in, right=1in, bottom=1.25in, top=1.25in]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\chead{Name \\ Address \\ Phone \textbar \hspace{0cm} Mail}
\renewcommand{\familydefault}{\sfdefault}
\pagenumbering{gobble}
\begin{document}
\vspace*{0.5cm}
%NO! \centering\LARGE{\textbf{Curriculum Vitae}} \\
{\centering\LARGE\textbf{Curriculum Vitae}\par}
%NO! \\
\normalsize
%NO!\noindent
%NO! \flushleft
\subsection*{\Large{Profile}}
%NO!\\
\begin{wrapfigure}{R}{0.3\textwidth}
\centering
\includegraphics[width=0.25\textwidth]{example-image}
\end{wrapfigure}
The text I wish to wrap around the figure.
The text I wish to wrap around the figure.
The text I wish to wrap around the figure.
The text I wish to wrap around the figure.
\end{document}