Jika ada yang membaca posting lama ini, TeX tidak tahu di mana jeda halaman akan terjadi saat menyusun teks menjadi paragraf, jadi kecuali Anda berbicara tentang baris dalam paragraf, tidak, tidak ada cara mudah untuk mendapatkan nomor baris.
Jika Anda tahu bahwa paragraf Anda melintasi batas halaman, maka cara potensi untuk mendapatkan nomor baris akan melibatkan penempatan \write penanda posisi yang tepat di tempat yang tepat di halaman, yang menulis ke file .parlocs. Di akhir pekerjaan, cari selisih antara itu dan awal halaman/kolom sebelumnya dan membagi angka itu dengan ukuran baseline.
Namun, matematikanya menjadi rumit oleh apa pun seperti judul bagian, gambar, atau perubahan spasi baris, dan tentu saja itu didasarkan pada eksekusi sebelumnya, jadi hasilnya mungkin salah.
Ini pada dasarnya adalah versi yang lebih rumit dari cara potongan offset untuk gambar dihitung, (mereka hanya perlu khawatir tentang hitungan ke dalam paragraf) dan hasilnya di sana adalah … biasanya benar tetapi tidak selalu.
Mengenai tautan, saya tidak tahu apakah di atas atau dokumentasinya jelas: atribut tidak perlu dilampirkan ke \w atau gaya karakter tertentu lainnya, ptxt2pdf membuat tautan berdasarkan nama atribut, bukan penanda tempat atribut dilampirkan.
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.
Diterjemahkan secara otomatis dari English