Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discuss wider @string syntax #32

Open
Neved4 opened this issue May 3, 2023 · 0 comments
Open

Discuss wider @string syntax #32

Neved4 opened this issue May 3, 2023 · 0 comments

Comments

@Neved4
Copy link

Neved4 commented May 3, 2023

Best suited for Discussions, but I'm opening an issue for reference.

After reversing for a while I found this interesting one, and it's so cozy that I find it not a bug but a feature.

In BibTeX/BibLaTeX there's the @STRING special entry, that defines abbreviations of strings and which the preprocessor will take care of.

So we can define our list of aliases or abbreviations:

@string{anch-ie = {Angew.~Chem. Int.~Ed.}}
@string{cup     = {Cambridge University Press}}
@string{dtv     = {Deutscher Taschenbuch-Verlag}}
@string{hup     = {Harvard University Press}}
@string{jams    = {J.~Amer. Math. Soc.}}
@string{jchph   = {J.~Chem. Phys.}}
@string{jomch   = {J.~Organomet. Chem.}}
@string{pup     = {Princeton University Press}}

And then we can use it instead of typing the full journal name, notice the field journaltitle:

@article{aksin,
  author       = {Aks{\i}n, {\"O}zge and T{\"u}rkmen, Hayati and Artok, Levent
                  and {\c{C}}etinkaya, Bekir and Ni, Chaoying and
                  B{\"u}y{\"u}kg{\"u}ng{\"o}r, Orhan and {\"O}zkal, Erhan},
  title        = {Effect of immobilization on catalytic characteristics of
                  saturated {Pd-N}-heterocyclic carbenes in {Mizoroki-Heck}
                  reactions},
  journaltitle = jomch,
  date         = 2006,
  volume       = 691,
  number       = 13,
  pages        = {3027-3036},
  indextitle   = {Effect of immobilization on catalytic characteristics},
}

At the same time, typst allows us an alternative syntax:

@string{
  anch-ie = {Angew.~Chem. Int.~Ed.},
  cup     = {Cambridge University Press},
  dtv     = {Deutscher Taschenbuch-Verlag},
  hup     = {Harvard University Press},
  jams    = {J.~Amer. Math. Soc.},
  jchph   = {J.~Chem. Phys.},
  jomch   = {J.~Organomet. Chem.},
  pup     = {Princeton University Press}
}

That will work and compile just fine, just like in the example above.

I'm not aware if this has unintended consequences or if there's good reasons to disallow it, personally I'd love that in the TeX world we supported that alternative syntax.

Again, I find it nice of typst 🧡, even if it won't work on BibTeX/BibLaTeX.

Examples come from biblatex-examples.bib.

@Neved4 Neved4 changed the title Discuss wider@string syntax Discuss wider @string syntax May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant