Au cas où quelqu'un lirait un post aussi ancien, TeX ne sait pas où se trouveront les sauts de page lorsqu'il dispose le texte en paragraphe, donc, à moins que vous ne parliez des lignes à l'intérieur du paragraphe, non, il n'y a pas de moyen facile d'obtenir des numéros de ligne.
Si vous savez que votre paragraphe traverse une limite de page, alors le moyen potentiel d'obtenir des numéros de ligne consisterait à placer le bon type de \write de marquage de position sur la page au bon endroit, ce qui écrit dans le fichier .parlocs. À la fin du travail, trouvez la différence entre cela et le début précédent de la page/colonne et divisez ce nombre par la taille de la ligne de base.
Cependant, les calculs deviennent compliqués par tout ce qui ressemble à un en-tête de section, une figure ou un changement d'interligne, et bien sûr, cela est basé sur l'exécution précédente, donc le résultat pourrait être faux.
Ceci est essentiellement une version plus compliquée de la façon dont les découpes de décalage pour les figures sont calculées (elles n'ont besoin de se soucier que du compte à l'intérieur du paragraphe) et le résultat est … normalement correct mais pas toujours.
Concernant les liens, je ne sais pas si ce qui précède ou la documentation est clair : les attributs n'ont pas besoin d'être attachés à \w ou à un autre style de caractère particulier, ptxt2pdf crée des liens en fonction du nom de l'attribut, et non du marqueur auquel l'attribut est attaché.
In case anyone reads such an old post, TeX has no idea where page breaks will be when it is arranging text into a paragraph, so unless you’re talking about lines into the paragraph, no, there’s no easy way to get line numbers.
If you know that your paragraph is crossing a page boundary, then the potential way to get line numbers would involve dropping the right sort of position-marking \write onto the page in the right place, which writes to the .parlocs file. At the end of the job, find the difference between that and the previous start of the page/column and dividing that number by the size of the baseline.
The maths, however, gets complicated by anything like a section-header, figure or change in line spacing, and of course it is based on the previous run, so the result might be wrong.
This is basically a more complicated version of how the offset cutouts for figures get calculated, (they only need to worry about the count into the paragraph) and the result there is … normally correct but not always.
Regarding the links, I don’t know if the above or the documentation is clear: the attributes don’t need to be attached to \w or any other particular character style, ptxt2pdf makes links based on the name of the attribute, not the marker the attribute is attached to.
Traduit automatiquement depuis English