Chinaunix首页 | 论坛 | 博客
  • 博客访问: 202722
  • 博文数量: 77
  • 博客积分: 1749
  • 博客等级: 上尉
  • 技术积分: 810
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-28 18:27
文章分类
文章存档

2012年(28)

2011年(49)

分类: LINUX

2012-09-25 21:28:42

遇到两个分块,通常默认换行排放,倘若想要并排,使用一个总的minipage将其合并:
\begin{minipage}[b]{\textwidth}%
\begin{minipage}[b]{\maketitlenamewidth}%
{\firstnamestyle{\@firstname~}\familynamestyle{\@familyname}%
\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}}%
\maketitledetailsnewline%
\maketitledetailsnewline%
\addressfont\color{addresscolor}%
\maketitledetailsnewline%
\begin{tabular*}{0.1in}[b]{l} %6.5in decides width of the tabular  @{\extracolsep{\fill}}r
{\fontsize{12}{14}\texttt{Reference Number: 123456}} \\
{\small \texttt{}} \\
{\small \texttt{Email: \href{mailto:anitawang1989@gmail.com}{anitawang1989@gmail.com}}} \\ \\
{\texttt{State Key Labatoray for Novel Software Technology,}}  \\
{\small \texttt{Nanjing University, Nanjing, Jiangsu, China, 210046}}
\end{tabular*}%
\end{minipage}%
\ifthenelse{\isundefined{\@photo}}%
{}%
{\hspace*{\maketitledetailswidth}\color{sectionrectanglecolor}\framebox{\includegraphics[width=\maketitlepicturewidth]{\@photo}}}\\[2em]%
\end{minipage}%


在譬如cventry、cvline等处,想要换行以便更好看,但是使用\\会出现}错误,则使用:
\newline

设置宽度,以及两个长度相减得到另一个长度:
\newlength{\makeschoolname}
\settowidth{\makeschoolname}{#3}
\newlength{\makeprojectname}
\setlength{\makeprojectname}{\maincolumnwidth}%
  \addtolength{\makeprojectname}{-\makeschoolname}

一个表项中设置两行:
\newcommand*{\cvdoubleentry}[3]{% 参数个数
  \cvline{#1}{%
\newlength{\makeschoolname}
\settowidth{\makeschoolname}{#3}
\newlength{\makeprojectname}
\setlength{\makeprojectname}{\maincolumnwidth}%
  \addtolength{\makeprojectname}{-\makeschoolname}%
\begin{minipage}[t]{\makeprojectname}%
{#2}%
\end{minipage}%
\begin{minipage}[t]{\makeschoolname}%
{\raggedleft#3}%
\end{minipage}%
}}%

注意,上面的内容是错误的,如果使用多个cvdoubleentry的话,会出现makeschoolname已定义的错误。修正版如下:
\newlength{\makeschoolname}%
\setlength{\makeschoolname}{.01in}%
\newlength{\makeprojectname}%
\setlength{\makeprojectname}{\maincolumnwidth}%
  \addtolength{\makeprojectname}{-\makeschoolname}%
\newcommand*{\cvdoubleentry}[3]{%
  \cvline{#1}{%
\begin{minipage}[t]{\makeprojectname}%
{#2}%
\end{minipage}%
\begin{minipage}[t]{\makeschoolname}%
{\raggedright#3}%
\end{minipage}%
}}%
阅读(2222) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~