2

I'm using the Moderncv Classic template. Everything is okay except the recommendation style. I want to replace the style that I have put in the last section of the code. Can you check that why the recommended style is not working?

%% start of file `template.tex'.
%% Copyright 2006-2013 Xavier Danaux ([email protected]).
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c,
% available at http://www.latex-project.org/lppl/.


\documentclass[11pt,a4paper,sans]{moderncv}        % possible options include font size ('10pt', '11pt' and '12pt'), paper size ('a4paper', 'letterpaper', 'a5paper', 'legalpaper', 'executivepaper' and 'landscape') and font family ('sans' and 'roman')

% moderncv themes
\moderncvstyle{classic}                             % style options are 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{green}                               % color options 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'
%\renewcommand{\familydefault}{\sfdefault}         % to set the default font; use '\sfdefault' for the default sans serif font, '\rmdefault' for the default roman one, or any tex font name
%\nopagenumbers{}                                  % uncomment to suppress automatic page numbering for CVs longer than one page

% character encoding
\usepackage[utf8]{inputenc}                       % if you are not using xelatex ou lualatex, 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.75]{geometry}
%\setlength{\hintscolumnwidth}{3cm}                % if you want to change the width of the column with the dates
%\setlength{\makecvtitlenamewidth}{10cm}           % for the 'classic' style, if you want to force the width allocated to your name and avoid line breaks. be careful though, the length is normally calculated to avoid any overlap with your personal info; use this at your own typographical risks...

\section{References}
\cvdoublecolumn{\cvreference{XXXX}
   { Professor}
    {Department of X}
    {X University}
    {XXX}
    {X.com}
    {xxxxxxx}
    }
    {\cvreference{XXXX}
    {Chairman}
    { Professor}
    {Department of X}
    {X University}
    {XXXX}
    {X.com}
    {xxxxxxx}
    }
\cvdoublecolumn{\cvreference{XXX }
    { Professor}
    {Department of X}
    {X University}
    {XXX}
    {X.com}
    {xxxxxxx}
    }

\clearpage
\end{document}
2
  • What should the output look like? Where did you get the code from? ...an older moderncv style?
    – Werner
    Feb 15, 2016 at 18:11
  • I don't recall that where did I get that code. But, I wanted to write recommendations like in that pattern. Like, Name: Designation: Institute: Mobile no: Email Feb 15, 2016 at 18:14

1 Answer 1

2

Perhaps you're looking for something like this:

enter image description here

\documentclass[11pt,a4paper,sans]{moderncv}        % possible options include font size ('10pt', '11pt' and '12pt'), paper size ('a4paper', 'letterpaper', 'a5paper', 'legalpaper', 'executivepaper' and 'landscape') and font family ('sans' and 'roman')

% moderncv themes
\moderncvstyle{classic}                             % style options are 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{green}                               % color options 'blue' (default), 'orange', 'green', 'red', 'purple', 'grey' and 'black'

\firstname{First}
\lastname{Last}

\usepackage{tabularx}
\newcommand{\recommendation}[7]{%
  \noindent
  \begin{tabularx}{.5\linewidth}{@{} l X }
    Name: & #1 \\
    Designation: & #2 \\
    Department: & #3 \\
    Institute: & #4 \\
    Mobile: & #5 \\
    Email: & #6 \\
    Other: & #7
  \end{tabularx}%
}

\begin{document}

\makecvtitle

\section{References}

\recommendation{XXXX}
   { Professor}
    {Department of X}
    {X University}
    {XXX}
    {X.com}
    {xxxxxxx}%
 \recommendation{XXXX}
    {Chairman}
    {Department of X}
    {X University}
    {XXXX}
    {X.com}
    {xxxxxxx}

\bigskip

\recommendation{XXX }
    { Professor}
    {Department of X}
    {X University}
    {XXX}
    {X.com}
    {xxxxxxx}

\end{document}

The macro

\recommendation
  {<name>}% #1
  {<designation>}% #2
  {<department>}% #3
  {<institute>}% #4
  {<mobile>}% #5
  {<email>}% #6
  {<other>}% #7

takes 7 arguments and inserts them into a tabularx structure that fits have the line width.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .