zepinglee / gbt7714-bibtex-style

GB/T 7714-2015 BibTeX Style
LaTeX Project Public License v1.3c
1.16k stars 197 forks source link

Extra “//” in Bibtex Entry #82

Closed ashfaq92 closed 3 years ago

ashfaq92 commented 3 years ago

example.bib:

@inProceedings{my_key,
  author       = "author",
  title        = "title",
  booktitle    = "booktitle",
  year         = "year",
  editor       = "editor",
  volume       = "volume",
  number       = "number",
  series       = "series",
  pages        = "pages",
  address      = "address",
  publisher    = "publisher",
  note         = "note",
}

Code:

\addchaptertocentry{References}
\bibliographystyle{gbt7714-numerical}
\bibliography{example}

Output:

AUTHOR.title[C]//EDITOR. series:  volume    booktitle.   address:  publisher,  year:pages.

Issue: I dont know why "//" is getting printed. How to remove this?

Environment: pdflatex + overleaf.com Issue occurs for @inproceedings and @conference

Ideas: Some Stackexchange users suggested that the error my lie in Line 202 of gbt7714-numerical.bst file:

FUNCTION {bbl.slash} { "//\allowbreak " }

However, I dont know how to use this in overleaf.com. As overleaf.com does not show the code. I tried to make a custom .bst file by copying all the code of the above file, but this did not work as this was showing many errors.

FUNCTION {bbl.slash} { "//\allowbreak " }

zepinglee commented 3 years ago

The double slash mark is identical to "in:" which indicates this piece of work is extracted from the collection. It is specified in the GB/T 7714—2015 standard (in Chinese) but is rarely used in other styles.

If you prefer the format "Title. In: book title", you may edit the line https://github.com/CTeX-org/gbt7714-bibtex-style/blob/198c1992ac5513437b8d4c2696ccc3a640cc55fe/gbt7714-numerical.bst#L71 to #0 'in.booktitle :=.

ashfaq92 commented 3 years ago

How to edit this in overleaf. I cant see any .bst file here

zepinglee commented 3 years ago

How to edit this in overleaf. I cant see any .bst file here

You may upload an edited copy of the .bst to the project. Make sure the texlive version for the overleaf project is 2020 or later. This is because earlier versions of gbt7714 use different file names for bsts.

ashfaq92 commented 3 years ago

I have uploaded your mentioned .bst file and texlive version is 2020. Following are the two new issues: I suppose you meant converting #0 'in.booktitle := to #1 'in.booktitle :=

  1. Strangely, all my references style have been converted to author-year, while I want numerical style.
  2. Both "//" and "in:" are being shown in bibliography.

image

ashfaq92 commented 3 years ago

For issue 1, I figured out the root cause. While uploading the new (custom) .bst file, its name must not be changed. However, still, I am unable to figure out the 2nd issue.

zepinglee commented 3 years ago

Issue 2 is a bug. I'll fix it soon.

zepinglee commented 3 years ago

It's actually not a bug. The slash.for.extraction option needs to be set to #0 as well. These two lines https://github.com/CTeX-org/gbt7714-bibtex-style/blob/43c8761958d330fe0084c8986e0b808f8b041f17/gbt7714-numerical.bst#L70-L71 are modified to

  #0 'slash.for.extraction :=
  #1 'in.booktitle :=
ashfaq92 commented 3 years ago

Thank you. However, I noticed another discrepancy. In your original overleaf package, [S.1:s.n] used to be shown. However, after uploading your new file, I see it has been disappeared now.

Original Citation Format: image

New Citation Format after uploading your mentioned .bst file: image

zepinglee commented 3 years ago

This is an intentional change. Although specified in the standard, the “S.l.” and “s.n.” is really annoying since many bib sources do not provide the address or name of the publisher, especially for conference papers.

ashfaq92 commented 3 years ago

So, it would be great if you update overleaf.com's package accordingly

zepinglee commented 3 years ago

So, it would be great if you update overleaf.com's package accordingly

This requires the distribution of TeX Live 2022. The packages on the Overleaf platform are taken from TeX Live distributions and cannot be updated by package authors.