1

I wanted to clean up my literature.bib file and sort all equal signs below each other.
As my editor is set to a width of only 81 characters I frequently have to add line breaks in the different fields.
This is no problem at all for fields like author, title or journal. But I get a problem when I want to add a line break into urls. The compiled link name is displayed correctly but the hyper link gets an extra space where the line break in my .bib file is.

@article{ Author:Year,
    author         = "A. Smith and J. Doe and M. Williams and D. Brown and
                      V. Johnson and H. Garcia"
    title          = "{Some very interesting publication with a much too long
                       title that ever would fit into one line}",
    journal        = "Journal This and That: with special focus on a lot of
                      different topics",
    url            = "https://tex.stackexchange.com/questions/554257/
                      is-there-a-way-to-force-the-tex-interpreter-to-ignore-a-
                      linebreak-in-the-source"
}

Resulting link name would be correct:
https://tex.stackexchange.com/questions/554257/is-there-a-way-to-force-the-tex-interpreter-to-ignore-a-linebreak-in-the-source
But the hyper link would forward to the non existing (because of the two spaces):
https://tex.stackexchange.com/questions/554257/ is-there-a-way-to-force-the-tex-interpreter-to-ignore-a- linebreak-in-the-source

This is only cosmetics, of course. But any change to get this working?
I tried already with a backspace to escape the newline but this did not work.

4
  • Welcome to TeX.SE.
    – Mico
    Jul 20, 2020 at 9:56
  • 1
    your title is a bit misleading as the answer for tex is yes, but you need bibtex not tex to ignore the line breaks and that is a different question Jul 20, 2020 at 10:03
  • 1
    you can end the lines of the url with %. See e.g. tex.stackexchange.com/a/529431/2388. Jul 20, 2020 at 10:21
  • 1
    @UlrikeFischer : that worked straight away. Thank you very much! Jul 20, 2020 at 10:33

0

You must log in to answer this question.

Browse other questions tagged .