Cambiar el orden de la bibliografía con moderncv y renovar la declaración ambiental

Cambiar el orden de la bibliografía con moderncv y renovar la declaración ambiental

Hace un tiempo copié y pegué el siguiente código de internet para tener categorizadas las publicaciones.

Ahora me doy cuenta de que el orden de publicación no corresponde al orden que defino en la bibliografía. ¿Qué comando tengo que agregar al \renewenvironment{thebibliography}bloque para que mi orden quede desordenado? Simplemente configurar el estilo de bibliografía no funciona con este código personalizado.

Lo intenté \renewcommand{\bibliographystyle}{\unsrt}pero soy pésimo con LaTeX y no sé qué estoy haciendo realmente.

Estoy usando multibiby moderncval dorso.

Aquí está mi código:

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

\makeatletter
\renewenvironment{thebibliography}[1]%
  {%
    \subsection{\refname}%
    \small%
    \begin{list}{\bibliographyitemlabel}%
      {%
        \setlength{\topsep}{0pt}%
        \setlength{\labelwidth}{\hintscolumnwidth}%
        \setlength{\labelsep}{\separatorcolumnwidth}%
        \leftmargin\labelwidth%
        \advance\leftmargin\labelsep%
        \@openbib@code%
        \usecounter{enumiv}%
        \let\p@enumiv\@empty%
        \renewcommand\theenumiv{\@arabic\c@enumiv}}%
        \sloppy\clubpenalty4000\widowpenalty4000%
  }%
  {%
    \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
    \end{list}%
  }
\makeatother
\usepackage{multibib}
\newcites{journal,preprint,bthesis}{{Journals},{Technical Reports \& Pre-prints},{Bachelor Thesis}}

Respuesta1

No nos mostró un MWE compilable, así que simplemente usé un ejemplo de plantilla más corto que puede encontrar con la clase moderncv, versión 2.0.0, la actual. Si está utilizando uno anterior, le sugiero que lo actualice. O díganos la versión que está utilizando en su pregunta. Tampoco nos mostró cómo y qué entradas de dorsales citó en qué orden y no nos mostró los archivos de dorsales usados. La próxima vez, haga su pregunta lo más completa posible.

Para lo siguiente, simplemente utilicé los datos que vienen con moderncvla versión 2.0.0.

La parte relevante para citar y construir las bibliografías la puedes ver en la siguiente parte del código:

%in your preamble:
\newcites{book,misc}{{Books},{Others}} % <==============================

% in your code:
% Publications from a BibTeX file using the multibib package
\section{Publications}
\nocitebook{book1,book2}
\bibliographystylebook{unsrt} % unsrt plain <=================================
\bibliographybook{publications}                   % 'publications' is the name of a BibTeX file
\nocitemisc{misc1,misc2,misc3}
\bibliographystylemisc{unsrt} % unsrt plain <=================================
\bibliographymisc{publications}                   % 'publications' is the name of a BibTeX file

El comando \nocitebook{book1,book2}cita primero book1, luego book2. Con el comando \bibliographystylebook{unsrt}usted elige el estilo de la bibliografía, en este caso unsrt, eso significa mostrar las entradas bibliográficas en la bibliografía en el orden utilizado para citar. Lo mismo para el segundo multibib, tienes que hacer esto por tercera vez para el tercero multibib.

El uso multibibcambió la cadena de compilación habitual. Con los dos programas multibibs anteriores, debes compilar con:

  1. pdflatex mwe.tex, supongamos que su cv está almacenado en el archivo mwe.tex. Después de compilar el cv encontrarás dos archivos book.auxy misc.auxen el mismo directorio que tienes mwe.tex. En su caso debería encontrar tres archivos journal.auxy preprint.aux.bthesis.aux
  2. bibtex bookconstruir la primera bibliografía multibib.
  3. bibtex miscpara construir la segunda bibliografía.
  4. pdflatex mwe.texdos veces para obtener los números de página correctos, TOC, etc., como de costumbre.

Con la versión actual de moderncv(2.0.0), no es necesario copiar el \renewenvironment{thebibliography}[1]%bloque en su código. Por supuesto, debe definir los multibibs usados \newcites{journal,preprint,bthesis}{{Journals},{Technical Reports \& Pre-prints},{Bachelor Thesis}}​​en el preámbulo (como hice con los dos archivos bib en este ejemplo).

Con el siguiente compilabe MWE (usando el archivo bib publication.bibde moderncvla plantilla):

% pdflatex mwe.tex
% bibtex book
% bibtex misc
% pdflatex mwe.tex
% pdflatex mwe.tex
\documentclass[11pt,a4paper,sans]{moderncv}

\moderncvstyle{casual}
\moderncvcolor{blue}

\usepackage[scale=0.75]{geometry}

\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}
\extrainfo{additional information}
\photo[64pt][0.4pt]{example-image-golden-upright}
\quote{Some quote}

\setlength{\footskip}{70pt}

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

\usepackage{multibib}
\newcites{book,misc}{{Books},{Others}} % <==============================


\begin{document}

\makecvtitle

\section{Education}
\cventry{year--year}{Degree}{Institution}{City}{\textit{Grade}}{Description}  % 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{Extra 2}
\cvlistdoubleitem{Item 1}{Item 4}
\cvlistdoubleitem{Item 2}{Item 5\cite{book1}}
\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}

% Publications from a BibTeX file using the multibib package
\section{Publications}
\nocitebook{book1,book2}
\bibliographystylebook{unsrt} % unsrt plain <=================================
\bibliographybook{publications}                   % 'publications' is the name of a BibTeX file
\nocitemisc{misc1,misc2,misc3}
\bibliographystylemisc{unsrt} % unsrt plain <=================================
\bibliographymisc{publications}                   % 'publications' is the name of a BibTeX file

\end{document}

obtienes el resultado:

bibliografía resultante

Para estar seguro, puede probar mi MWE dado aquí, el archivo babero de muestra publication.bib:

%% start of file `publications.bib'.
%% Copyright 2006-2012 Xavier Danaux (xdanaux at gmail.com).
%
% 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/.


@BOOK{book1,
  author = {John Doe and Author 1},
  title = {Title},
  publisher = {Publisher},
  edition = {edition},
  year = {year},
}

@BOOK{book2,
  author = {John Doe and Author 2},
  title = {Title},
  publisher = {Publisher},
  edition = {edition},
  year = {year},
}

@MISC{misc1,
  author = {John Doe},
  title = {Title},
  year = {year},
}

@MISC{misc2,
  author = {John Doe and Author 3},
  title = {Title},
  year = {year},
}

@MISC{misc3,
  author = {John Doe},
  title = {Title},
  year = {year},
}


%% end of file `publications.bib'.

información relacionada