¿Cómo cambiar el archivo IEEETran.bst para ignorar los meses en la fecha?

¿Cómo cambiar el archivo IEEETran.bst para ignorar los meses en la fecha?

Estoy escribiendo mi tesis con Lyx y BibTex para crear mi bibliografía. Mi .bib es generado por Mendeley. Entonces, lo que trato de administrar es encontrar una manera de cambiar mi archivo de estilo IEEEtran.bst para ignorar los meses de BibTeX.

Actualmente la salida incluye el mes y el año de publicación:

..., diciembre de 2017

Pero necesito eliminar los meses de cada entrada. Como el .bibarchivo lo genera Mendeley, cambiarlo no me funciona. Además, eliminar los meses manualmente tampoco funciona, ya que Mendeley actualiza automáticamente esta información.

La función para la fecha en el archivo IEEETran tiene este aspecto:

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$
}

El problema es que no se muy bien que cambiar que se ignorará el mes. Probé muchas combinaciones posibles para eliminar partes. Pero todavía no puedo encontrar una solución... ¿Alguien puede ayudarme aquí?

Respuesta1

Para @article, format.datedebe cambiarse así:

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$
}

y para @inproceedings, format.address.org.or.pub.datedebe modificarse.

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$
}

ingrese la descripción de la imagen aquí

\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}

Respuesta2

La sintaxis de BibTeX puede resultar bastante confusa: a veces, la solución más sencilla es copiar una función de un estilo de bibliografía más básico con una sintaxis más sencilla.

Lo siguiente se modifica de abbrvnat.bst:

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

Tenga en cuenta que IEEEtran.bstutiliza una función de formato de fecha separada para inproceedingslas entradas, por lo que esto también debe editarse:

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 el 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:

ingrese la descripción de la imagen aquí

información relacionada