在 moderncv 的序言中添加 google scholar 和 Researchgate 个人资料

在 moderncv 的序言中添加 google scholar 和 Researchgate 个人资料

我是新手Latex。我正在使用 创建简历moderncv,我想将我的 google scholar 和 researchgate 个人资料(图标和可点击链接)添加到序言中(图片中的网站链接下方)。有没有更简单的方法可以做到这一点? 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')

% modern themes
\moderncvstyle{banking}                            % style options are 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{black}                                % 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
\usepackage[parfill]{parskip} % Remove paragraph indentation
% character encoding
\usepackage[utf8]{inputenc}                       % if you are not using xelatex ou lualatex, replace by the encoding you are using
\usepackage[parfill]{parskip} % Remove paragraph indentation
\usepackage{array} % Required for boldface (\bf and \bfseries) tabular columns
\usepackage{ifthen} % Required for ifthenelse statements
\usepackage{fontawesome}
% \usepackage{hyperref}
\pagestyle{empty} % Suppress page numbers

\usepackage{import}

% personal data

\vspace{-2.00cm}
\name {Md.Tahsin}{Mostafiz}
% \vspace{-.4cm}
% \title{Curriculum Vitae}                               % optional, remove / comment the line if not wanted

\address{16/C Judges Complex, Kakrail, Dhaka}{}{}% optional, remove / comment the line if not wanted; the "postcode city" and and "country" arguments can be omitted or provided empty
\vspace{-.5cm}
\phone[mobile]{+88 01517262551}                   % optional, remove / comment the line if not wanted
\email{[email protected]}                               % 

答案1

由于您没有提供完整的 MWE,我只能猜测您\vspace{-2.00cm}在代码/序言中使用的原因。我想它不会实现您想要的效果,但那又是另一个问题 ;-)

针对您的问题存在一个命令:\socials在课堂上moderncv

\social[googlescholar]{john.doe} % <====================================
\social[researchgate]{john.doe} % <===================================== 

john.doe在两种情况下都代表您的帐户名称。

为了能够使用这些命令,您需要将以下代码添加到前言中:

