
Há algum tempo, copiei e colei o seguinte código da internet para categorizar as publicações.
Agora percebo que a ordem de publicação não corresponde à ordem que defino na bibliografia. Qual comando devo adicionar ao \renewenvironment{thebibliography}
bloco para que meu pedido não seja classificado. Simplesmente definir o estilo bibliografia não funciona com este código personalizado.
Eu tentei \renewcommand{\bibliographystyle}{\unsrt}
, mas sou péssimo em LaTeX e não sei o que estou fazendo.
Estou usando multibib
e moderncv
Overleaf.
Aqui está meu 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}}
Responder1
Você não nos mostrou um MWE compilável, então simplesmente usei um exemplo de modelo mais curto que você pode encontrar com class moderncv
, versão 2.0.0, o atual. Se você estiver usando um mais antigo, sugiro atualizar! Ou diga-nos a versão que você está usando em sua pergunta. Você também não nos mostrou como e quais entradas de peitoral você citou em que ordem e não nos mostrou os arquivos de peitoral usados. Da próxima vez, faça sua pergunta o mais completa possível.
Para o seguinte, simplesmente usei os dados provenientes da moderncv
versão 2.0.0.
A parte relevante para citar e construir as bibliografias você pode ver na seguinte parte do 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
O comando \nocitebook{book1,book2}
cita primeiro book1
e depois book2
. Com o comando \bibliographystylebook{unsrt}
você escolhe o estilo da bibliografia, neste caso unsrt
, isso significa mostrar os verbetes da bibliografia na ordem de citação. O mesmo para o segundo multibib
, você tem que fazer isso uma terceira vez para o terceiro multibib
.
O uso multibib
mudou a cadeia de compilação usual. Com os dois programas multibibs acima você precisa compilar com:
pdflatex mwe.tex
, suponha que seu currículo esteja armazenado no arquivomwe.tex
. Após compilar o cv você encontrará dois arquivosbook.aux
emisc.aux
no mesmo diretório que você possuimwe.tex
. No seu caso, você deve encontrar três arquivosjournal.aux
e .preprint.aux
bthesis.aux
bibtex book
para construir a primeira bibliografia multibib.bibtex misc
para construir a segunda bibliografia.pdflatex mwe.tex
duas vezes para obter números de página adequados, índice, etc., como de costume.
Com a versão atual moderncv
(2.0.0), você não precisa copiar o \renewenvironment{thebibliography}[1]%
bloco em seu código. É claro que você deve definir os multibibs usados \newcites{journal,preprint,bthesis}{{Journals},{Technical Reports \& Pre-prints},{Bachelor Thesis}}
no preâmbulo (como fiz para os dois arquivos bib neste exemplo).
Com o seguinte compilado MWE (usando o arquivo bib publication.bib
do moderncv
modelo):
% 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}
você obtém o resultado:
Para ter certeza, você pode testar meu MWE aqui, o arquivo bib de amostra 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'.