在简历中添加图片

在简历中添加图片

我的简历的基本代码如下

\documentclass[10pt, a4paper]{article}
\usepackage[
    left = 1.5cm, 
    right = 1.5cm, 
    top = 3cm, 
    bottom = 3cm
]{geometry}
\thispagestyle{empty}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{framed}
\usepackage{enumitem} 
\renewcommand{\labelitemi}{$-$}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
%Manipulation of headers and footers
\usepackage{fancyhdr}
    \pagestyle{fancy}
    %Clear fields
    \fancyhf{}
    %Page numbering in footer
    \fancyfoot[C]{\thepage}
    %Separation line header and footer
    \renewcommand{\footrulewidth}{0.4pt}
    \renewcommand{\headrulewidth}{0pt}  

\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\newcommand{\tabitem}{\llap{$-$}}
\usepackage{array,longtable}

\begin{document}
%Title
\begin{titlepage}
    \thispagestyle{fancy}
    \hrule width \hsize \kern 1mm \hrule width \hsize height 2pt
    \begin{center}
        \Huge \textsc{Curriculum Vitae}
    \end{center}
    \hrule width \hsize height 2pt \kern 1mm \hrule width \hsize 
    \let\endtitlepage\relax
\end{titlepage}

\vspace{1cm}

\begin{longtable}{ll}
\textbf{\textsc{Personal Information}}\\
\textsc{Name} & asdasdasd\\
\textsc{Date of birth} & asdasdas\\
\textsc{Place of birth} & asdasd\\
\textsc{Marital status} & asdasd\\
\textsc{Address} & asdasddf\\
\textsc{Phone} & erwwedsf\\
\textsc{E-mail} & asdsgfghfghg\\
\textsc{Nationality} & Swiss\\
\textsc{GitHub} & \href{https://github.com/TheGeekGreek}{https://github.com/TheGeekGreek}\\
%\columnbreak
%\vspace*{4cm}
%\columnbreak
%\begin{Figure}
%   \includegraphics[scale = 0.2]{profile_picture.jpg}   
%\end{Figure}
\vspace{2mm}\\
\textbf{Work Experience}\\
10.2013 - today & adasdasdsdfsdf.\\
03.2015 - today & sdffgfgfg.\\
\end{longtable}
\end{document}

我认为这是一个开始。但我有两个问题:

  • 我如何实现让表格位于左侧而不是居中?
  • 如何在右上角添加图片,如下所示?

在此处输入图片描述

答案1

你的序言有点混乱。

您可以使用图片模式将照片放置在您最喜欢的位置。

\documentclass[10pt, a4paper]{article}
\usepackage[
    left = 1.5cm, 
    right = 1.5cm, 
    top = 3cm, 
    bottom = 3cm
]{geometry}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{framed}
\usepackage{enumitem} 
\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\usepackage{array,longtable,picture}
\usepackage{hyperref}

\renewcommand{\labelitemi}{--}
\newcommand{\tabitem}{\makebox[0pt][r]{--}}

%Manipulation of headers and footers
\pagestyle{fancy}
%Clear fields
\fancyhf{}
%Page numbering in footer
\fancyfoot[C]{\thepage}
%Separation line header and footer
\renewcommand{\footrulewidth}{0.4pt}
\renewcommand{\headrulewidth}{0pt}  

\setlength{\LTleft}{2em}
\setlength{\LTright}{\fill}

\begin{document}
%Title
\thispagestyle{fancy}

\noindent % 4cm is the picture's width, -6cm by trial and error
\begin{picture}(0,0)
\put(\dimexpr\textwidth-4cm,-6cm){\includegraphics[width=4cm]{duck}}
\end{picture}

\hrule width \hsize \kern 1mm \hrule width \hsize height 2pt

\begin{center}
\Huge \textsc{Curriculum Vitae}
\end{center}

\hrule width \hsize height 2pt \kern 1mm \hrule width \hsize

\vspace{1cm}

\begin{longtable}{ll}
\textit{Personal Information}\\
\textsc{Name} & asdasdasd\\
\textsc{Date of birth} & asdasdas\\
\textsc{Place of birth} & asdasd\\
\textsc{Marital status} & asdasd\\
\textsc{Address} & asdasddf\\
\textsc{Phone} & erwwedsf\\
\textsc{E-mail} & asdsgfghfghg\\
\textsc{Nationality} & Swiss\\
\textsc{GitHub} & \href{https://github.com/TheGeekGreek}{https://github.com/TheGeekGreek}\\
\textit{Work Experience}\\
10.2013 - today & adasdasdsdfsdf.\\
03.2015 - today & sdffgfgfg.\\
\end{longtable}

\end{document}

通过适当设置\LTleft\LTright(默认值\fill),您可以水平移动longtable

不要使用$-$破折号,正确的方式是--;也是\llap一个有风险的命令,最好使用\makebox[0pt][r]{...}

没有必要titlepage

在此处输入图片描述

答案2

环境longtable采用可选参数来指定水平对齐。 在本例中,我们\begin{longtable}[l]{ll} ...指定左对齐。

至于图片,您可以尝试在表中添加一个新列,但这会非常笨重,而且可能需要multirow。也许应该避免这种情况。

另一方面,一种相当非侵入性的但有点过头了解决方案是加载TikZ。在这里我使用了tikzpagenodes在文本区域四个角定义节点的方法,以及 TikZ 库calc将图片放置在顶部和底部之间的可变距离处。

在此处输入图片描述

使用以下代码生成

\documentclass[10pt, a4paper]{article}
\usepackage[
    left = 1.5cm, 
    right = 1.5cm, 
    top = 3cm, 
    bottom = 3cm
]{geometry}
\thispagestyle{empty}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{framed}
\usepackage{enumitem} 
\renewcommand{\labelitemi}{$-$}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
%Manipulation of headers and footers
\usepackage{fancyhdr}
    \pagestyle{fancy}
    %Clear fields
    \fancyhf{}
    %Page numbering in footer
    \fancyfoot[C]{\thepage}
    %Separation line header and footer
    \renewcommand{\footrulewidth}{0.4pt}
    \renewcommand{\headrulewidth}{0pt}  

\usepackage{booktabs}% http://ctan.org/pkg/booktabs
\newcommand{\tabitem}{\llap{$-$}}
\usepackage{array,longtable}

\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{tikzpagenodes}

\begin{document}
%Title
\begin{titlepage}
    \thispagestyle{fancy}
    \hrule width \hsize \kern 1mm \hrule width \hsize height 2pt
    \begin{center}
        \Huge \textsc{Curriculum Vitae}
    \end{center}
    \hrule width \hsize height 2pt \kern 1mm \hrule width \hsize 
    \let\endtitlepage\relax
\end{titlepage}

\begin{tikzpicture}[remember picture,overlay]
    \node [left] at ($(current page text area.north east)!0.2!(current page text area.south east)$) {\includegraphics[width=0.2\linewidth]{duck}};
\end{tikzpicture}

\vspace{1cm}

\begin{longtable}[l]{ll}
\textbf{\textsc{Personal Information}}\\
\textsc{Name} & asdasdasd\\
\textsc{Date of birth} & asdasdas\\
\textsc{Place of birth} & asdasd\\
\textsc{Marital status} & asdasd\\
\textsc{Address} & asdasddf\\
\textsc{Phone} & erwwedsf\\
\textsc{E-mail} & asdsgfghfghg\\
\textsc{Nationality} & Swiss\\
\textsc{GitHub} & \href{https://github.com/TheGeekGreek}{https://github.com/TheGeekGreek}\\
\vspace{2mm}\\
\textbf{Work Experience}\\
10.2013 - today & adasdasdsdfsdf.\\
03.2015 - today & sdffgfgfg.\\
\end{longtable}
\end{document}

其他人也许能够演示一种更简单的方法来添加图像,而无需借助像这样的大型软件包TikZ

相关内容