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

URL not breaking nicely with ragged right footnotes #83

Open
nickw2066 opened this issue Jan 17, 2025 · 2 comments
Open

URL not breaking nicely with ragged right footnotes #83

nickw2066 opened this issue Jan 17, 2025 · 2 comments

Comments

@nickw2066
Copy link

Describe the bug
URLs don't seem to break nicely if footnotes are ragged right.

Additional information

  • TeX distribution: MacTeX 2024
  • Package citation-style-language version: latest
  • LaTeX engine: lualatex

To Reproduce

\documentclass{article}

\begin{filecontents}[overwrite, noheader]{\jobname.json}
[
    {
        "id": "Crane2024-freque",
        "type": "webpage",
        "editor": [
            {
                "family": "Crane",
                "given": "Gregory"
            }
        ],
        "title": "Word frequency information for WORD",
        "collection-title": "Perseus Digital Library",
        "publisher": "Tufts University",
        "URL": "http://www.perseus.tufts.edu/hopper/wordfreq?lookup=i)dou/&lang=greek&sort=name",
        "accessed": {
            "date-parts": [
                [
                    "2024",
                    "06",
                    "20"
                ]
            ]
        }
    }
]

\end{filecontents}

\usepackage[ragged]{footmisc}

\usepackage{citation-style-language}
\cslsetup{style = turabian-fullnote-bibliography}
\addbibresource{\jobname.json}

\begin{document}

test url breaking in footnote\cite{Crane2024-freque}

\end{document}

Screenshots
The URL is not breaking nicely:

Image

However, if I comment out "\usepackage[ragged]{footmisc}", then the URL breaks nicely:

Image
@nickw2066
Copy link
Author

nickw2066 commented Jan 18, 2025

The same kind of issue happens in the bibliography when \raggedright is used before \printbibliography. The command \RaggedRight from the package ragged2e seems to do much better than \raggedright in this case. It seems the issue is not with citation-style-language but with my previous failure to use \RaggedRight instead of \raggedright.

@zepinglee
Copy link
Owner

The same kind of issue happens in the bibliography when \raggedright is used before \printbibliography. The command \RaggedRight from the package ragged2e seems to do much better than \raggedright in this case. It seems the issue is not with citation-style-language but with my previous failure to use \RaggedRight instead of \raggedright.

Yes, this issue can be reproduced with the following piece of code and it's not related to csl. I think ragged2e is the correct solution.

\documentclass{article}
% \usepackage{ragged2e}
\usepackage[ragged]{footmisc}
\usepackage{xurl}
\usepackage{hyperref}

\begin{document}
\footnote{Gregory Crane, ed., “Word Frequency Information for WORD,” Perseus
  Digital Library (Tufts University), accessed June 20, 2024,
  \url{http://www.perseus.tufts.edu/hopper/wordfreq?lookup=i)dou/&lang=greek&sort=name}.}
\end{document}
Image

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

2 participants