Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using moderncv to style my CV and would like to modify how it renders references.

Here's an MWE:

\documentclass[11pt,letterpaper]{moderncv}
\usepackage{fontspec}
\moderncvstyle{casual}
\moderncvcolor{orange}

\name{Foo}{Bar}

\begin{document}
\nocite{ref}
\makecvtitle
\section{Education}

\cventry{1990-1999}{Ph.D}{Awesome University}{}{}{\LaTeX}  
\bibliographystyle{plain}
\bibliography{mwe}

\section{How I want it}
\begin{description}
\item[ [A1] ] this is an even longer reference
\end{description}

\end{document}

And here's how it renders (what it does and I want are both shown in the document) enter image description here

In particular, I would like the references to not be indented as much as they are, and I'd also like the citation label. Note that I think I can get citation labels with multibib, but the indentation problem doesn't go away. The reason I'd like this is that for a long CV with many references, the reduced width wastes too much space.

I poked around in the moderncv style file and saw an entry for bibindent which I changed in my document from 1.5em to 0. That didn't seem to have any effect. I also saw a redefinition of newblock but I don't think that affects the indentation of the overall entry.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

Add the following lines in the preamble:

\makeatletter
\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}
\patchcmd{\thebibliography}
  {\setlength{\labelwidth}{\hintscolumnwidth}}
  {\setlength{\labelwidth}{0pt}}
  {}
  {}
\makeatother

and you will get what you want.

The line

\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}

is to give a label to each bibliography entry, while the others patch the thebibliography environment so to have no indentation (etoolbox is loaded by moderncv).

Full MWE:

\RequirePackage{filecontents}
\begin{filecontents*}{mwe.bib}
@article{ref,
author = {Author J. Author},
title = {TeX is awesome},
journal = {Creatively},
year = {2014},
}
\end{filecontents*}


\documentclass[11pt,letterpaper]{moderncv}
\usepackage{fontspec}
\moderncvstyle{casual}
\moderncvcolor{orange}

\name{Foo}{Bar}

\makeatletter
\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}
\patchcmd{\thebibliography}
  {\setlength{\labelwidth}{\hintscolumnwidth}}
  {\setlength{\labelwidth}{0pt}}
  {}
  {}
\makeatother

\begin{document}
\nocite{ref}
\makecvtitle
\section{Education}

\cventry{1990-1999}{Ph.D}{Awesome University}{}{}{\LaTeX}
\bibliographystyle{plain}
\bibliography{mwe}

\end{document} 

Output:

enter image description here

share|improve this answer
    
Wow ! and Yikes. it's a pity something like this has to be hand-hacked. –  Suresh Feb 25 at 4:44
    
@Suresh I've simplified it a little. –  karlkoeller Feb 25 at 4:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.