Topic on Talk:Reading/Web/PDF Functionality/Flow

Bad formatting of text in PDF output

7
Kaartic (talkcontribs)

The PDF output for the w:en:Glossary of Sudoku page is badly formatted in a few ways:

  • There are several instances of overlapping text in the whole article and they are more pronounced in the 'Other terminology' section.
  • There are instances of 'Spaces between words missing (visually)' issue in some places e.g. there should be a space between 'givens' and 'for' in the definition for 'Minimum number of clues' in the 'Other terminology' section. I say (visually) because copying and pasting the text in a text editor does reveal the space between the two words.
  • In the 'Notes' section the text is linkified when the are links but the URL is also displayed which seems to be redundant and spoiling the readability of the text. It might be better to avoid the showing URL when the text is linkified.
This seems to be happening when the links are created using the {{cite web}} template.
TheDJ (talkcontribs)

The first two are the same issue and is tracked as phab:T178665. The latter is intentional, as usually in print you dont have links, and since they are so critical for the sourcing, they are always added in the print version. Since there is no special CSS PDF medium and also because many of the pdfs are actually used later on for printing, its probable that the links in the referencing will remain this way for the foreseeable future

Kaartic (talkcontribs)

Thanks. Regarding the links, in that case why aren't the URLs of the links created using [URL label] revealed but just linkified?

PMiazga (WMF) (talkcontribs)

The link is added by using [ link link ] and it's rendered correctly. The best/easiest way is to edit the page and change the link name.

There is an unconditional rule in the CSS (https://github.com/wikimedia/mediawiki/blob/master/resources/src/mediawiki.legacy/commonPrint.css#L69). Each time the browser renders a link in print view - it adds (href) after it. There is no way to do the conditional checking for link content in CSS, because of that we cannot check if link href and content are identical. This would require an additional parsing (or JS processing before we print the document).

Kaartic (talkcontribs)

I wasn't referring of the links added using [link link] in the "Notes" section. I was referring to the "MAA Math Games – Sudoku Variations" link in the References section of the "Glossary of Sudoku" article. It's actually created using [URL label] but the style you point to doesn't seem to applied to it while it should have been. (BTW, thanks for the link)

PMiazga (WMF) (talkcontribs)

All external links will have label and the url. That's how the desktop print worked for pretty long time. The new print mode (for mobile, please try to print article using mobile site) will no display the URLs as those PDFs are designed to be read on mobile devices. The desktop PDF mode (using vector skin) is used both for reading on computer (where you can click a link) and for printing (where we need to show full URL if user wants to visit that website).

Kaartic (talkcontribs)

OK, didn't expect there was confusion about which printing I was referring to. Sorry about that. I was stating the issues I was facing with the PDF generated using the "Download as PDF" feature in desktop. I was elaborating on that as I found that behaviour odd. I guess it's time to speak with some screen shots.

I initially downloaded the PDF version of the "Glossary of Sudoku" using the "Download as PDF" feature. I noticed that the links in the "Notes" section of the PDF were both linkified and the corresponding URLs were also shown (which has been reasoned, fine). I also noticed that a link in the "References" section(the "MAA Math Games – Sudoku Variations" link) of the same article were styled differently linkified but URLs not shown. I find this odd because of the inconsistency in styling links in two sections.

Reply to "Bad formatting of text in PDF output"