Adds support for CJK, and removes the need to manuall call \recomputelengths

This commit is contained in:
Xavier Danaux
2011-11-17 19:17:16 +01:00
parent b0eaa123ba
commit f3a9342230
10 changed files with 67 additions and 56 deletions

View File

@ -1,13 +1,18 @@
version 0.14 (xx November 2011)
- adds support for CJK, thanks to the help of P. D'Apice.
- the use of \recomputelengths after modifying any length in the preamble is now
unnecessary; \recomputelength is automatically called at the start of the document.
version 0.13.1 (11 November 2011)
- correct a bug introduced by v0.13 in the classic style when no \photo is used,
as reported by S. Gislais (launchpad bug #888702).
version 0.13 (06 November 2011)
- added a "black" color option to render the resume in black & white, as suggested
by F. Bicarri.
by F. Bicarri.
- removed the pdflatex option when loading hyperref to enable other engines
(e.g., dvips, xetex), leftover from the v 0.11 cleanup, as reported by
K. Amaterasu and P. Mavrogiorgos (launchpad bugs #754693 and #859834).
(e.g., dvips, xetex), leftover from the v 0.11 cleanup, as reported by
K. Amaterasu and P. Mavrogiorgos (launchpad bugs #754693 and #859834).
- added a "purple" color option, as proposed by B. Ravel.
- added a 3rd optional argument to the \photo command to control the thickness of
the framebox. Setting it to 0pt will disable the frame around the photo, as

View File

@ -1,5 +1,5 @@
- The \cvsection command seems to be unable to handle a Chinese argument, using
CJK.
- When using CJK, the last \clearpage required for fancyhdr to work properly kills
the "lastpage" counter, hence also the page numbering.
- Moderncv produces an error ("lonely \item--perhaps a missing list environment")
when used with bibentry, through the output is actually correct. Amongst other,
this causes compilation by LyX to stop.

Binary file not shown.

View File

@ -10,16 +10,16 @@
% moderncv themes
\moderncvtheme[blue]{casual} % optional argument are 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'roman' (for roman fonts, instead of sans serif fonts)
%\moderncvtheme[green]{classic} % idem
%\moderncvtheme[green]{classic} % idem
% character encoding
\usepackage[utf8]{inputenc} % replace by the encoding you are using
%\usepackage{CJKutf8} % if you need to use CJK to typeset your resume in Chinese, Japanese or Korean
% adjust the page margins
\usepackage[scale=0.8]{geometry}
%\setlength{\hintscolumnwidth}{3cm} % if you want to change the width of the column with the dates
%\AtBeginDocument{\setlength{\maketitlenamewidth}{6cm}} % only for the classic theme, if you want to change the width of your name placeholder (to leave more space for your address details
%\AtBeginDocument{\recomputelengths} % required when changes are made to page layout lengths
%\setlength{\hintscolumnwidth}{3cm} % if you want to change the width of the column with the dates
%\setlength{\maketitlenamewidth}{10cm}} % only for the classic theme, if you want to change the width of your name placeholder (to leave more space for your address details
% personal data
\firstname{John}
@ -32,7 +32,7 @@
\email{email (optional)} % optional, remove the line if not wanted
\homepage{homepage (optional)} % optional, remove the line if not wanted
\extrainfo{additional information (optional)} % optional, remove the line if not wanted
\photo[64pt][0.4pt]{picture} % '64pt' is the height the picture must be resized to, 0.4pt is the thickness of the frame around it (put it to 0pt for no frame) and 'picture' is the name of the picture file; optional, remove the line if not wanted
\photo[64pt][0.4pt]{picture} % '64pt' is the height the picture must be resized to, 0.4pt is the thickness of the frame around it (put it to 0pt for no frame) and 'picture' is the name of the picture file; optional, remove the line if not wanted
\quote{Some quote (optional)} % optional, remove the line if not wanted
% to show numerical labels in the bibliography; only useful if you make citations in your resume
@ -49,6 +49,7 @@
% content
%----------------------------------------------------------------------------------
\begin{document}
%\begin{CJK*}{UTF8}{gbsn} % to typeset your resume in Chinese using CJK
\maketitle
\section{Education}
@ -101,9 +102,9 @@ Detailed achievements:%
\section{Extra 1}
\cvlistitem{Item 1}
\cvlistitem{Item 2}
\cvlistitem[+]{Item 3} % optional other symbol
\cvlistitem[+]{Item 3} % optional other symbol
\renewcommand{\listitemsymbol}{-} % change the symbol for lists
\renewcommand{\listitemsymbol}{-} % change the symbol for lists
\section{Extra 2}
\cvlistdoubleitem{Item 1}{Item 4}
@ -113,17 +114,18 @@ Detailed achievements:%
% Publications from a BibTeX file without multibib\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}% for BibTeX numerical labels
\nocite{*}
\bibliographystyle{plain}
\bibliography{publications} % 'publications' is the name of a BibTeX file
\bibliography{publications} % 'publications' is the name of a BibTeX file
% Publications from a BibTeX file using the multibib package
%\section{Publications}
%\nocitebook{book1,book2}
%\bibliographystylebook{plain}
%\bibliographybook{publications} % 'publications' is the name of a BibTeX file
%\bibliographybook{publications} % 'publications' is the name of a BibTeX file
%\nocitemisc{misc1,misc2,misc3}
%\bibliographystylemisc{plain}
%\bibliographymisc{publications} % 'publications' is the name of a BibTeX file
%\bibliographymisc{publications} % 'publications' is the name of a BibTeX file
%\clearpage\end{CJK*} % if you are typesetting your resume in Chinese using CJK; the \clearpage is required for fancyhdr to work correctly with CJK, though it kills the page numbering by making \lastpage undefined
\end{document}

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -125,7 +125,7 @@
% load hyperred at the end of the preamble to pass options required by loaded packages (like CJK)
\AtEndPreamble{
\@ifpackageloaded{CJK}
{\RequirePackage[CJKbookmarks]{hyperref}}
{\RequirePackage[unicode]{hyperref}}
{\RequirePackage{hyperref}}
\AtBeginDocument{
\hypersetup{
@ -170,8 +170,8 @@
\setlength\lineskip{1\p@}
\setlength\normallineskip{1\p@}
\renewcommand\baselinestretch{}
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}
\setlength{\parindent}{0\p@}
\setlength{\parskip}{0\p@}
\setlength\columnsep{10\p@}
\setlength\columnseprule{0\p@}
\setlength\fboxsep{3\p@}
@ -232,12 +232,16 @@
\providecommand*{\subsectionstyle}[1]{{\subsectionfont\color{subsectioncolor}#1}}
\providecommand*{\hintstyle}[1]{{\hintfont\color{hintcolor}#1}}
% themes: casual (default), classic, ...
% makes the cv title
\newcommand*{\maketitle}{}%
\title{}% to avoid LaTeX complaining that \maketitle is a called without first a call to \title
% makes the cv footer
\newcommand*{\makefooter}
% loads a style
\newcommand*{\moderncvtheme}[2][]{
\def\@moderncvtheme{#2}
\def\@moderncvthemeoptions{#1}}
\moderncvtheme{casual}% default theme
\AtEndPreamble{\RequirePackage[\@moderncvthemeoptions]{moderncvtheme\@moderncvtheme}}
\RequirePackage[#1]{moderncvtheme#2}}
%-------------------------------------------------------------------------------
@ -296,11 +300,7 @@
\renewcommand{\headwidth}{\textwidth}%
\recomputethemelengths}
\setlength{\hintscolumnwidth}{0.15\textwidth}
\recomputelengths
% makes the cv title
%\newcommand*{\maketitle}{}%
\title{}% to avoid LaTeX complaining that \maketitle is a called without first a call to \title
\AtBeginDocument{\recomputelengths}
% draws a colored rectangle
% usage: \colorrule[optional height]{width}

View File

@ -123,26 +123,6 @@
% styles
% maketitle
\renewcommand*{\maketitle}{%
{%
\ifthenelse{\isundefined{\@photo}}%
{}%
{%
\setlength\fboxrule{\@photoframewidth}%
\ifdim\@photoframewidth=0pt%
\setlength{\fboxsep}{0pt}\fi%
{\color{firstnamecolor}\framebox{\includegraphics[width=\@photowidth]{\@photo}}}}%
\hfill%
% \raggedleft{\firstnamestyle{\MakeLowercase{\@firstname}}\familynamestyle{\MakeLowercase{\@familyname}}}\\[-.35em]}%
\raggedleft{\firstnamestyle{\@firstname}~\familynamestyle{\@familyname}}\\[-.35em]}%
{\color{firstnamecolor}\rule{\textwidth}{.25ex}\\[2.5em]}%
% optional quote
\ifthenelse{\isundefined{\@quote}}%
{}%
{{\centering{}\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
\par}% to avoid weird spacing bug at the first section if no blank line is left after \maketitle
% cv footer
\newif\if@firstfooterelement\@firstfooterelementtrue
\providecommand*{\footersymbol}{}
@ -150,7 +130,6 @@
\if@firstfooterelement%
\else%
{ ~~\color{footersymbolcolor}\textbullet~~~}\fi}
\providecommand*{\makefooter}{}
\renewcommand*{\makefooter}{%
\fancypagestyle{plain}{%
\fancyfoot[c]{%
@ -169,7 +148,27 @@
\ifthenelse{\isundefined{\@extrainfo}}{}{\footersymbol\@extrainfo\@firstfooterelementfalse}}}%
}%
\pagestyle{plain}}
\AtBeginDocument{\makefooter}
% maketitle
\renewcommand*{\maketitle}{%
\makefooter{}%
{%
\ifthenelse{\isundefined{\@photo}}%
{}%
{%
\setlength\fboxrule{\@photoframewidth}%
\ifdim\@photoframewidth=0pt%
\setlength{\fboxsep}{0pt}\fi%
{\color{firstnamecolor}\framebox{\includegraphics[width=\@photowidth]{\@photo}}}}%
\hfill%
% \raggedleft{\firstnamestyle{\MakeLowercase{\@firstname}}\familynamestyle{\MakeLowercase{\@familyname}}}\\[-.35em]}%
\raggedleft{\firstnamestyle{\@firstname}~\familynamestyle{\@familyname}}\\[-.35em]}%
{\color{firstnamecolor}\rule{\textwidth}{.25ex}\\[2.5em]}%
% optional quote
\ifthenelse{\isundefined{\@quote}}%
{}%
{{\centering{}\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}%
\par}% to avoid weird spacing bug at the first section if no blank line is left after \maketitle
\endinput

View File

@ -123,14 +123,11 @@
% styles
% maketitle
% setmaketitlenamemaxwidth to the full name length, capped by \maketitlenamemaxwidth
% set \maketitlenamewidth to the desired length, or leave it up to moderncv to try to optimize it
\newlength{\maketitlenamemaxwidth}
\setlength{\maketitlenamemaxwidth}{.525\textwidth}
\newlength{\maketitlenamefullwidth}
\settowidth{\maketitlenamefullwidth}{\firstnamestyle{\@firstname~}\familynamestyle{\@familyname}}
\newlength{\maketitlenamewidth}
\ifnum\maketitlenamemaxwidth<\maketitlenamefullwidth\setlength{\maketitlenamewidth}{\maketitlenamemaxwidth}\else\setlength{\maketitlenamewidth}{\maketitlenamefullwidth}\fi
% other lengths
\setlength{\maketitlenamewidth}{0pt}
\newlength{\maketitlepicturewidth}
\newlength{\maketitledetailswidth}
% recompute theme-specific lengths, called by class to recompute all lengths
@ -142,7 +139,6 @@
{\setlength{\maketitlepicturewidth}{\@photowidth}
\addtolength{\maketitledetailswidth}{-\separatorcolumnwidth}%
\addtolength{\maketitledetailswidth}{-\maketitlepicturewidth}}}
\recomputethemelengths
\newif\if@firstdetailselement\@firstdetailselementtrue
\newcommand*{\maketitledetailsnewline}{
\if@firstdetailselement%
@ -150,6 +146,15 @@
\else%
\\[.2em]\fi}
\renewcommand*{\maketitle}{%
% recompute lengths (necessary to delay the computation of \maketitlenamefullwidth until \maketitle because of potential CJK requirement in \@firstname and \@familyname)
\ifdim\maketitlenamewidth=0pt%
\newlength{\maketitlenamefullwidth}%
\settowidth{\maketitlenamefullwidth}{\firstnamestyle{\@firstname~}\familynamestyle{\@familyname}}%
\ifnum\maketitlenamemaxwidth<\maketitlenamefullwidth%
\setlength{\maketitlenamewidth}{\maketitlenamemaxwidth}%
\else%
\setlength{\maketitlenamewidth}{\maketitlenamefullwidth}\fi\fi
\recomputethemelengths{}%
% name and title
\begin{minipage}[b]{\maketitlenamewidth}%
\firstnamestyle{\@firstname~}\familynamestyle{\@familyname}%