Terima kasih Dan atas pertanyaan bagus Anda. Selamat datang di komunitas!
Ada banyak alasan bagus mengapa kami TIDAK ingin orang mengedit file USFM secara manual selama proses tata letak/pemajegan (typesetting), jadi Viewer yang menunjukkan “USFM yang diproses” yang dimasukkan ke program pemajegan (XeTeX) terutama ada untuk tujuan diagnostik. Ini menunjukkan hasil akhir dari semua pra-pemrosesan yang telah terjadi karena banyaknya pengaturan di Aplikasi.
MESKIPUN DEMIKIAN, ada kabar baik: Sudah ada mekanisme untuk melakukan persis apa yang Anda minta dengan mengotomasikannya sepenuhnya melalui aturan cari dan ganti yang cerdas (disebut Regular Expressions, atau RegEx). Di tab advanced (lanjutan) ada opsi untuk mengaktifkan PrintDraftChanges.txt agar diterapkan pada teks.
Setelah Anda mengklik Edit, Anda mungkin melihat file dengan banyak aturan di dalamnya, atau mungkin hanya ada file kosong di editor.
# A rule in this PrintDraftChange.txt file uses this syntax:
"Find what" > "Replace with"
Maka untuk tugas “menghapus judul yang duplikat” ini, Anda perlu menambahkan aturan RegEx yang akan terlihat seperti ini:
"\\rem (.+?)\r?\n\\s \1\r?\n" > "\\s \1\r\n"
Jika yang saya miliki di atas tidak cukup sesuai dengan kebutuhan Anda, maka sesuaikan sesuai kebutuhan (misalnya ganti \rem dengan penanda apa pun yang Anda miliki di teks Anda). Saya sangat merekomendasikan menggunakan situs seperti regex101.com untuk menyempurnakan ekspresi Anda, dan menguji string Cari dan Substitusi Anda pada subset kecil data Anda sampai berhasil.
Semoga ini membantu, tetapi jika Anda masih kesulitan, silakan minta klarifikasi lebih lanjut.
Thanks Dan for your good question. Welcome to the community!
There are many good reasons why we DON’T want people to be editing the USFM files manually during the layout/typesetting process, so the Viewer that shows you the “processed USFM” which gets fed into the typesetting program (XeTeX) is primarily there for diagnostic purposes. It shows the end result of all the pre-processing that has taken place due to the multitude of settings in the App.
HOWEVER, there is good news: There already is a mechanism to do exactly what you’re asking for by automating it completely through clever find and replace rules (called Regular Expressions, or RegEx). On the advanced tab is an option to enable PrintDraftChanges.txt to be applied to the text.
Once you’ve clicked on Edit, you might see a file with a bunch of rules in it, or there may just be an empty file in the editor.
# A rule in this PrintDraftChange.txt file uses this syntax:
"Find what" > "Replace with"
So for this “strip out the duplicate headings” task, you’ll need to add a RegEx rule which will look something like this:
"\\rem (.+?)\r?\n\\s \1\r?\n" > "\\s \1\r\n"
If what I have above doesn’t quite match your needs, then adjust it as needed (for example replace \rem with whatever marker you have in your text). I highly recommend using a site like regex101.com to refine your expression, and test out your Find and Substitution strings on a small subset of your data until it works.
I hope this helps, but if you’re still stranded, please ask for further clarification.
Diterjemahkan secara otomatis dari English Tampilkan asli