retorquere / zotero-better-bibtex

Make Zotero effective for us LaTeX holdouts
https://retorque.re/zotero-better-bibtex/
MIT License
5.32k stars 285 forks source link

Match against @string value for export #1597

Closed DanteSung closed 4 years ago

DanteSung commented 4 years ago

Hi, I'm currently using Zotero 5.0.89 and Better bibtex 5.2.47. I'm trying to use the @string var exporting feature.

I'm used to capturing papers online but the proceeding titles are usually messy. For example, the booktitle filed contains too much redundant information:

@inproceedings{thrampoulidisBer2016,
  title = {Ber Analysis of the Box Relaxation for BPSK Signal Recovery},
  booktitle = {2016 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
  author = {Thrampoulidis, Christos and Abbasi, Ehsan and Xu, Weiyu and Hassibi, Babak},
  ...
}

Suppose I have defined a @string var:

@STRING{IEEE_C_ICASSP    = "IEEE Int. Conf. Acoust., Speech, Signal Process. (ICASSP)" }

Is it possible to export the following automatically?

booktitle = IEEE_C_ICASSP
retorquere commented 4 years ago

Yes: https://retorque.re/zotero-better-bibtex/installation/preferences/advanced/#if-a-field-could-be-a-string-var-export-it-without-braces

retorquere commented 4 years ago

Does this answer your question?

DanteSung commented 4 years ago

Thanks for the reply. I did put a @string in the advanced setting as

@STRING{IEEE_J_WC       = "IEEE Transactions on Communications"}

and tried all the three options in If a field could be a @string var, export it without braces, but I just got the output as:


@article{bjornsonScalable2020,
  title = {Scalable Cell-Free Massive MIMO Systems},
  author = {Bj\"ornson, Emil and Sanguinetti, Luca},
  date = {2020},
  journaltitle = {IEEE Transactions on Communications},
  shortjournal = {IEEE Trans. Commun.},
  pages = {1--1},
...
}

Is there any further setting that I ignored?

retorquere commented 4 years ago

Since this concerns export, I need a debug log:

  1. you have included an error-report ID here generated by reproducing the problem, selecting the problematic reference(s), right-clicking, and submitting an BBT error report from that popup menu, not from the Help menu.
DanteSung commented 4 years ago

Here is the Report ID VKMQB53H-euc. Please check it out.

blip-bloop commented 4 years ago

:robot: this is your friendly neighborhood build bot announcing test build 5.2.47.6896 ("Merge branch 'master' into gh-1597")

Install in Zotero by downloading test build 5.2.47.6896, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

DanteSung commented 4 years ago

Thanks for the quick reply! It works perfectly for both @string definitions below:

@STRING{IEEE_J_SP         = "{IEEE} Transactions on SIgnal Processing"}
@STRING{IEEE_J_WC       = "{IEEE} Transactions on Communication"}

It seems that the Publication field has to fully match the @string definition.

Redundant information still seems to be troublesome. For example, if I have:

booktitle = {2016 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},

and the @string var being

@STRING{IEEE_C_ICASSP    = "IEEE Int. Conf. Acoust., Speech, Signal Process. (ICASSP)" }

The output will be

@inproceedings{thrampoulidisBer2016,
  title = {Ber Analysis of the Box Relaxation for BPSK Signal Recovery},
  booktitle = {2016 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
  author = {Thrampoulidis, Christos and Abbasi, Ehsan and Xu, Weiyu and Hassibi, Babak},
  ...
}

Is it possible to extract the key information from the booktitle and still export IEEE_C_ICASSP?

BTW the debug report ID is 544ZK6FA-euc Thank you for your kind help!

retorquere commented 4 years ago

How would you propose I'd match those?

retorquere commented 4 years ago

Closing for inactivity. The change in 6896 will be in the next release.

DanteSung commented 4 years ago

Sorry for my late reply. Is it possible to continue this issue?

DanteSung commented 4 years ago

My proposal would be as follows.

This one for example,

booktitle = {2016 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},

and

@STRING{IEEE_C_ICASSP    = "IEEE Int. Conf. Acoust., Speech, Signal Process. (ICASSP)" }

If more than three keywords Acoustics, Speech, and Processing mathes the @string definition, then output IEEE_C_ICASSP.

The motivation behind this is that the IEEEabbr.bib file is widely used. It would be really great that bbt can direcyly export corresponding strings.

retorquere commented 4 years ago

That seems a bit iffy, and in this example, the 3 keywords don't even match the string declaration; "Acoustics" doesn't occur in the declaration. And how would I know which of the words in the journal field are keywords and which are not?

DanteSung commented 4 years ago

I think the only possible way would be matching against @srting value. Otherwise, it would require too many efforts to detect which abbr. is desired.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.