表格中的文本未对齐

表格中的文本未对齐

我是绝对的乳胶新手,在创建简历时遇到了一些困难。我从网上找到的模板开始,一点一点地调整它以进行微调,但我遇到了表格对齐问题,我已经花了几个小时试图解决它。基本上,看起来我的表格中的年份值溢出到了边距中。我在这里附上了一张图片: https://ibb.co/k1hS0v1

然后我还有另一个无法真正解决的问题,为什么“关于我”和“体验”部分之间有这么大的空白?

这里的空间比教育和技能之间的空间要大得多。

我的乳胶代码是:

\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=1cm,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]}]

%@{\extracolsep{\fill}} breaks it...


% \newcommand{\cventry}[3]{
%  \begin{tabular*}{\textwidth}{ p{10cm} r}
%     {#1} & {#2} \\%
%     {#3} &\\%
%  \end{tabular*}  
%}

 \newcommand{\cventry}[3]{
  \begin{tabular*}{\textwidth}{@{\extracolsep{1cm}} p{10cm} r}
      {\bfseries #1} & {#2} \\%
      {#3} &\\%
  \end{tabular*}

}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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}}
    {\Sep\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{figure}
    \hfill
    \includegraphics[width=0.6\columnwidth]{photo}
    \vspace{-7cm}
\end{figure}

\begin{flushright}\small
    Name name \\
    \url{[email protected]}  \\
%   \url{www.howtotex.com} \\
    (xx) xxxxxx
\end{flushright}\normalsize
\framebreak


% Right frame
%%%%%%%%%%%%%%%%%%%%
\Huge\bfseries {\color{RoyalBlue} Name name} \\
\Large\bfseries  Current function \\

\normalsize\normalfont

% 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}
\vspace*{1.5mm}
\noindent
\cventry{master 1}{2017--2019}{school}
\vspace*{1.5mm}
\noindent
\\
\cventry{master 1}{2017--Present}{school}
\vspace*{1.5mm}
\noindent

% Education
\section{Education}
\cventry{master 1}{2017--2020}{school}
\vspace*{1.5mm}
\noindent
\cventry{master 1}{2017--2019}{school}
\vspace*{1.5mm}
\noindent
\\
\cventry{master 1}{2017--Present}{school}
\vspace*{1.5mm}
\noindent

% Skills
\CVSection{Skills}
\CVItem{Platforms}
\begin{multicols}{3}
\begin{compactitem}[\color{RoyalBlue}$\circ$]
    \item Lorem 
    \item Ipsum 
\end{compactitem}
\end{multicols}
\SmallSep

\CVItem{Computer software}
\begin{multicols}{3}
\begin{compactitem}[\color{RoyalBlue}$\circ$]
    \item Lorem 
    \item Ipsum 
    \item Dolor 
    \item Sit 
    \item Amet
    \item Consectetur 
    \item Adipiscing 
    \item Elit
    \item \ldots
\end{compactitem}
\end{multicols}
\Sep 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% End document
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}

答案1

我重新定义\cventrytabularx{\linewidth}

\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=1cm,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{1cm}}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}}
    {\Sep\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{figure}
    \hfill
    \includegraphics[width=0.6\columnwidth]{photo}
    \vspace{-7cm}
\end{figure}

\begin{flushright}\small
    Name name \\
    \url{[email protected]} \\
% \url{www.howtotex.com} \\
    (xx) xxxxxx
\end{flushright}\normalsize
\framebreak

% Right frame
%%%%%%%%%%%%%%%%%%%%
\Huge\bfseries {\color{RoyalBlue} Name name} \\
\Large\bfseries Current function \\

\normalsize\normalfont

% 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}
\vspace*{1.5mm}
\cventry{master 1}{2017--2019}{school}
\vspace*{1.5mm}
\cventry{master 1}{2017--Present}{school}
\vspace*{1.5mm}
\noindent

% Education
\section{Education}
\cventry{master 1}{2017--2020}{school}
\vspace*{1.5mm}
\cventry{master 1}{2017--2019}{school}
\vspace*{1.5mm}
\cventry{master 1}{2017--Present}{school}
\vspace*{1.5mm}
\noindent

% Skills
\CVSection{Skills}
\CVItem{Platforms}
\begin{multicols}{3}
\begin{compactitem}[\color{RoyalBlue}$\circ$]
 \item Lorem
 \item Ipsum
\end{compactitem}
\end{multicols}
\SmallSep

\CVItem{Computer software}
\begin{multicols}{3}
\begin{compactitem}[\color{RoyalBlue}$\circ$]
 \item Lorem
 \item Ipsum
 \item Dolor
 \item Sit
 \item Amet
 \item Consectetur
 \item Adipiscing
 \item Elit
 \item \ldots
\end{compactitem}
\end{multicols}
\Sep

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% End document
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document} 

在此处输入图片描述

答案2

我只关注你的定义\cventry。尝试以下重新设计是否能解决你的问题:

\newcommand{\cventry}[3]{%
\begin{tabular*}{\linewidth}{@{} p{10cm}  % <---
    >{\raggedleft\arraybackslash}p{\dimexpr\linewidth-10cm-2\tabcolsep\relax} % <---
                             @{}}         % <---
\bfseries #1    & #2    \\
#3              &       \\
\end{tabular*}\par\vspace*{1.5mm}         % <---
}

上述解决方案可行,在序言中您需要加载包array。我使用以下 MWE 测试了它的工作原理:

\documentclass[a4paper,12pt,final]{memoir}
\setlength{\parindent}{0pt}         % no paragraph indentation
                                    % consequently in the document are all 
                                    % \noindet commands superfluous
\usepackage{array}

\newcommand{\cventry}[3]{%
\begin{tabular*}{\linewidth}{@{} p{10cm}  
    >{\raggedleft\arraybackslash}p{\dimexpr\linewidth-10cm-2\tabcolsep\relax}
                             @{}}
\bfseries #1    & #2    \\
#3              &       \\
\end{tabular*}\par\vspace*{1.5mm}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Begin document
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\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}


\vspace*{1.5mm}
\noindent
\cventry{master 1}{2017--2019}{school}

\vspace*{1.5mm}
\noindent
\cventry{master 1}{2017--Present}{school}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% End document
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}

这使。

在此处输入图片描述

(红线表示页面布局)

请在您的真实文档中进行测试,是否会获得相同的结果\cventry

相关内容