% makes a https hyperlink
% usage: \httpslink[optional text]{link}
\newcommand*{\httpslink}[2][]{% <=======================================
  \ifthenelse{\equal{#1}{}}%
    {\href{https://#2}{#2}}%
    {\href{https://#2}{#1}}}
    
\newcommand*{\googlescholarsocialsymbol}  {\includegraphics[width=0.5cm]{example-image-a}~} % <===================
\newcommand*{\researchgatesocialsymbol}  {\includegraphics[width=0.5cm]{example-image-b}~} % <===================
\newcommand*{\testsocialsymbol}  {\includegraphics[width=0.5cm]{example-image-c}~} % <===================

\makeatletter
\RenewDocumentCommand{\social}{O{}O{}m}{%
  \ifthenelse{\equal{#2}{}}%
    { 
    \ifthenelse{\equal{#1}{linkedin}}{\collectionadd[linkedin]{socials}{\protect\httpslink[#3]{www.linkedin.com/in/#3}}}{}%
    \ifthenelse{\equal{#1}{googlescholar}}{\collectionadd[googlescholar]{socials}{\protect\httpslink[#3]{www.googlescholar.com/profile/#3}}}{}% <================================================================
    \ifthenelse{\equal{#1}{researchgate}}{\collectionadd[researchgate]{socials}{\protect\httpslink[#3]{www.researchgate.com/profile/#3}}}{}% <================================================================
      \ifthenelse{\equal{#1}{twitter}} {\collectionadd[twitter]{socials} {\protect\httpslink[#3]{www.twitter.com/#3}}}    {}%
      \ifthenelse{\equal{#1}{github}}  {\collectionadd[github]{socials}  {\protect\httpslink[#3]{www.github.com/#3}}}     {}%
    }
    {\collectionadd[#1]{socials}{\protect\httpslink[#3]{#2}}}}
\makeatother

这样您就可以使用给定的命令\socials。请注意,您必须更改www.googlescholar.com/profile/代码

{\protect\httpslink[#3]{www.googlescholar.com/profile/#3}} 

您需要的内容。#3包含您的显示名称,这也是帐户名称。

您必须更改的第二部分是以下命令:

\newcommand*{\googlescholarsocialsymbol}  {\includegraphics[width=0.5cm]{example-image-a}~} 

您没有\includegraphics[width=0.5cm]{example-image-a}添加所需的图像,而是显示您没有告诉我们的该页面的徽标。

如果显示的名称和链接的最后一部分不同(john.doe不是链接的一部分,但您想显示它,则可以使用以下命令:

\social[test][www.test.com/profile/123456]{john.doe} % <=====================================

然后请根据您的需要更改第二和第三个参数。不要test使用googlescholarresearchgate来命名新的社交命令。顺便说一句,如果您只使用可能性,test您可以在序言中使用更短的代码:

\makeatletter
\RenewDocumentCommand{\social}{O{}O{}m}{%
  \ifthenelse{\equal{#2}{}}%
    { 
    \ifthenelse{\equal{#1}{linkedin}}{\collectionadd[linkedin]{socials}{\protect\httpslink[#3]{www.linkedin.com/in/#3}}}{}%
      \ifthenelse{\equal{#1}{twitter}} {\collectionadd[twitter]{socials} {\protect\httpslink[#3]{www.twitter.com/#3}}}    {}%
      \ifthenelse{\equal{#1}{github}}  {\collectionadd[github]{socials}  {\protect\httpslink[#3]{www.github.com/#3}}}     {}%
    }
    {\collectionadd[#1]{socials}{\protect\httpslink[#3]{#2}}}}
\makeatother

您需要此代码来获取https:而不是http:在链接中...

使用以下可编译代码(MWE;请下次在您的问题中添加一个!):

\documentclass[11pt,a4paper,sans]{moderncv}

% moderncv themes
\moderncvstyle{banking} % casual, classic, banking, oldstyle and fancy
\moderncvcolor{blue} 

\usepackage[utf8]{inputenc}

\usepackage[scale=0.75]{geometry}

% makes a https hyperlink
% usage: \httpslink[optional text]{link}
\newcommand*{\httpslink}[2][]{% <=======================================
  \ifthenelse{\equal{#1}{}}%
    {\href{https://#2}{#2}}%
    {\href{https://#2}{#1}}}
    
\newcommand*{\googlescholarsocialsymbol}  {\includegraphics[width=0.5cm]{example-image-a}~} % <===================
\newcommand*{\researchgatesocialsymbol}  {\includegraphics[width=0.5cm]{example-image-b}~} % <===================
\newcommand*{\testsocialsymbol}  {\includegraphics[width=0.5cm]{example-image-c}~} % <===================

\makeatletter
\RenewDocumentCommand{\social}{O{}O{}m}{%
  \ifthenelse{\equal{#2}{}}%
    { 
    \ifthenelse{\equal{#1}{linkedin}}{\collectionadd[linkedin]{socials}{\protect\httpslink[#3]{www.linkedin.com/in/#3}}}{}%
    \ifthenelse{\equal{#1}{googlescholar}}{\collectionadd[googlescholar]{socials}{\protect\httpslink[#3]{www.googlescholar.com/profile/#3}}}{}% <================================================================
    \ifthenelse{\equal{#1}{researchgate}}{\collectionadd[researchgate]{socials}{\protect\httpslink[#3]{www.researchgate.com/profile/#3}}}{}% <================================================================
      \ifthenelse{\equal{#1}{twitter}} {\collectionadd[twitter]{socials} {\protect\httpslink[#3]{www.twitter.com/#3}}}    {}%
      \ifthenelse{\equal{#1}{github}}  {\collectionadd[github]{socials}  {\protect\httpslink[#3]{www.github.com/#3}}}     {}%
    }
    {\collectionadd[#1]{socials}{\protect\httpslink[#3]{#2}}}}
\makeatother



% personal data
\name{John}{Doe}
\title{Resumé title}
\address{street and number}{postcode city}{country}
\phone[mobile]{+1~(234)~567~890}
\phone[fixed]{+2~(345)~678~901}
\phone[fax]{+3~(456)~789~012}
\email{[email protected]}
\homepage{www.johndoe.com}
\social[linkedin]{john.doe}
\social[twitter]{jdoe}
\social[github]{jdoe}
\social[googlescholar]{john.doe} % <====================================
\social[researchgate]{john.doe} % <=====================================
\social[test][www.test.com/profile/john.doe]{john.doe} % <=====================================
\extrainfo{additional information}
\quote{Some quote}

\setlength{\footskip}{66pt} 


\begin{document}

\makecvtitle

\section{Education}
\cventry{year--year}{Degree}{Institution--3}{City--4}{\textit{Grade}--5}{Description--6}  % arguments 3 to 6 can be left empty
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}

\section{Master thesis}
\cvitem{title}{\emph{Title}}
\cvitem{supervisors}{Supervisors}
\cvitem{description}{Short thesis abstract}

\section{Experience}
\subsection{Vocational}
\cventry{year--year}{Job title}{Employer}{City}{}{General description 
  no longer than 1--2 lines.\newline{}%
Detailed achievements:%
\begin{itemize}%
\item Achievement 1;
\item Achievement 2, with sub-achievements:
  \begin{itemize}%
  \item Sub-achievement (a);
  \item Sub-achievement (b), with sub-sub-achievements (don't do this!);
    \begin{itemize}
    \item Sub-sub-achievement i;
    \item Sub-sub-achievement ii;
    \item Sub-sub-achievement iii;
    \end{itemize}
  \item Sub-achievement (c);
  \end{itemize}
\item Achievement 3.
\end{itemize}}
\cventry{year--year}{Job title}{Employer}{City}{}{Description 
  line 1\newline{}Description line 2}
\subsection{Miscellaneous}
\cventry{year--year}{Job title}{Employer}{City}{}{Description}

\section{Languages}
\cvitemwithcomment{Language 1}{Skill level}{Comment}
\cvitemwithcomment{\textbf{Language} 2}{\textbf{Skill} level}{Comment}
\cvitemwithcomment{Language 3}{Skill level}{Comment}

\section{Computer skills}
\cvdoubleitem{category 1}{XXX, YYY, ZZZ}{category 4}{XXX, YYY, ZZZ}
\cvdoubleitem{category 2}{XXX, YYY, ZZZ}{category 5}{XXX, YYY, ZZZ}
\cvdoubleitem{category 3}{XXX, YYY, ZZZ}{category 6}{XXX, YYY, ZZZ}

\section{Interests}
\cvitem{hobby 1}{Description}
\cvitem{hobby 2}{Description}
\cvitem{hobby 3}{Description}

\section{Extra 1}
\cvlistitem{Item 1}
\cvlistitem{Item 2}
\cvlistitem{Item 3. This item is particularly long and therefore 
  normally spans over several lines. Did you notice the indentation 
  when the line wraps?}

\section{Extra 2}
\cvlistdoubleitem{Item 1}{Item 4}
\cvlistdoubleitem{Item 2}{Item 5}
\cvlistdoubleitem{Item 3}{Item 6. Like item 3 in the single column list before, this item is particularly long to wrap over several lines.}

\section{References}
\begin{cvcolumns}
  \cvcolumn{Category 1}{\begin{itemize}\item Person 1\item Person 2\item Person 3\end{itemize}}
  \cvcolumn{Category 2}{Amongst others:\begin{itemize}\item Person 1, and\item Person 2\end{itemize}(more upon request)}
  \cvcolumn[0.5]{All the rest \& some more}{\textit{That} person, and \textbf{those} also (all available upon request).}
\end{cvcolumns}

\end{document} 

你得到:

resulting pdf

答案2

有点儿像黑客方法。将 更改\rule{1em}{1em}为包含所需徽标的内容。

    \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')

% modern themes
\moderncvstyle{banking}                            % style options are 'casual' (default), 'classic', 'oldstyle' and 'banking'
\moderncvcolor{black}                                % 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
\usepackage[parfill]{parskip} % Remove paragraph indentation
% character encoding
\usepackage[utf8]{inputenc}                       % if you are not using xelatex ou lualatex, replace by the encoding you are using
\usepackage[parfill]{parskip} % Remove paragraph indentation
\usepackage{array} % Required for boldface (\bf and \bfseries) tabular columns
\usepackage{ifthen} % Required for ifthenelse statements
\usepackage{fontawesome}
% \usepackage{hyperref}
\pagestyle{empty} % Suppress page numbers

\usepackage{import}

% personal data

\vspace{-2.00cm}
\name{Md.\@ Tahsin}{Mostafiz}
% \vspace{-.4cm}
% \title{Curriculum Vitae}                               % optional, remove / comment the line if not wanted

\address{16/C Judges Complex, Kakrail, Dhaka}{}{}% optional, remove / comment the line if not wanted; the "postcode city" and and "country" arguments can be omitted or provided empty
\vspace{-.5cm}
\phone[mobile]{+88 01517262551}                   % optional, remove / comment the line if not wanted
\email{[email protected]}  

\homepage{google.com/scholar/something}
% change this to some \includegraphics with the logo you want
\renewcommand*\homepagesymbol{\rule{1em}{1em}}

\extrainfo{\rule{1em}{1em}\httplink{researchgate.com/users/someone}}


\begin{document}
\makecvtitle
\end{document}

答案3

首先,添加一个新的类文件名moderncv.cls,并将代码粘贴到链接中 https://github.com/xdanaux/moderncv/blob/master/moderncv.cls

如果你想添加图标,那么从谷歌搜索下载图标图像并上传到你的项目,然后找到以下行

\collectionnew{socials}

然后在其前面添加下面的代码(根据需要复制)

\newcommand*{\googlescholarsocialsymbol}  {\includegraphics[width=0.5cm]{example-image-a}~}

example-image-a是对应的图像名称。

现在使用如下 -

\social[researchgate]{name}
\social[googlescholar]{id}

相关内容