A @table now renders to txt. What it needed settled how plain text sets a block off from the prose around it, which is by INDENTING it: that is the only structural device the medium has, where html and LaTeX have boxes, rules and space. An indented block is one that has already been laid out, and the target leaves its lines alone. A caption is placed above a table or a listing and below a figure, in every target rather than only in plain text. A figure is taken in at a glance, and the caption then names what the reader has already seen; a table is read, and a reader who meets the rows before the subject has to read them twice. Also fixed, all three of them silent: an indented paragraph was dropped from plain-text output rather than left as written; an @indent block was re-flowed, so the indentation of its later lines appeared as gaps in the middle of a line; and a table captioned with ":number false" lost the rule under its caption, while an unnumbered table wrongly consumed a number that a reader counting captions would then find missing. (from dev 8173c371bba6)
92 lines
2.9 KiB
Plaintext
92 lines
2.9 KiB
Plaintext
#[
|
||
The targets in the SKS use the LaTeX convention for converting ASCII
|
||
characters into standard typographical characters. This is done
|
||
by LaTeX by default; other targets must use the transforms parameter
|
||
of Parameter_set, as defined for the m_parameters variable of the
|
||
Target_registry class. (See file target_registry.cpp.)
|
||
|
||
The LaTeX transformations supported by the SKS are:
|
||
|
||
-- -> en-dash
|
||
--- -> em-dash
|
||
` -> open single quote
|
||
' -> close single quote
|
||
`` -> open double quote
|
||
'' -> 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.
|
||
|
||
]#
|
||
|
||
|
||
@@@state Target_txt_width
|
||
:desc Width of the text in the plain text target (txt)
|
||
:value 72
|
||
@@@
|
||
|
||
@@@state Target_txt_indent
|
||
:desc Width of indentation in the plain text target (txt)
|
||
:value 3
|
||
@@@
|
||
|
||
# The txt target is not fully implemented in the SKS yet.
|
||
@@@target txt | Plain text with formatting |
|
||
-- - |
|
||
--- -- |
|
||
`` " |
|
||
'' " |
|
||
` ` |
|
||
' ' |
|
||
~ ^0020^
|
||
:after_apply
|
||
phases.txt_format_footnotes ;
|
||
phases.txt_insert_captions ;
|
||
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{}
|
||
:resolve - {-} ~ \textasciitilde{}
|
||
@@@
|
||
|
||
@@@target pdf | PDF from LaTeX
|
||
:includes tex
|
||
:after_apply
|
||
^:cpp *KLAMMERTEXT_HOME*/sks/document/document tex_to_pdf
|
||
@@@
|
||
|