• R/O
  • SSH

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Reference Documentation: PDF Publishing with GNU Troff


コミットメタ情報

リビジョンba8c36f7081870ed49aaafd95f5ea4c8bf14c346 (tree)
日時2023-04-12 02:10:57
作者Keith Marshall <keith@user...>
コミッターKeith Marshall

ログメッセージ

Handle hyphenation special characters in PDF outlines.

* tmac/sanitize.tmac (sanitize): Interpret "\%" specially.
(sanitize:esc-(, sanitize:esc-(hy): New macros; they add generic
support for "\(xx", and specialization for "\(hy", respectively.

変更サマリ

差分

diff -r 514387ae8943 -r ba8c36f70818 tmac/sanitize.tmac
--- a/tmac/sanitize.tmac Tue Apr 11 11:03:29 2023 +0100
+++ b/tmac/sanitize.tmac Tue Apr 11 18:10:57 2023 +0100
@@ -58,7 +58,18 @@
5858 . \" is found, we prepare to skip an escape sequence.
5959 . \"
6060 . ec !
61-. if '!*[sanitize:scan.char]'\\' .nr sanitize:skip.count 1
61+. ie '!*[sanitize:scan.char]'\\' .nr sanitize:skip.count 1
62+. el .if '!*[sanitize:scan.char]'!%' !{!
63+. \" The "\%" escape requires special handling; assuming
64+. \" that it will never be used to introduce a hyphen into
65+. \" a PDF outline entry, it may simply be discarded, by
66+. \" the expedient of handling it as if it is equivalent
67+. \" to an artificial "\F%" escape sequence.
68+. \"
69+. ds sanitize:residual F%!*[sanitize:residual]
70+. nr sanitize:residual.length +2
71+. nr sanitize:skip.count 1
72+. !}
6273 . ec
6374 . ie \\n[sanitize:skip.count] \{\
6475 . \" When a possible escape sequence has been detected, we back it
@@ -142,6 +153,28 @@
142153 . el .nr sanitize:skip.count 0
143154 . \}
144155 ..
156+.de sanitize:esc-(
157+.\" Usage (internal): .sanitize:esc-(
158+.\"
159+.\" Handler for interpretation special character escape sequences,
160+.\" which are expressed in the form "\(xx".
161+.\"
162+. ds sanitize:look-ahead \\*[sanitize:residual]
163+. substring sanitize:look-ahead 0 1
164+. if d \\$0\\*[sanitize:look-ahead] .\\$0\\*[sanitize:look-ahead]
165+. rm sanitize:look-ahead
166+..
167+.de sanitize:esc-(hy
168+.\" Usage (internal): .sanitize:esc-(hy
169+.\"
170+.\" Handler for translation of "\(hy" special character escapes
171+.\" within sanitized PDF outline entries; each is replaced by an
172+.\" (approximately) equivalent ASCII "-" character.
173+.\"
174+. substring sanitize:residual 2
175+. ds sanitize:residual -\\*[sanitize:residual]
176+. nr sanitize:residual.length -1
177+..
145178 .de sanitize:esc-generic
146179 .\" Usage (internal): .sanitize:esc-X
147180 .\"