Verbatim-safe typography, ^-punctuation quoting, full-range ^UUUU^, polyglot html
Typographic transforms (---, quote pairs, ~) no longer touch verbatim text: @c/@code/@source_listing content and ^'...'^ spans show exactly the characters written. "^" before any punctuation character quotes it in every target (the apostrophe excepted: ^' opens a literal span), with the new :resolve option on @@@target declaring per-target renderings. The ^UUUU^ code-point form accepts 4-6 hex digits, the full Unicode range. The html output and transform spellings are polyglot (XML-valid), in preparation for an EPUB target. New suites: transform_test, character_test (engine), typography_test (SKS). (from dev 07ce5ea86a0a)
This commit is contained in:
@@ -15,10 +15,30 @@ The LaTeX transformations supported by the SKS are:
|
||||
'' -> close double quote
|
||||
~ -> non-breaking space
|
||||
|
||||
"^" before any punctuation character quotes it (an engine rule, not an SKS
|
||||
one): the character reaches the output literally, taking no part in the
|
||||
transforms above -- ^-^- writes two plain hyphens (a --flag in prose), ^~ a
|
||||
plain tilde. The one exception is the apostrophe: "^" before it opens a
|
||||
literal span instead (a literal apostrophe is ^0027^), and writing that
|
||||
pair even in THIS comment would open one -- the span sentinels are placed
|
||||
before text removal. A target where the raw character would
|
||||
still be re-interpreted declares its rendering with :resolve -- the tex
|
||||
target maps a quoted hyphen to {-} (a bare -- in .tex re-forms TeX's dash
|
||||
ligature) and a quoted tilde to \textasciitilde{} (a raw ~ is TeX's
|
||||
non-breaking space). Verbatim text (@c, @code, ^'...'^) never needs any
|
||||
of this: neither the transforms nor the quoting reach it.
|
||||
|
||||
]#
|
||||
|
||||
|
||||
@@@target txt | Plain text with formatting | # This txt target is not full implemented in the SKS yet.
|
||||
@@@state Target_txt_width
|
||||
:desc Width of the text in the plain text target (txt)
|
||||
:value 72
|
||||
@@@
|
||||
|
||||
|
||||
# The txt target is not fully implemented in the SKS yet.
|
||||
@@@target txt | Plain text with formatting |
|
||||
-- - |
|
||||
--- -- |
|
||||
`` " |
|
||||
@@ -27,24 +47,35 @@ The LaTeX transformations supported by the SKS are:
|
||||
' ' |
|
||||
~ ^0020^
|
||||
:after_apply
|
||||
phases.justify_blocks
|
||||
phases.txt_format_footnotes ;
|
||||
phases.txt_justify_blocks
|
||||
@@@
|
||||
|
||||
@@@target html | HTML page
|
||||
# :escape < < & & |
|
||||
|
|
||||
--- — |
|
||||
-- – |
|
||||
--- &^#x2014; |
|
||||
-- &^#x2013; |
|
||||
`` “ |
|
||||
'' ” |
|
||||
` ‘ |
|
||||
' ’ |
|
||||
^^~ ˜ |
|
||||
~
|
||||
~ &^#160;
|
||||
:after_apply
|
||||
phases.html_format_footnotes
|
||||
@@@
|
||||
|
||||
# No transforms: LaTeX applies the input conventions itself. The :resolve
|
||||
# entries say how a QUOTED character renders where the raw character would
|
||||
# still be re-interpreted by TeX: ^- resolves to {-}, not a bare -, or the
|
||||
# hyphens re-form a run and the dash ligature turns ^-^- into an en-dash;
|
||||
# ^~ resolves to \textasciitilde{}, since a raw ~ is TeX's non-breaking
|
||||
# space. Other quoted punctuation either has an :escape entry (its marker
|
||||
# takes the escape replacement: ^$ renders as \$) or decodes to the raw
|
||||
# character.
|
||||
@@@target tex | LaTeX
|
||||
:escape \ \textbackslash{} & \& { \{ } \} $ \$ % \% _ \_ ^# \^# ^^ \textasciicircum{}
|
||||
:escape \ \textbackslash{} & \& { \{ } \} $ \$ % \% _ \_ ^# \^# ^^ \textasciicircum{}
|
||||
:resolve - {-} ~ \textasciitilde{}
|
||||
@@@
|
||||
|
||||
@@@target pdf | PDF from LaTeX
|
||||
|
||||
Reference in New Issue
Block a user