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

Cite encodes dash - strangely in URLs #5648

Open
fingolfin opened this issue Feb 20, 2024 · 5 comments
Open

Cite encodes dash - strangely in URLs #5648

fingolfin opened this issue Feb 20, 2024 · 5 comments

Comments

@fingolfin
Copy link
Member

I find the howpublished entries in the bibtex produced by Cite on master weird:

gap> Cite("smallgrp");
...
@misc{ SmallGrp1.5.3,
  author =           {Besche, H. U. and Eick, B. and O'Brien, E. and Horn, M.},
  title =            {{SmallGrp}, The GAP Small Groups Library, {V}ersion 1.5.3},
  month =            {May},
  year =             {2023},
  note =             {GAP package},
  howpublished =     {\href                                           {https://gap-packages.github.io/smallgrp/}
                      {\texttt{https://gap\texttt{\symbol{45}}packages.github.io/}\discretionary
                      {}{}{}\texttt{smallgrp/}}},
  printedkey =       {BEOH23}
}

Why does it "encode" the - in the URL as \symbol{45} ?

Beyond that, why does it do

\texttt{https://gap\texttt{\symbol{45}}packages.github.io/}

with a nested \texttt, instead of just

\texttt{https://gap-packages.github.io/}

Actually, taking a step back, I also wonder about the discretionary...

Here is what my ideal output for howpublished would look like:

  howpublished = {\url{https://gap-packages.github.io}}

Any objections to that?

Of course right now a lot of this comes down to us calling GAPDoc, and that then does whatever it considers best. But I don't understand why we do it that way -- why not just generate the appropriate BibTeX (etc.) ourselves? Then we have full control over how it looks.

@ChrisJefferson
Copy link
Contributor

I agree that the current thing doesn't seem necessary -- was it required in some much older versions of tex? I put - in bibtex and it seems to work fine.

@fingolfin fingolfin changed the title Cite encodes dash - strangely in URLs. Cite encodes dash - strangely in URLs Feb 23, 2024
@fingolfin
Copy link
Member Author

Actually it turns out the weird \texttt{\symbol{45}} in the URL was / is introduced by GAPDoc 1.6.7, which @frankluebeck just released -- I was using a prerelease git version of GAPDoc and hence was running into this before.

But now GAPDoc 1.6.7 is released, but has not been picked up by the GAP package distro precisely because it breaks the Cite test in the GAP test suite.

@frankluebeck is this an intentional change?

@frankluebeck
Copy link
Member

The change is due to a bug fix in GAPDoc in this commit.
I agree that in this specific case the source code does not look as nice as it could (as often in LaTeX and BibTeX), but it is correct. When I try to use the generated BibTeX entry the reference and bibliography entry look as intended and the link works as intended.

The \discretionary is used to support line breaks in long URLs.

Of course, you are free to change that generated Bib entry as you like when you copy it into one of your files.

@frankluebeck
Copy link
Member

PS: Just noticed: The output does not look as it should. The Cite function should probably escape capital letters in the title, e.g., in the given example:

       title =            {{SmallGrp}, The {GAP} {S}mall {G}roups {L}ibrary, {V}ersion 1.5.3},

or, as it is easier to implement:

       title =            {{SmallGrp}, {The GAP Small Groups Library}, {V}ersion 1.5.3},

@fingolfin
Copy link
Member Author

The use of discretionary is however broken (perhaps because it is only applied after the substitution of -) ? With a terminal width of 80, I am seeing:

  howpublished =     {\href                {https://mockpkg.gap-system.org/}
                      {\texttt{https://mockpkg.gap-system.org/}}},
                      {\texttt{https://mockpkg.gap\texttt{\symbol{45}}system.o\
rg/}}},

I also wonder why it doesn't just use \url{https://mockpkg.gap-system.org/} here?

As it is, I always edit the howpublished produced by Cite, I find it completely unacceptable in its current form.

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

3 participants