突出显示作者后,参考书目条目输出不正确

突出显示作者后,参考书目条目输出不正确

按照 gogolin 在此 [主题][1] 中提供的说明,我在输出参考书目时遇到了一些问题:

而不是得到

多伊·J。,史密斯 A.,……

它显示

多伊J.史密斯,A.……

因此,看起来突出显示功能有效,但是记录的显示方式却完全混乱了。

这里是 MWE

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

\moderncvstyle{classic}
\moderncvcolor{blue}                               
\usepackage[utf8]{inputenc}                      
\usepackage{pdfpages/pdfpages}
\usepackage{moderntimeline/moderntimeline}
\tlmaxdates{2003}{2016}                            
\usepackage{xpatch/xpatch}

\usepackage[url=true,
    backend=bibtex,                                  
    style=authoryear,
    firstinits=true,
    doi=false,  
    isbn=false,
    backref=false,
    dashed=false,                                   
    maxnames=30,                               
    sorting=ydnt,
    mincitenames=2,
    maxcitenames=2]{biblatex}   

\DeclareNameAlias{sortname}{last-first}

\renewcommand*{\revsdnamepunct}{}

\usepackage{substr}

% MAKE BOLD A SPECIFIC AUTHOR

\newcommand{\makeauthorbold}[1]{%
\DeclareNameFormat{author}{%
  \edef\tempname{{#1}}%
  \ifnumequal{\value{listcount}}{1}
    {\ifnumequal{\value{liststop}}{1}
      {\expandafter\ifstrequal\tempname{##1}{\textbf{##1\addcomma\addspace ##4\addcomma\isdot}}{##1\addcomma\addspace ##4\addcomma\isdot}}
      {\expandafter\ifstrequal\tempname{##1}{\textbf{##1\addcomma\addspace ##4}}{##1\addcomma\addspace ##4}}}
    {\ifnumless{\value{listcount}}{\value{liststop}}
      {\expandafter\ifstrequal\tempname{##1}{\textbf{\addcomma\addspace ##1\addcomma\addspace ##4}}{\addcomma\addspace ##1\addcomma\addspace ##4}}
      {\expandafter\ifstrequal\tempname{##1}{\textbf{\addcomma\addspace ##1\addcomma\addspace ##4\addcomma\isdot}}{\addcomma\addspace ##1\addcomma\addspace ##4\addcomma\isdot}}%
    }%
}%
}
\makeauthorbold{Doe}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\addbibresource{pub1.bib}                   

\input{biblatex_modifications/standard_modification.tex}        

\newcommand{\cvreferencecolumn}[2]{%
  \cvitem[0.75em]{}{%
    \begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#1\end{minipage}%
    \hfill%
    \begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#2\end{minipage}%
    }%
}



\newcommand{\cvreference}[8]{%
    \textbf{#1}\newline% Name
    \ifthenelse{\equal{#2}{}}{}{\addresssymbol~#2\newline}%
    \ifthenelse{\equal{#3}{}}{}{#3\newline}%
    \ifthenelse{\equal{#4}{}}{}{#4\newline}%
    \ifthenelse{\equal{#5}{}}{}{#5\newline}%
    \ifthenelse{\equal{#6}{}}{}{\emailsymbol~\texttt{\href{mailto:#6}{\nolinkurl{#6}}}\newline}%
    \ifthenelse{\equal{#7}{}}{}{\phonesymbol~#7\newline}
    \ifthenelse{\equal{#8}{}}{}{\mobilephonesymbol~#8}}

%-------------------Personal Data for CV title-----------------------------------------------------------

\name{John}{Doe}

\address{my street}{my city}{a place}




\begin{document}

\makecvtitle
\input{cvitem_modifications/cvitem_modified} 
\nocite{*}                                         
\printbibliography[type=article,title={Journal Publications}]


\input{cvitem_modifications/cvitem_moderncvclassic} 

\end{document}

负责突出显示的代码如下,使特定作者加粗

pub1 文件是

@article{doe2015,
    Author = {Doe, John and  Kobayashi, Kazuto and Mannaioni, Guido},
    Journal = {Eur J Neurosci},
    Journal-Full = {The European journal of neuroscience},
    Keywords = {dopaminergic neurons; hcn channels; parkinson's disease; patch clamp; th-gfp mice},
    Month = {Sep},
    Pst = {aheadofprint},
    Title = {Cheating at University},
    Year = {2015}}

@article{doe2013,
    Author = {Doe, John and Mannaioni, Guido},
    Journal = {Nature},
    Journal-Full = {Nature},
    Keywords = {dopaminergic neurons; hcn channels; parkinson's disease; patch clamp; th-gfp mice},
    Month = {Sep},
    Pst = {aheadofprint},
    Title = {Parkinson's disease, no hope},
    Year = {2013}}

感谢您的关注,如果我的问题没有表达清楚,请原谅我

答案1

使用当前版本的 MiKTeX,moderncv我可以毫无问题地编译以下 MWE。如您所见,我不得不更改一些内容,例如,我注释了命令\input(因为我们没有输入的文件!)。我还注释了一些在给定示例中未使用的包。

请运行以下 MWE

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{doe2015,
  Author = {Doe, John and  Kobayashi, Kazuto and Mannaioni, Guido},
  Journal = {Eur J Neurosci},
  Journal-Full = {The European journal of neuroscience},
  Keywords = {dopaminergic neurons; hcn channels; parkinson's disease; patch clamp; th-gfp mice},
  Month = {Sep},
  Pst = {aheadofprint},
  Title = {Cheating at University},
  Year = {2015},
}
@article{doe2013,
  Author = {Doe, John and Mannaioni, Guido},
  Journal = {Nature},
  Journal-Full = {Nature},
  Keywords = {dopaminergic neurons; hcn channels; parkinson's disease; patch clamp; th-gfp mice},
  Month = {Sep},
  Pst = {aheadofprint},
  Title = {Parkinson's disease, no hope},
  Year = {2013},
}
\end{filecontents*}


\listfiles % creates list of used packages and versions in log file
\documentclass[11pt,a4paper,sans]{moderncv}

\moderncvstyle{classic}
\moderncvcolor{blue}                               
\usepackage[utf8]{inputenc}                      
%\usepackage{pdfpages}
%\usepackage{moderntimeline}
%\tlmaxdates{2003}{2016}                            
%\usepackage{xpatch}

\usepackage[%
  url=true,
  backend=biber,
  style=authoryear,
% firstinits=true,
  doi=false,  
  isbn=false,
  backref=false,
  dashed=false,                                   
  maxnames=30,                               
  sorting=ydnt,
  mincitenames=2,
  maxcitenames=2
]{biblatex}   

\DeclareNameAlias{sortname}{last-first}

\renewcommand*{\revsdnamepunct}{}

\usepackage{substr}

% MAKE BOLD A SPECIFIC AUTHOR

\newcommand{\makeauthorbold}[1]{%
\DeclareNameFormat{author}{%
  \edef\tempname{{#1}}%
  \ifnumequal{\value{listcount}}{1}
    {\ifnumequal{\value{liststop}}{1}
      {\expandafter\ifstrequal\tempname{##1}{\textbf{##1\addcomma\addspace ##4\addcomma\isdot}}{##1\addcomma\addspace ##4\addcomma\isdot}}
      {\expandafter\ifstrequal\tempname{##1}{\textbf{##1\addcomma\addspace ##4}}{##1\addcomma\addspace ##4}}}
    {\ifnumless{\value{listcount}}{\value{liststop}}
      {\expandafter\ifstrequal\tempname{##1}{\textbf{\addcomma\addspace ##1\addcomma\addspace ##4}}{\addcomma\addspace ##1\addcomma\addspace ##4}}
      {\expandafter\ifstrequal\tempname{##1}{\textbf{\addcomma\addspace ##1\addcomma\addspace ##4\addcomma\isdot}}{\addcomma\addspace ##1\addcomma\addspace ##4\addcomma\isdot}}%
    }%
}%
}
\makeauthorbold{Doe}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\addbibresource{\jobname.bib}                   

%\input{biblatex_modifications/standard_modification.tex}        

\newcommand{\cvreferencecolumn}[2]{%
  \cvitem[0.75em]{}{%
    \begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#1\end{minipage}%
    \hfill%
    \begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#2\end{minipage}%
    }%
}

\newcommand{\cvreference}[8]{%
    \textbf{#1}\newline% Name
    \ifthenelse{\equal{#2}{}}{}{\addresssymbol~#2\newline}%
    \ifthenelse{\equal{#3}{}}{}{#3\newline}%
    \ifthenelse{\equal{#4}{}}{}{#4\newline}%
    \ifthenelse{\equal{#5}{}}{}{#5\newline}%
    \ifthenelse{\equal{#6}{}}{}{\emailsymbol~\texttt{\href{mailto:#6}{\nolinkurl{#6}}}\newline}%
    \ifthenelse{\equal{#7}{}}{}{\phonesymbol~#7\newline}
    \ifthenelse{\equal{#8}{}}{}{\mobilephonesymbol~#8}}

%-------------------Personal Data for CV title--------------------------
\name{John}{Doe}
\address{my street}{my city}{a place}


\begin{document}

\makecvtitle
%\input{cvitem_modifications/cvitem_modified} 
\nocite{*}                                         
\printbibliography[%
% type=article,
  title={Journal Publications}
]


%\input{cvitem_modifications/cvitem_moderncvclassic} 

\end{document}

并检查得到的结果。我的结果是:

我的结果是

正如您所见,作者是粗体,其他部分则是理所当然的。

请将以下使用的软件包和版本列表与日志文件中的列表进行比较。您可能需要更新系统。如果没有差异,则错误似乎隐藏在输入的文件中...

列表创建者\listfiles

 *File List*
filecontents.sty    2011/10/08 v1.3 Create an external file from within a LaTeX document
moderncv.cls    2015/07/28 v2.0.0 modern curriculum vitae and letter document class
  size11.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
etoolbox.sty    2015/08/02 v2.2a e-TeX tools for LaTeX (JAW)
  ifthen.sty    2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
  pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
colortbl.sty    2012/02/13 v1.0a Color table columns (DPC)
   array.sty    2014/10/28 v2.4c Tabular extension package (FMi)
 ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
 fontenc.sty
   t1enc.def    2005/09/27 v1.99g Standard LaTeX file
 lmodern.sty    2009/10/30 v1.6 Latin Modern Fonts
     url.sty    2013/09/16  ver 3.4  Verb mode for urls, etc.
graphicx.sty    2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
graphics.sty    2016/01/03 v1.0q Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
fancyhdr.sty    
tweaklist.sty    
    calc.sty    2014/10/28 v4.3 Infix arithmetic (KKT,FJ)
  xparse.sty    2016/01/19 v6377 L3 Experimental document command parser
   expl3.sty    2016/01/19 v6377 L3 programming layer (loader) 
expl3-code.tex    2016/01/19 v6377 L3 programming layer 
l3pdfmode.def    2015/11/11 v6250 L3 Experimental driver: PDF mode
microtype.sty    2013/05/23 v2.5a Micro-typographical refinements (RS)
microtype-pdftex.def    2013/05/23 v2.5a Definitions specific to pdftex (RS)
microtype.cfg    2013/05/23 v2.5a microtype main configuration file (RS)
moderncvcollection.sty    2015/07/28 v2.0.0 moderncv collections
moderncvcompatibility.sty    2015/07/28 v2.0.0 modern curriculum vitae and letter compatibility patches
moderncvstyleclassic.sty    2015/07/28 v2.0.0 modern curriculum vitae and letter style scheme: classic
moderncviconsmarvosym.sty    2015/07/28 v2.0.0 modern curriculum vitae and letter icons: marvosym
    tikz.sty    2015/08/07 v3.0.1a (rcs-revision 1.151)
     pgf.sty    2015/08/07 v3.0.1a (rcs-revision 1.15)
  pgfrcs.sty    2015/08/07 v3.0.1a (rcs-revision 1.31)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2010/04/11 v3.0.1a (rcs-revision 1.7)
  pgfsys.sty    2014/07/09 v3.0.1a (rcs-revision 1.48)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2013/09/09  (rcs-revision 1.9)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
 pgfcore.code.tex
pgfcomp-version-0-65.sty    2007/07/03 v3.0.1a (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v3.0.1a (rcs-revision 1.1)
  pgffor.sty    2013/12/13 v3.0.1a (rcs-revision 1.25)
 pgfkeys.sty    
 pgfkeys.code.tex
 pgfmath.sty    
 pgfmath.code.tex
  pgffor.code.tex
    tikz.code.tex
moderncvheadi.sty    2015/07/28 v2.0.0 modern curriculum vitae and letter header variant: 1
moderncvbodyi.sty    2015/07/28 v2.0.0 modern curriculum vitae and letter body variant: 1
    umvs.fd
moderncvcolorblue.sty    2015/07/28 v2.0.0 modern curriculum vitae and letter color scheme: blue
inputenc.sty    2015/03/17 v1.2c Input encoding file
    utf8.def    2015/12/03 v1.1r UTF-8 support for inputenc
   t1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  ot1enc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
  omsenc.dfu    2015/12/03 v1.1r UTF-8 support for inputenc
biblatex.sty    2015/12/22 v3.2 programmable bibliographies (PK/JW/AB)
biblatex2.sty    2015/12/22 v3.2 programmable bibliographies (biber) (PK/JW/AB)
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
  logreq.sty    2010/08/04 v1.0 xml request logger
  logreq.def    2010/08/04 v1.0 logreq spec v1.0
  blx-dm.def
authoryear.dbx
biblatex-dm.cfg
blx-compat.def    2015/12/22 v3.2 biblatex compatibility (PK/JW/AB)
biblatex.def    
standard.bbx    2015/12/22 v3.2 biblatex bibliography style (PK/JW/AB)
authoryear.bbx    2015/12/22 v3.2 biblatex bibliography style (PK/JW/AB)
authoryear.cbx    2015/12/22 v3.2 biblatex citation style (PK/JW/AB)
biblatex.cfg    
  substr.sty    2009/10/20 v1.2 Handle substrings
hyperref.sty    2012/11/06 v6.83m Hypertext links for LaTeX
hobsub-hyperref.sty    2012/04/25 v1.12 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty    2012/04/25 v1.12 Bundle oberdiek, subset generic (HO)
  hobsub.sty    2012/04/25 v1.12 Construct package bundles (HO)
  ifvtex.sty    2010/03/01 v1.5 Detect VTeX and its facilities (HO)
 intcalc.sty    2007/09/27 v1.1 Expandable calculations with integers (HO)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
pdfescape.sty    2011/11/25 v1.13 Implements pdfTeX's escape features (HO)
bigintcalc.sty    2012/04/08 v1.3 Expandable calculations on big integers (HO)
  bitset.sty    2011/01/30 v1.1 Handle bit-vector datatype (HO)
uniquecounter.sty    2011/01/30 v1.2 Provide unlimited unique counter (HO)
letltxmacro.sty    2010/09/02 v1.4 Let assignment for LaTeX macros (HO)
 hopatch.sty    2011/06/24 v1.1 Wrapper for package hooks (HO)
xcolor-patch.sty    2011/01/30 xcolor patch
atveryend.sty    2011/06/30 v1.8 Hooks at the very end of document (HO)
atbegshi.sty    2011/10/05 v1.16 At begin shipout hook (HO)
refcount.sty    2011/10/16 v3.4 Data extraction from label references (HO)
 hycolor.sty    2011/01/30 v1.7 Color options for hyperref/bookmark (HO)
 auxhook.sty    2011/03/04 v1.3 Hooks for auxiliary files (HO)
  pd1enc.def    2012/11/06 v6.83m Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive
   puenc.def    2012/11/06 v6.83m Hyperref: PDF Unicode definition (HO)
 hpdftex.def    2012/11/06 v6.83m Hyperref driver for pdfTeX
rerunfilecheck.sty    2011/04/15 v1.7 Rerun checks for auxiliary files (HO)
 english.lbx    2015/12/22 v3.2 biblatex localization (PK/JW/AB)
   t1lmr.fd    2009/10/30 v1.6 Font defs for Latin Modern
supp-pdf.mkii
epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf
  grfext.sty    2010/08/19 v1.1 Manage graphics extensions (HO)
  mt-cmr.cfg    2013/05/19 v2.2 microtype config. file: Computer Modern Roman (RS)
  t1lmss.fd    2009/10/30 v1.6 Font defs for Latin Modern
  269243.bbl
 nameref.sty    2012/10/27 v2.43 Cross-referencing by name of section
gettitlestring.sty    2010/12/03 v1.4 Cleanup title references (HO)
  269243.out
  269243.out
  ot1lmr.fd    2009/10/30 v1.6 Font defs for Latin Modern
  omllmm.fd    2009/10/30 v1.6 Font defs for Latin Modern
 omslmsy.fd    2009/10/30 v1.6 Font defs for Latin Modern
 omxlmex.fd    2009/10/30 v1.6 Font defs for Latin Modern
 ***********

相关内容