Como alterar o arquivo IEEETran.bst para ignorar os meses na data?

Como alterar o arquivo IEEETran.bst para ignorar os meses na data?

Estou escrevendo minha tese com Lyx e BibTex para criar minha bibliografia. Meu .bib é gerado pelo Mendeley. Então, o que tento fazer é encontrar uma maneira de alterar meu arquivo de estilo IEEEtran.bst para ignorar os meses do BibTeX.

No momento a saída inclui o mês e o ano de publicação:

..., dezembro de 2017

Mas preciso remover os meses de cada entrada. Como o .bibarquivo é gerado pelo Mendeley, alterá-lo não funciona para mim. Também deletar os meses manualmente também não está funcionando, pois o Mendeley atualiza automaticamente essas informações.

A função para a data no arquivo IEEETran é assim:

FUNCTION {format.date}
{
  month "month" bibinfo.check duplicate$ empty$
  year  "year" bibinfo.check duplicate$ empty$
    { swap$ 'skip$
        { this.to.prev.status
          this.status.std
          cap.status.std
         "there's a month but no year in " cite$ * warning$ }
      if$
      *
    }
    { this.to.prev.status
      this.status.std
      cap.status.std
      swap$ 'skip$
        {
          swap$
          " " * swap$
        }
      if$
      *
    }
  if$
}

O problema é que não sei bem o que mudar para que o mês seja ignorado. Tentei muitas combinações possíveis de exclusão de peças. Mas ainda não consigo encontrar uma solução... Alguém pode me ajudar aqui?

Responder1

Pois @article, format.datetem que ser alterado assim:

FUNCTION {format.date}
{
  "" duplicate$ empty$
  year  "year" bibinfo.check duplicate$ empty$
    { swap$ 'skip$
        { this.to.prev.status
          this.status.std
          cap.status.std
         "there's a month but no year in " cite$ * warning$ }
      if$
      *
    }
    { this.to.prev.status
      this.status.std
      cap.status.std
      swap$ 'skip$
        {
          swap$
          " " * swap$
        }
      if$
      *
    }
  if$
}

e para @inproceedings, format.address.org.or.pub.datedeve ser modificado.

FUNCTION {format.address.org.or.pub.date}
{ 't :=
  ""
  year empty$
    { "empty year in " cite$ * warning$ }
    { skip$ }
  if$
  address empty$ t empty$ and
  year empty$ and month empty$ and
    { skip$ }
    { this.to.prev.status
      this.status.std
      cap.status.std
      address "address" bibinfo.check *
      t empty$
        { skip$ }
        { punct.period 'prev.status.punct :=
          space.large 'prev.status.space :=
          address empty$
            { skip$ }
            { ": " * }
          if$
          t *
        }
      if$
      year empty$ month empty$ and
        { skip$ }
        { t empty$ address empty$ and
            { skip$ }
            { ", " * }
          if$
          month empty$
            { year empty$
                { skip$ }
                { year "year" bibinfo.check * }
              if$
            }
            { year empty$
                 { skip$ }
                 { " " * year "year" bibinfo.check * }
              if$
            }
          if$
        }
      if$
    }
  if$
}

insira a descrição da imagem aqui

\documentclass[journal]{IEEEtran}
\usepackage{filecontents}
\begin{filecontents}{refs.bib}
@article{fuext1,
    year={2004},
    month={May},
    booktitle={$23^{rd}$ International Conference on the Theory and Applications of Cryptographic Techniques (EUROCRYPT)},
    volume={3027},
    title={Fuzzy Extractors: How to Generate Strong Keys from Biometrics and Other Noisy Data},
    publisher={{LNCS}, Springer Berlin Heidelberg},
    author={Dodis, Yevgeniy and Reyzin, Leonid and Smith, Adam},
    address={Interlaken, Switzerland},
    pages={523-540},
}

@inproceedings{fuext2,
    year={2004},
    month={May},
    booktitle={$23^{rd}$ International Conference on the Theory and Applications of Cryptographic Techniques (EUROCRYPT)},
    volume={3027},
    title={Fuzzy Extractors: How to Generate Strong Keys from Biometrics and Other Noisy Data},
    author={Dodiz, Yevgeniy and Reyzin, Leonid and Smith, Adam},
    address={Interlaken, Switzerland, {LNCS}, Springer Berlin Heidelberg},
    pages={523-540},
}
\end{filecontents}

\begin{document}
Article \cite{fuext1} and Proceedings \cite{fuext2}.
\bibliographystyle{IEEEtran}
\bibliography{refs}
\end{document}

Responder2

A sintaxe do BibTeX pode ser bastante confusa - a solução mais fácil às vezes é copiar uma função de um estilo bibliográfico mais básico com uma sintaxe mais simples.

O seguinte é modificado de abbrvnat.bst:

FUNCTION {format.date}
{ year  "year" bibinfo.check duplicate$ empty$
    { "empty year in " cite$ * warning$
       pop$ "" }
    'skip$
  if$
}

Observe que IEEEtran.bstele usa uma função de formatação de data separada para inproceedingsentradas, portanto isso também deve ser editado:

FUNCTION {format.address.org.or.pub.date}
{ 't :=
  ""
  year empty$
    { "empty year in " cite$ * warning$ }
    { skip$ }
  if$
  address empty$ t empty$ and
  year empty$ and month empty$ and
    { skip$ }
    { this.to.prev.status
      this.status.std
      cap.status.std
      address "address" bibinfo.check *
      t empty$
        { skip$ }
        { punct.period 'prev.status.punct :=
          space.large 'prev.status.space :=
          address empty$
            { skip$ }
            { ": " * }
          if$
          t *
        }
      if$
      year empty$ month empty$ and
        { skip$ }
        { t empty$ address empty$ and
            { skip$ }
            { ", " * }
          if$
          month empty$
            { year empty$
                { skip$ }
                { year "year" bibinfo.check * }
              if$
            }
            { year empty$ % removed printing the month string here
                 { skip$ }
                 { " " * year "year" bibinfo.check * }
              if$
            }
          if$
        }
      if$
    }
  if$
}

MWE usando o modificado IEEEtran.bst:

\documentclass{article}
\begin{filecontents}{\jobname.bib}
@article{articlemonth,
  author = {Mary Jones},
  title = {First Things},
  journal = {Journal of Things},
  month = {jan},
  year = {2017}
}

@inproceedings{proceedingsmonth,
  author = {Joe Peterson},
  title = {Briefly Explained},
  booktitle = {Conference of Briefness},
  month = {feb},
  year = {2017}
}
\end{filecontents}
\begin{document}
See \cite{articlemonth,proceedingsmonth}.

\bibliographystyle{IEEEtranmod}
\bibliography{\jobname}
\end{document}

Resultado:

insira a descrição da imagem aqui

informação relacionada