我正在用 LaTex 制作简历,在对齐一些文本时遇到了一些困难。请参阅以下代码:
\documentclass[a4paper,12pt,final]{memoir}
% misc
\renewcommand{\familydefault}{bch} % font
\pagestyle{empty} % no pagenumbering
\setlength{\parindent}{0pt} % no paragraph indentation
% required packages (add your own)
\usepackage{flowfram} % column layout
\usepackage{hyperref}
\usepackage[top=1cm,left=0.5cm,right=1cm,bottom=1cm]{geometry}% margins
\usepackage{graphicx} % figures
\usepackage{url} % URLs
\usepackage[usenames,dvipsnames]{xcolor} % color
\usepackage{multicol} % columns env.
\setlength{\multicolsep}{0pt}
\usepackage{paralist} % compact lists
\usepackage{tikz}
\RequirePackage{titlesec}
\titleformat{\section}{\Large\bfseries\upshape\color{RoyalBlue}}{}{0em}{}[{\titlerule[2pt]}]
\newcommand{\cventry}[3]{%
\begin{tabularx}{\linewidth}{@{}X@{\hspace{0.5cm}}r@{}}%@{\extracolsep{1cm}}
{\bfseries #1} & {#2} \\%
{#3} &\\%
\end{tabularx}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Create column layout
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% define length commands
\setlength{\vcolumnsep}{\baselineskip}
\setlength{\columnsep}{\vcolumnsep}
% frame setup (flowfram package)
% left frame
\newflowframe{0.2\textwidth}{\textheight}{0pt}{0pt}[left]
\newlength{\LeftMainSep}
\setlength{\LeftMainSep}{0.2\textwidth}
\addtolength{\LeftMainSep}{1\columnsep}
% small static frame for the vertical line
\newstaticframe{1.5pt}{\textheight}{\LeftMainSep}{0pt}
% content of the static frame
\begin{staticcontents}{1}
\hfill
\tikz{%
\draw[loosely dotted,color=RoyalBlue,line width=1.5pt,yshift=0]
(0,0) -- (0,\textheight);}%
\hfill\mbox{}
\end{staticcontents}
% right frame
\addtolength{\LeftMainSep}{1.5pt}
\addtolength{\LeftMainSep}{1\columnsep}
\newflowframe{0.7\textwidth}{\textheight}{\LeftMainSep}{0pt}[main01]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% define macros (for convience)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\Sep}{\vspace{1.5em}}
\newcommand{\SmallSep}{\vspace{0.5em}}
\newenvironment{AboutMe}
{\ignorespaces\textbf{\color{RoyalBlue} About me}}
{\SmallSep\ignorespacesafterend}
\newenvironment{Objective}
{\ignorespaces\textbf{\color{RoyalBlue} Objective}}
{\SmallSep\ignorespacesafterend}
\newcommand{\CVSection}[1]
{\Large\textbf{#1}\par
\SmallSep\normalsize\normalfont}
\newcommand{\CVItem}[1]
{\textbf{\color{RoyalBlue} #1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Begin document
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
% Left frame
%%%%%%%%%%%%%%%%%%%%
\begin{flushright}
\begin{figure}
\hfill
\includegraphics[width=0.6\columnwidth]{photo}
\vspace{-7cm}
\end{figure}
\footnotesize{ \href{https://www.google.be/}{xxxxxx yyyyyyyyyyyyy}} \\
\scriptsize{[email protected]} \\
\scriptsize{+xx yyy xx xx xx} \\
\scriptsize{xx years} \\
\SmallSep
\scriptsize{WallStreet 10} \\
\scriptsize{New York} \\
\scriptsize{USA} \\
\Sep
\textbf{\color{RoyalBlue} \raggedright{Languages}} \\
\begin{compactitem}[\color{RoyalBlue}$\circ$]
\item \scriptsize{Spanish}
\item \scriptsize{English}
\item \scriptsize{French} \\ \tiny{(Elementary proficiency)}
\end{compactitem}
\end{flushright}\normalsize
\framebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% End document
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
因此,所有内容都放在这个 flushright 标签中,但我想从这个 flush 中排除“语言”标题,但还不能这样做。
此外,理想情况下,我想将这些项目的项目符号稍微向右缩进一点,以便它与图片下方的名称的缩进相同。
如果我只是从最后几行中删除 flushright,它会把所有内容都弄乱,并且文本会放置在图片上等。
答案1
尝试\textbf{\textcolor{RoyalBlue}{Languages}}\hfill~\\
。
我也擅自纠正了您的代码:
\footnotesize
和\scriptsize
类似字体大小是开关,而不是环境。我纠正了它们的所有错误用法- 我改变了你的定义
\cventry
- 我为第二列添加了文本(从我对您上一个问题的回答中复制而来),您可以在其中看到使用修改后的定义的优点
\cventry
- 在序言中,将包移到
hyperref
已加载包的末尾,并删除包,url
因为它是\hyperref
完整的 MWE,具有更改字体大小的正确方法:
\documentclass[a4paper,12pt,final]{memoir}
% misc
\renewcommand{\familydefault}{bch} % font
\pagestyle{empty} % no pagenumbering
\setlength{\parindent}{0pt} % no paragraph indentation
% required packages (add your own)
\usepackage{flowfram} % column layout
\usepackage[top=1cm,left=0.5cm,right=1cm,bottom=1cm]{geometry}% margins
\usepackage{graphicx} % figures
\usepackage[usenames,dvipsnames]{xcolor} % color
\usepackage{multicol} % columns env.
\setlength{\multicolsep}{0pt}
\usepackage{paralist} % compact lists
\usepackage{tikz}
\usepackage{hyperref}
\RequirePackage{titlesec}
\titleformat{\section}{\Large\bfseries\upshape\color{RoyalBlue}}{}{0em}{}[{\titlerule[2pt]}]
\newcommand{\cventry}[3]{% modified, considered is my answer to your previous
\begin{tabularx}{\linewidth}{@{} X @{\hspace{1cm}} r @{}}
\bfseries #1 & #2 \\
#3 & \\
\end{tabularx}\par\vspace*{1.5mm}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Create column layout
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% define length commands
\setlength{\vcolumnsep}{\baselineskip}
\setlength{\columnsep}{\vcolumnsep}
% frame setup (flowfram package)
% left frame
\newflowframe{0.2\textwidth}{\textheight}{0pt}{0pt}[left]
\newlength{\LeftMainSep}
\setlength{\LeftMainSep}{0.2\textwidth}
\addtolength{\LeftMainSep}{1\columnsep}
% small static frame for the vertical line
\newstaticframe{1.5pt}{\textheight}{\LeftMainSep}{0pt}
% content of the static frame
\begin{staticcontents}{1}
\hfill
\tikz{%
\draw[loosely dotted,color=RoyalBlue,line width=1.5pt,yshift=0]
(0,0) -- (0,\textheight);}%
\hfill\mbox{}
\end{staticcontents}
% right frame
\addtolength{\LeftMainSep}{1.5pt}
\addtolength{\LeftMainSep}{1\columnsep}
\newflowframe{0.7\textwidth}{\textheight}{\LeftMainSep}{0pt}[main01]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% define macros (for convience)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\Sep}{\vspace{1.5em}}
\newcommand{\SmallSep}{\vspace{0.5em}}
\newenvironment{AboutMe}
{\ignorespaces\textbf{\color{RoyalBlue} About me}}
{\SmallSep\ignorespacesafterend}
\newenvironment{Objective}
{\ignorespaces\textbf{\color{RoyalBlue} Objective}}
{\SmallSep\ignorespacesafterend}
\newcommand{\CVSection}[1]
{\Large\textbf{#1}\par
\SmallSep\normalsize\normalfont}
\newcommand{\CVItem}[1]
{\textbf{\color{RoyalBlue} #1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Begin document
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
% Left frame
%%%%%%%%%%%%%%%%%%%%
\begin{flushright}
\begin{figure}
\hfill
\includegraphics[width=0.6\columnwidth]{photo}
\end{figure}
\footnotesize
\href{https://www.google.be/}{xxxxxx yyyyyyyyyyyyy} \\
\scriptsize
[email protected] \\
+xx yyy xx xx xx \\
xx years \\
\SmallSep
WallStreet 10 \\
New York \\
USA \\
\Sep
\footnotesize
\textbf{\textcolor{RoyalBlue}{Languages}}\hfill~ \\ % <----
\scriptsize
\begin{compactitem}[\color{RoyalBlue}$\circ$]
\item Spanish
\item English
\item Frenc\\ \tiny(Elementary proficiency)
\end{compactitem}
\end{flushright}\vfill\normalsize
\framebreak
% About me
\begin{AboutMe}
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s
\end{AboutMe}
% Experience
\section{Experience}
\cventry{master 1}{2017--2020}{school}
\cventry{master 1}{2017--2019}{school}
\cventry{master 1}{2017--Present}{school}
\section{Education}
\cventry{master 1}{2017--2020}{school}
\cventry{master 1}{2017--2019}{school}
\cventry{master 1}{2017--Present}{school}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% End document
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
答案2
嗯,这里有两个主要问题:
要将文本语言移至左侧,请使用命令
\textbf{\color{RoyalBlue}{Languages}}\hfill~ \\% <==================
为了获得更多空间,以便能够在一行中打印非常长的电子邮件而不超出页边距,只需使用以下代码放大简历中的第一列:
\newflowframe{0.25\textwidth}{\textheight}{0pt}{0pt}[left] % <=========== .2 -> .25 \newlength{\LeftMainSep} \setlength{\LeftMainSep}{0.25\textwidth} % <========================= .2 -> .25 \addtolength{\LeftMainSep}{1\columnsep}
您的代码中还有更多问题,例如,
\RequirePackage
而不是正确的\usepackage
,或者您使用了\scriptsize
错误的命令,它们是开关,这意味着在调用后\scriptsize
保持不变,直到您使用新命令更改字体大小(如\footnotesize
或其他)。或者您使用像这样的组{\scriptsize ...}
,那么字体大小仅用于内部的文本{...}
。请注意,我使用了选项showframe
来geometry
可视化输入区域和边距。现在您可以检查您的电子邮件是否进入左边距。对于您的真实文档,请评论此选项!并且请使用值来-5cm
获得命令中图像和以下个人信息之间的适当空间\vspace{-5cm} % <=================================================== -7cm -> -5cm
请参阅以下更正的 MWE
\documentclass[a4paper,12pt,final]{memoir}
% misc
\renewcommand{\familydefault}{bch} % font
\pagestyle{empty} % no pagenumbering
\setlength{\parindent}{0pt} % no paragraph indentation
% required packages (add your own)
\usepackage{flowfram} % column layout
\usepackage[%
top=1cm,left=0.5cm,right=1cm,bottom=1cm,
showframe % <=========================================================
]{geometry}% margins
\usepackage{graphicx} % figures
\usepackage[usenames,dvipsnames]{xcolor} % color
\usepackage{multicol} % columns env.
\setlength{\multicolsep}{0pt}
\usepackage{paralist} % compact lists
\usepackage{tikz}
\usepackage{titlesec} % <===============================================
\usepackage{url} % URLs
\usepackage{hyperref} % <===============================================
\titleformat{\section}{\Large\bfseries\upshape\color{RoyalBlue}}{}{0em}{}[{\titlerule[2pt]}]
\newcommand{\cventry}[3]{%
\begin{tabularx}{\linewidth}{@{}X@{\hspace{0.5cm}}r@{}}%@{\extracolsep{1cm}}
{\bfseries #1} & {#2} \\%
{#3} &\\%
\end{tabularx}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Create column layout
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% define length commands
\setlength{\vcolumnsep}{\baselineskip}
\setlength{\columnsep}{\vcolumnsep}
% frame setup (flowfram package)
% left frame
\newflowframe{0.25\textwidth}{\textheight}{0pt}{0pt}[left] % <=========== .2 -> .25
\newlength{\LeftMainSep}
\setlength{\LeftMainSep}{0.25\textwidth} % <========================= .2 -> .25
\addtolength{\LeftMainSep}{1\columnsep}
% small static frame for the vertical line
\newstaticframe{1.5pt}{\textheight}{\LeftMainSep}{0pt}
% content of the static frame
\begin{staticcontents}{1}
\hfill
\tikz{%
\draw[loosely dotted,color=RoyalBlue,line width=1.5pt,yshift=0]
(0,0) -- (0,\textheight);}%
\hfill\mbox{}
\end{staticcontents}
% right frame
\addtolength{\LeftMainSep}{1.5pt}
\addtolength{\LeftMainSep}{1\columnsep}
\newflowframe{0.7\textwidth}{\textheight}{\LeftMainSep}{0pt}[main01]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% define macros (for convience)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\Sep}{\vspace{1.5em}}
\newcommand{\SmallSep}{\vspace{0.5em}}
\newenvironment{AboutMe}
{\ignorespaces\textbf{\color{RoyalBlue} About me}}
{\SmallSep\ignorespacesafterend}
\newenvironment{Objective}
{\ignorespaces\textbf{\color{RoyalBlue} Objective}}
{\SmallSep\ignorespacesafterend}
\newcommand{\CVSection}[1]
{\Large\textbf{#1}\par
\SmallSep\normalsize\normalfont}
\newcommand{\CVItem}[1]
{\textbf{\color{RoyalBlue} #1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Begin document
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
% Left frame
%%%%%%%%%%%%%%%%%%%%
\begin{flushright}
\begin{figure}
\hfill
\includegraphics[width=0.6\columnwidth]{photo}
\vspace{-5cm} % <=================================================== -7cm -> -5cm
\end{figure}
\footnotesize % <===================================================
\href{https://www.google.be/}{xxxxxx yyyyyyyyyyyyy} \\
\scriptsize % <=====================================================
[email protected] \\
+xx yyy xx xx xx \\
xx years \\
\SmallSep
WallStreet 10 \\
New York \\
USA \\
\Sep
\textbf{\color{RoyalBlue}{Languages}}\hfill~ \\% <==================
\begin{compactitem}[\color{RoyalBlue}$\circ$]
\item Spanish
\item English
\item French \\ \tiny (Elementary proficiency)
\end{compactitem}
\hfill
\end{flushright}\normalsize
\framebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% End document
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
并查看其结果: