BibTeX, biblatex and biber ⇒ pagebackref with \dotfill makes too long lines sometimes
pagebackref with \dotfill makes too long lines sometimes
i'm new in the forum and browsed the subtopics, but am not sure if my problem is for the BibteX subtopic or the general LaTeX text editting. I hope its correct here, if not, then feel free to move it.
I want to use backreference in the bibliography, but in the default settings, the page numbers where the citation occurs are just added behind the bibligraphy entries. This does not look good. I want to have it like in the list of figures or the list of tables: with dots " . . . . . . " and the pagenumbers at the right margin.
Therefore I just added manually "\dotfill" at the end of each bibliography entry. And in principle it works, sometimes. But sometimes, the last page number is written to the next line, although there is enough space on the old line. This error appeared only, when more than one pagenumber needs to be backreferenced. But sometimes it works correctly.
I don't know in which conditions LaTeX fails, I can't figure it out. Please help.
I attached a minimal example.
Greetings
- Attachments
-
- BackrefDotNewline.tex
- (453 Bytes) Downloaded 351 times
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
pagebackref with \dotfill makes too long lines sometimes
I looked into your example for a while, it seems to be related to the use of KOMA, which is strange. Really strange.
In your example, you are doing your bibliography by hand, which is quite unusual.
Are you doing this in your real document as well? I am too lazy and let this be handled by the biblatex/biber combo.
I am not sure (never looked into the backref mechanism) but this might be easier with biblatex.
Re: pagebackref with \dotfill makes too long lines sometimes
Q:
Could you explain, where "KOMA" is in my TeX-file? I heared this package once, but was not aware that I use it. What is it for and how to switch it on or off?
A:
In fact, I'm doing the bibliography in my document directly, as you supposed - and not in a separate file, since it is very impractical to split one document into several files. (I experienced this in my last work, so this time I do it all-in-one file, except style-files and \renewcommands which are imported in the preamble). Additionally, the formatting of the bibliographic information with author={...}, year={...}, etc. is very much too much unnecessary typing of the same commands for every referrence.
NEW:
Previously, I thought the error might be due to the TeXfont, but now I also reproduced the problem without the txfont-package (attached as *.tex and the result as *.png).
It seems to be related to hyphenation, as the newline only occurs, when there was an automatic hyphenation in the bibentry.
Hoping for some TeX-crack to look into the depth of hyphenation and backref.
Greetings,
Betabob
- Attachments
-
- BackrefDotfillTrouble.png (11.13 KiB) Viewed 4983 times
-
- BackrefDotNewline2.tex
- (336 Bytes) Downloaded 345 times
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Re: pagebackref with \dotfill makes too long lines sometimes
To make this work properly, one has to ennsure that the pagenumbers are set within one box. Or replacing the breakible space with an unbreakable space.
Re: pagebackref with \dotfill makes too long lines sometimes
Ok, I have some solution by just trying something to make a box around all the backref-pagenumbers. As \mbox{} cannot be split in a \begin ... \end, I just tried \begin{right} ... \end{right}.
In fact this was a guess and I could not find on the internet any explanation for this command. I'm not sure that it exists, but it works. I just put \begin{right} behind the \dotfill and \end{right} after an empty line just before the next bibentry. The empty line seems to be ABSOLUTELY necessary.
A little bit extended *.tex file to see that it works with several entries and screenshot are attached.
Could someone tell me, what this command might mess up in my document or what it is usually doing?
And is there a possibility to put both commands (\begin{right}, \end{right}) automatically in their position by some \renewcommmand or some fancy coding?
Greetings,
Betabob
- Attachments
-
- BackrefDotfillRight.png (39.05 KiB) Viewed 4897 times
-
- BackrefDotNewline3.tex
- (541 Bytes) Downloaded 343 times