使用 .sty 文件在简历中使用图像

使用 .sty 文件在简历中使用图像

我想问一下如何添加照片以及姓名和信息。

我的 tex 文件和 .sty 文件附件如下。


\usepackage{paralist,datetime}
\usepackage{hyperref,fancyhdr,enumitem,color}
\usepackage[a4paper,text={17.5cm,25.5cm},centering]{geometry}
\usepackage[compact,small,sf,bf]{titlesec}
\usepackage{kpfonts,dsfont}

\sloppy

\pagestyle{fancy}
\lhead{\sf ccc: \@name}
\rhead{\sf\thepage}
\cfoot{}


\def\name#1{\def\@name{#1}}
\def\info#1{\def\@info{#1}}
\newcommand{\shadebox}[3][.9]{\fcolorbox[gray]{0}{#1}{\parbox{#2}{#3}}}

\def\maketitle{
\thispagestyle{plain}
\vspace*{-1.4cm}
\shadebox[0.9]{17.3cm}{\sf\color[rgb]{.6,0,0}
\hbox to 17cm{\begin{tabular}{p{7.4cm}}
\LARGE\textbf{\@name}\\[0.3cm]
\Large\textbf{Curriculum Vitae}\\[0.6cm]
\normalsize\today
\end{tabular}
\hfill\hbox{\fontsize{9}{12}\sf
\begin{tabular}{@{}rp{7.2cm}@{}}
\@info
\end{tabular}}}
}
\vspace*{0.2cm}}

\titlelabel{}
\titlespacing{\section}{0pt}{2ex}{1ex}
\titleformat*{\section}{\color[rgb]{0.6,0,0}\large\sf\bfseries}
\titlespacing{\subsection}{0pt}{1ex}{0.5ex}

\setlength{\parskip}{0ex}
\setlength{\parindent}{0em}
\setlength{\headheight}{15pt}
\setlength{\tabcolsep}{0.15cm}
\clubpenalty = 10000
\widowpenalty = 10000
\setlist{itemsep=1pt}
\setdescription{labelwidth=1.2cm,leftmargin=1.5cm,labelindent=1.5cm,font=\rm}

myCV.tex 文件:

\documentclass[a4paper,11pt]{article}
\usepackage{/Users/sushilchauhan/cv/cv}
\usepackage{setspace}
\usepackage{multicol}
\usepackage{url}
\usepackage{hyperref}
\usepackage{color,soul}
\usepackage{longtable}
\definecolor{lightgray}{gray}{0.85}
\sethlcolor{lightgray}
\def\met{\mbox{${\hbox{$E$\kern-0.45em\lower-.1ex\hbox{\bf{/}}}}_T$}~} 

\name{Dr. XYZ}
\info{Address: & XYZ\\
        phone: & XYZ}

\begin{document}

\vspace{25pt}
\maketitle

\end{document}

答案1

%========== cv.sty ==========
\usepackage{paralist,datetime}
\usepackage{hyperref,fancyhdr,enumitem,color}
\usepackage[a4paper,text={17.5cm,25.5cm},centering]{geometry}
\usepackage[compact,small,sf,bf]{titlesec}
\usepackage{kpfonts,dsfont}
\usepackage{graphicx}

\sloppy

\pagestyle{fancy}
\lhead{\sf ccc: \@name}
\rhead{\sf\thepage}
\cfoot{}


\def\name#1{\def\@name{#1}}
\def\info#1{\def\@info{#1}}
\def\photo#1{\def\@photo{#1}}
\newcommand{\shadebox}[3][.9]{\fcolorbox[gray]{0}{#1}{\parbox{#2}{#3}}}

\def\maketitle{
\thispagestyle{plain}
\vspace*{-1.4cm}
\shadebox[0.9]{17.3cm}{\sf\color[rgb]{.6,0,0}
\hbox to 17cm{\begin{tabular}{p{7.0cm}}
\LARGE\textbf{\@name}\\[0.3cm]
\Large\textbf{Curriculum Vitae}\\[0.6cm]
\normalsize\today
\end{tabular}
\hbox{\fontsize{9}{12}\sf
\begin{tabular}{@{}rp{5.0cm}@{}}
\@info
\end{tabular}}
%
\hfill\hbox{
\begin{tabular}{@{}rp{3.0cm}@{}}
\includegraphics[width=3cm]{\@photo}
\end{tabular}}
%
}
}
\vspace*{0.2cm}}

\titlelabel{}
\titlespacing{\section}{0pt}{2ex}{1ex}
\titleformat*{\section}{\color[rgb]{0.6,0,0}\large\sf\bfseries}
\titlespacing{\subsection}{0pt}{1ex}{0.5ex}

\setlength{\parskip}{0ex}
\setlength{\parindent}{0em}
\setlength{\headheight}{15pt}
\setlength{\tabcolsep}{0.15cm}
\clubpenalty = 10000
\widowpenalty = 10000
\setlist{itemsep=1pt}
\setdescription{labelwidth=1.2cm,leftmargin=1.5cm,labelindent=1.5cm,font=\rm}

photo您只需通过宏添加图片即可

\documentclass[a4paper,11pt]{article}
\usepackage{cv}
\usepackage{setspace}
\usepackage{multicol}
\usepackage{url}
\usepackage{hyperref}
\usepackage{color,soul}
\usepackage{longtable}
\definecolor{lightgray}{gray}{0.85}
\sethlcolor{lightgray}
\def\met{\mbox{${\hbox{$E$\kern-0.45em\lower-.1ex\hbox{\bf{/}}}}_T$}~} 

\name{Dr. XYZ}
\info{Address: & XYZ\\
        phone: & XYZ}
\photo{example-image-10x16}

\begin{document}

\vspace{25pt}
\maketitle

\end{document}

在此处输入图片描述

相关内容