我已经尝试了几个小时来定制简历的 LaTeX 代码,通过在页面的右上角添加图片。
我已经使用了wrapfigure
,但没有帮助。文字仍然与图片重叠。
以下是代码:
\documentclass[a4paper,10pt]{article}
%A Few Useful Packages
\usepackage{marvosym}
\usepackage{fontspec} %for loading fonts
\usepackage{xunicode,xltxtra,url,parskip} %other packages for formatting
\RequirePackage{color,graphicx}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage[big]{layaureo} %better formatting of the A4 page
\usepackage{supertabular} %for Grades
\usepackage{titlesec} %custom \section
%Setup hyperref package, and colours for links
\usepackage{hyperref}
\definecolor{linkcolour}{rgb}{0,0.2,0.6}
\hypersetup{colorlinks,breaklinks,urlcolor=linkcolour, linkcolor=linkcolour}
%FONTS
\defaultfontfeatures{Mapping=tex-text}
%\setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin}
%%% modified for Karol Kozioł for ShareLaTeX use
\setmainfont[
SmallCapsFont = Fontin-SmallCaps.otf,
BoldFont = Fontin-Bold.otf,
ItalicFont = Fontin-Italic.otf
]
{Fontin.otf}
%%%
\titleformat{\section}{\Large\scshape\raggedright}{}{0em}{}[\titlerule]
\titlespacing{\section}{0pt}{3pt}{3pt}
%Tweak a bit the top margin
%\addtolength{\voffset}{-1.3cm}
%Italian hyphenation for the word: ''corporations''
\hyphenation{im-pre-se}
\begin{document}
\pagestyle{empty} % non-numbered pages
\font\fb=''[cmr10]'' %for use with \LaTeX command
%--------------------TITLE-------------
\par{\centering
{\Huge Alessandro \textsc{Plasmati}
}\bigskip\par}
%--------------------SECTIONS-----------------------------------
%Section: Personal Data
\section{Personal Data}
\begin{tabular}{rl}
\textsc{Place and Date of Birth:} & Someplace, Italy | dd Month 1912 \\
\textsc{Address:} & CV Inn 19, 20301, Milano, Italy \\
\textsc{Phone:} & +39 123 456789\\
\textsc{email:} & \href{mailto:[email protected]}
{[email protected]}
\end{tabular}
\end{document}
答案1
此方法使用该fancyhdr
包通过定义新的页面样式将图形放置在右上角。
新样式仅适用于第一页。
\documentclass[a4paper,10pt]{article}
\usepackage{marvosym}
\usepackage{fontspec}
\RequirePackage{xcolor, graphicx}
\usepackage{titlesec} %custom \section
%Setup hyperref package, and colours for links
\usepackage{hyperref}
\definecolor{linkcolour}{rgb}{0,0.2,0.6}
\hypersetup{colorlinks,breaklinks,urlcolor=linkcolour, linkcolor=linkcolour}
\titleformat{\section}{\Large\scshape\raggedright}{}{0em}{}[\titlerule]
\titlespacing{\section}{0pt}{3pt}{3pt}
%Italian hyphenation for the word: ''corporations''
\hyphenation{im-pre-se}
%******************************************** added ,,,,,,,,,,,,
\usepackage{fancyhdr}
\fancypagestyle{FIG}{% Define FIG as a new style
\fancyhf{}
\fancyhead[R]{\includegraphics[width=0.2\linewidth]{example-image}}
}
\renewcommand{\headrulewidth}{0pt}% suppress the line
\fancyheadoffset[R]{2.5cm} %move the header to the right
%********************************************
\begin{document}
\thispagestyle{FIG} % apply FIG style only in this page <<<<<<<<<<<<<<<<<<<<<<<<<<
%--------------------TITLE-------------
\par{\centering
{\Huge Alessandro \textsc{Plasmati}
}\bigskip\par}
%--------------------SECTIONS-----------------------------------
%Section: Personal Data
\section{Personal Data}
\begin{tabular}{rl}
\textsc{Place and Date of Birth:} & Someplace, Italy | dd Month 1912 \\
\textsc{Address:} & CV Inn 19, 20301, Milano, Italy \\
\textsc{Phone:} & +39 123 456789\\
\textsc{email:} & \href{mailto:[email protected]}
{[email protected]}
\end{tabular}
\end{document}