在 \cventry 中插入 modercv 的標誌(經典風格)

在 \cventry 中插入 modercv 的標誌(經典風格)

我正在使用moderncv我的簡歷。我進行了moderncvstyleclassic.sty相當多的調整,就我想要的結果而言,我幾乎已經達到了。只有最後一件事我無法解決:我想在\cventry.

目前,我創建了一個新命令\cventrylogo

\renewcommand*{\cventrylogo}[8][.25em]{%
  \cvitem[#1]{#2}{%
    {\bfseries#3}%
    \ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}%
    \ifthenelse{\equal{#5}{}}{}{, #5}%
    \ifthenelse{\equal{#6}{}}{}{, #6.}%
    \ifthenelse{\equal{#7}{}}{}{\hfill \includegraphics[scale=0.25]{#7}}%
    \strut%
    \ifx&#8&%
      \else{\newline{}\begin{minipage}[t]{\linewidth}\small#8\end{minipage}}\fi}}

然後我這樣使用:

\section{Experience}
\cventrylogo{2015}{Short Term Scientific Collaborator}{M\'et\'eosuisse}{Payerne}{Switzerland}{logo_meteosuisse}{}
\cventrylogo{2009--2014}{PhD. in Physical Chemistry}{ETH}{Zurich}{Switzerland}{logo_eth}{}
\cventrylogo{2006--2008}{Process Development Engineer}{STM S.p.A.}{Agrate Brianza}{Italy}{logo_st}{}
\cventrylogo{2004--2005}{Internship}{Alenia Spazio S.p.A.}{Turin}{Italy}{logo_tas}{}

結果如下:

在此輸入影像描述

我已經看過類似的問題了12,但這不是我想要的。有 2 個問題。首先,圖像在底部對齊,我希望它們在文字的中心對齊,其次,我希望可以選擇在命令中指定圖像的大小\cventrylogo,但實現這一點超出了我的能力。任何幫助將不勝感激。


我自己在 Harish Kumar 的幫助下回答了這個問題,並提供了一個 MWE 供使用。

答案1

\cventrylogo現在它可以按照我想要的方式工作,使用定義如下的命令:

\renewcommand{\cventrylogo}[9][.25em]{% 
\cvitem[#1]{#2}{% 
  {\bfseries#3}% 
  \ifthenelse{\equal{#4}{}}{}{, {\slshape#4}}% 
  \ifthenelse{\equal{#5}{}}{}{, #5}% 
  \ifthenelse{\equal{#6}{}}{}{, #6.}% 
  \ifthenelse{\equal{#7}{}}{}{% 
    \ifthenelse{\equal{#8}{}}{}{\hfill \raisebox{-0.5\height}{\includegraphics[width=#8]{#7}}}}%
  \strut% 
  \ifx&#9&% 
    \else{\newline{}\begin{minipage}[t]{\linewidth}\small#9\end{minipage}}\fi} }

這是 MWE,供其使用的進一步參考:

\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic}
\moderncvcolor{blue} 
\usepackage[utf8]{inputenc}

\usepackage[scale=0.8]{geometry} 

\name{Riccardo}{I.}
\title{Title title}
\address{XXX}{place ville}{}
\phone[mobile]{+00~(0)~00~000~00~00}    
\email{[email protected]} 

\begin{document}

\makecvtitle

\section{Experience}
\cventrylogo{2015}{Short Term Scientific Collaborator}{M\'et\'eosuisse}{Payerne}{Switzerland}{logo_meteosuisse}{16mm}{}
\cventrylogo{2009--2014}{PhD. in Physical Chemistry}{ETH}{Zurich}{Switzerland}{logo_eth}{25mm}{}
\cventrylogo{2006--2008}{Process Development Engineer}{STM S.p.A.}{Agrate Brianza}{Italy}{logo_st}{18mm}{}
\cventrylogo{2004--2005}{Internship}{Alenia Spazio S.p.A.}{Turin}{Italy}{logo_tas}{20mm}{}

\end{document}

相關內容