From 3e43bc594a14e8c4fc21d6a71f22a23dd78fe252 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 21 Mar 2020 03:01:37 +0000 Subject: CTAN sync 202003210301 --- macros/luatex/generic/luatexko/ChangeLog | 7 + macros/luatex/generic/luatexko/README | 2 +- macros/luatex/generic/luatexko/luatexko-doc.pdf | Bin 324950 -> 325270 bytes macros/luatex/generic/luatexko/luatexko-doc.tex | 2 +- .../luatex/generic/luatexko/luatexko-normalize.lua | 4 +- .../luatex/generic/luatexko/luatexko-uhc2utf8.lua | 4 +- macros/luatex/generic/luatexko/luatexko.lua | 236 ++++---- macros/luatex/generic/luatexko/luatexko.sty | 59 +- macros/luatex/optex/README | 3 + macros/luatex/optex/alloc.opm | 2 +- macros/luatex/optex/basics-macros.opm | 2 +- macros/luatex/optex/bib-iso690.opm | 2 +- macros/luatex/optex/bib-simple.opm | 2 +- macros/luatex/optex/cite-bib.opm | 1 + macros/luatex/optex/colors.opm | 14 +- macros/luatex/optex/doc/op-ring.png | Bin 421951 -> 0 bytes macros/luatex/optex/doc/optex-doc.pdf | Bin 156310 -> 163979 bytes macros/luatex/optex/doc/optex-doc.tex | 609 +++++++++++---------- macros/luatex/optex/fams-ini.opm | 2 + macros/luatex/optex/fnotes.opm | 19 +- macros/luatex/optex/fonts-catalog.opm | 2 + macros/luatex/optex/fonts-opmac.opm | 2 +- macros/luatex/optex/fonts-preload.opm | 2 +- macros/luatex/optex/fonts-resize.opm | 4 +- macros/luatex/optex/fonts-select.opm | 19 +- macros/luatex/optex/graphics.opm | 146 ++++- macros/luatex/optex/hyperlinks.opm | 6 +- macros/luatex/optex/hyphen-lan.opm | 2 +- macros/luatex/optex/if-macros.opm | 2 +- macros/luatex/optex/languages.opm | 41 +- macros/luatex/optex/lists.opm | 5 +- macros/luatex/optex/logos.opm | 2 +- macros/luatex/optex/luatex-ini.opm | 4 +- macros/luatex/optex/makeindex.opm | 40 +- macros/luatex/optex/maketoc.opm | 2 +- macros/luatex/optex/margins.opm | 6 +- macros/luatex/optex/math-macros.opm | 2 +- macros/luatex/optex/math-preload.opm | 2 +- macros/luatex/optex/math-unicode.opm | 2 +- macros/luatex/optex/more-macros.opm | 138 +++++ macros/luatex/optex/multicolumns.opm | 2 +- macros/luatex/optex/op-demo.tex | 8 +- macros/luatex/optex/op-letter.tex | 41 ++ macros/luatex/optex/op-macros.opm | 140 ----- macros/luatex/optex/op-ring.png | Bin 421951 -> 512984 bytes macros/luatex/optex/op-slides.tex | 288 ++++++++++ macros/luatex/optex/opmac-rest.opm | 65 --- macros/luatex/optex/optex.ini | 4 +- macros/luatex/optex/others.opm | 2 +- macros/luatex/optex/outlines.opm | 2 +- macros/luatex/optex/output.opm | 17 +- macros/luatex/optex/parameters.opm | 9 +- macros/luatex/optex/pdfuni-string.opm | 2 +- macros/luatex/optex/plain-macros.opm | 2 +- macros/luatex/optex/prefixed.opm | 3 +- macros/luatex/optex/ref-file.opm | 3 +- macros/luatex/optex/references.opm | 21 +- macros/luatex/optex/sections.opm | 2 +- macros/luatex/optex/slides-bg.png | Bin 0 -> 62385 bytes macros/luatex/optex/slides.opm | 211 +++++++ macros/luatex/optex/styles.opm | 9 +- macros/luatex/optex/table.opm | 2 +- macros/luatex/optex/uni-lcuc.opm | 2 +- macros/luatex/optex/unimath-codes.opm | 4 +- macros/luatex/optex/usebib.opm | 5 +- macros/luatex/optex/verbatim.opm | 13 +- 66 files changed, 1523 insertions(+), 733 deletions(-) delete mode 100644 macros/luatex/optex/doc/op-ring.png create mode 100644 macros/luatex/optex/more-macros.opm create mode 100644 macros/luatex/optex/op-letter.tex delete mode 100644 macros/luatex/optex/op-macros.opm create mode 100644 macros/luatex/optex/op-slides.tex delete mode 100644 macros/luatex/optex/opmac-rest.opm create mode 100644 macros/luatex/optex/slides-bg.png create mode 100644 macros/luatex/optex/slides.opm (limited to 'macros/luatex') diff --git a/macros/luatex/generic/luatexko/ChangeLog b/macros/luatex/generic/luatexko/ChangeLog index 5ffa9cd5f2..2eb3dae8d6 100644 --- a/macros/luatex/generic/luatexko/ChangeLog +++ b/macros/luatex/generic/luatexko/ChangeLog @@ -1,3 +1,10 @@ +2020-03-20 Dohyun Kim + + Version 2.8 + + * luatexko.lua, luatexko.sty: + use atbegshi package for dotemph, uline, and ruby + 2020-03-14 Dohyun Kim Version 2.7 diff --git a/macros/luatex/generic/luatexko/README b/macros/luatex/generic/luatexko/README index 494b40edf9..1baf7bda2e 100644 --- a/macros/luatex/generic/luatexko/README +++ b/macros/luatex/generic/luatexko/README @@ -1,4 +1,4 @@ -LuaTeX-ko Package version 2.7 (2020/03/14) +LuaTeX-ko Package version 2.8 (2020/03/20) =========================================== This is a Lua(La)TeX macro package that supports typesetting Korean diff --git a/macros/luatex/generic/luatexko/luatexko-doc.pdf b/macros/luatex/generic/luatexko/luatexko-doc.pdf index b37128dcbb..aaee5aa145 100644 Binary files a/macros/luatex/generic/luatexko/luatexko-doc.pdf and b/macros/luatex/generic/luatexko/luatexko-doc.pdf differ diff --git a/macros/luatex/generic/luatexko/luatexko-doc.tex b/macros/luatex/generic/luatexko/luatexko-doc.tex index 7d57dee230..97bb5640a2 100644 --- a/macros/luatex/generic/luatexko/luatexko-doc.tex +++ b/macros/luatex/generic/luatexko/luatexko-doc.tex @@ -120,7 +120,7 @@ \author{Dohyun Kim \normalsize || \and Soojin Nam \normalsize || \and \normalsize <\url{http://github.com/dohyunkim/luatexko}>} -\date{Version 2.7\quad 2020/03/14} +\date{Version 2.8\quad 2020/03/20} \maketitle \begin{quote}\small diff --git a/macros/luatex/generic/luatexko/luatexko-normalize.lua b/macros/luatex/generic/luatexko/luatexko-normalize.lua index 0b4553f18f..243762aa2f 100644 --- a/macros/luatex/generic/luatexko/luatexko-normalize.lua +++ b/macros/luatex/generic/luatexko/luatexko-normalize.lua @@ -13,8 +13,8 @@ luatexbase.provides_module({ name = "luatexko-normalize", - version = "2.7", - date = "2020/03/14", + version = "2.8", + date = "2020/03/20", author = "Dohyun Kim, Soojin Nam", description = "Hangul normalization", license = "LPPL v1.3+", diff --git a/macros/luatex/generic/luatexko/luatexko-uhc2utf8.lua b/macros/luatex/generic/luatexko/luatexko-uhc2utf8.lua index 70b30b96e3..10ef613a94 100644 --- a/macros/luatex/generic/luatexko/luatexko-uhc2utf8.lua +++ b/macros/luatex/generic/luatexko/luatexko-uhc2utf8.lua @@ -13,8 +13,8 @@ luatexbase.provides_module({ name = "luatexko-uhc2utf8", - version = "2.7", - date = "2020/03/14", + version = "2.8", + date = "2020/03/20", author = "Dohyun Kim, Soojin Nam", description = "UHC (CP949) input encoding", license = "LPPL v1.3+", diff --git a/macros/luatex/generic/luatexko/luatexko.lua b/macros/luatex/generic/luatexko/luatexko.lua index 0720a4ecd9..95d8fc1a84 100644 --- a/macros/luatex/generic/luatexko/luatexko.lua +++ b/macros/luatex/generic/luatexko/luatexko.lua @@ -13,8 +13,8 @@ luatexbase.provides_module { name = 'luatexko', - date = '2020/03/14', - version = '2.7', + date = '2020/03/20', + version = '2.8', description = 'typesetting Korean with LuaTeX', author = 'Dohyun Kim, Soojin Nam', license = 'LPPL v1.3+', @@ -73,7 +73,6 @@ local callback_descriptions = luatexbase.callback_descriptions local create_callback = luatexbase.create_callback local module_warning = luatexbase.module_warning local new_user_whatsit = luatexbase.new_user_whatsit -local new_user_whatsit_id = luatexbase.new_user_whatsit_id local registernumber = luatexbase.registernumber local remove_from_callback = luatexbase.remove_from_callback @@ -93,7 +92,6 @@ local ruleid = node.id"rule" local vlistid = node.id"vlist" local whatsitid = node.id"whatsit" local literal_whatsit = node.subtype"pdf_literal" -local user_whatsit = node.subtype"user_defined" local directmode = 2 local fontkern = 0 local userkern = 1 @@ -110,6 +108,7 @@ local fallbackfontattr = attributes.luatexkofallbackfontattr local autojosaattr = attributes.luatexkoautojosaattr local classicattr = attributes.luatexkoclassicattr local dotemphattr = attributes.luatexkodotemphattr +local ulineattr = attributes.luatexkoulineattr local rubyattr = attributes.luatexkorubyattr local hangulbyhangulattr = attributes.luatexkohangulbyhangulattr local hanjabyhanjaattr = attributes.luatexkohanjabyhanjaattr @@ -465,13 +464,12 @@ luatexko.forcehangulchars = force_hangul local forcehf_f, forcehf_id = new_user_whatsit("forcehf","luatexko") -local function update_force_hangul (value) +function luatexko.updateforcehangul (value) local what = forcehf_f() what.type = lua_value -- function what.value = value nodewrite(what) end -luatexko.updateforcehangul = update_force_hangul local function hangul_space_skip (curr, newfont) if curr.lang ~= nohyphen and curr.font ~= newfont then @@ -517,7 +515,6 @@ local function process_fonts (head) is_not_harf(curr.font) and option_in_font(curr.font, "script") == "hang" then luatexko.activate("reorderTM") -- activate reorderTM here - active_processes.reorderTM = true end else @@ -556,10 +553,9 @@ local function process_fonts (head) curr.replace = process_fonts(curr.replace) elseif id == mathid then curr = end_of_math(curr) - elseif id == whatsitid - and curr.subtype == user_whatsit - and curr.user_id == forcehf_id - and curr.type == lua_value then + elseif id == whatsitid and + curr.user_id == forcehf_id and + curr.type == lua_value then local value = curr.value if type(value) == "function" then @@ -901,9 +897,7 @@ local function process_interhangul (head, par) if c and not is_unicode_var_sel(c) then head, pc = do_interhangul_option(head, curr, pc, c, curr.font, par) - if is_chosong(c) then - pc = 0 - elseif is_jungsong(c) or is_jongsong(c) or hangul_tonemark[c] then + if is_jungsong(c) or is_jongsong(c) or hangul_tonemark[c] then pc = 1 end end @@ -1210,11 +1204,22 @@ end local dotemphbox = {} luatexko.dotemphbox = dotemphbox -local function process_dotemph (head, tofree) - local curr, outer, tofree = head, not tofree, tofree or {} +local dotemph_f, dotemph_id = new_user_whatsit("dotemph","luatexko") + +function luatexko.dotemphboundary (i) + local what = dotemph_f() + what.type = lua_number + what.value = i + nodewrite(what) +end + +local function process_dotemph (head) + local curr = head while curr do - local id = curr.id - if id == glyphid then + if curr.list then + curr.list = process_dotemph(curr.list) + + elseif curr.id == glyphid then local dotattr = has_attribute(curr, dotemphattr) if dotattr then local c = my_node_props(curr).unicode or curr.char @@ -1231,7 +1236,13 @@ local function process_dotemph (head, tofree) local currwd = curr.width if currwd >= font_options.en_size[curr.font] then - local box = nodecopy(dotemphbox[dotattr]) + local box = nodecopy(dotemphbox[dotattr]).list + -- bypass unwanted nodes injected by some other packages + while box.id ~= hlistid do + warning[[\dotemph should be an hbox]] + box = getnext(box) + end + local shift = (currwd - box.width)/2 if shift ~= 0 then local list = box.list @@ -1245,28 +1256,26 @@ local function process_dotemph (head, tofree) box.width = 0 head = insert_before(head, curr, box) - tofree[dotattr] = true end end - unset_attribute(curr, dotemphattr) - end - elseif id == hlistid then - local list = curr.list - if list then - curr.list, tofree = process_dotemph(list, tofree) end + + elseif curr.id == whatsitid and + curr.user_id == dotemph_id and + curr.type == lua_number then + + local val = curr.value + nodefree(dotemphbox[val]) + dotemphbox[val] = nil end curr = getnext(curr) end - if outer then - for k in pairs(tofree) do nodefree(dotemphbox[k]) end - end - return head, tofree + return head end -- uline -local function get_strike_out_down (box) +function luatexko.get_strike_out_down (box) local c, f = hbox_char_font(box, true, true) -- ignore blocking nodes if c and f then local down @@ -1286,14 +1295,16 @@ local function get_strike_out_down (box) end return -texsp"0.5ex" end -luatexko.get_strike_out_down = get_strike_out_down local uline_f, uline_id = new_user_whatsit("uline","luatexko") -local no_uline_id = new_user_whatsit_id("no_uline","luatexko") -local function ulboundary (i, n, subtype) +function luatexko.ulboundary (i, n, subtype) local what = uline_f() if n then + while n.id ~= ruleid and n.id ~= hlistid and n.id ~= vlistid do + warning[[\markoverwith should be a rule or a box]] + n = getnext(n) + end what.type = lua_value -- table what.value = { i, nodecopy(n), subtype } else @@ -1302,7 +1313,6 @@ local function ulboundary (i, n, subtype) end nodewrite(what) end -luatexko.ulboundary = ulboundary local white_nodes = { [glueid] = true, @@ -1311,7 +1321,7 @@ local white_nodes = { [whatsitid] = true, } -function skip_white_nodes (n, ltr) +local function skip_white_nodes (n, ltr) local nextnode = ltr and getnext or getprev while n do if not white_nodes[n.id] then break end @@ -1323,66 +1333,78 @@ end local function draw_uline (head, curr, parent, t, final) local start, list, subtype = t.start or head, t.list, t.subtype start = skip_white_nodes(start, true) - if final then + if final and start then nodeslide(start) -- to get correct getprev. end curr = skip_white_nodes(curr) - curr = getnext(curr) or curr - local len = parent and rangedimensions(parent, start, curr) - or dimensions(start, curr) -- it works?! - if len and len ~= 0 then - local g = nodenew(glueid) - setglue(g, len) - g.subtype = subtype - g.leader = final and list or nodecopy(list) - local k = nodenew(kernid) - k.kern = -len - head = insert_before(head, start, g) - head = insert_before(head, start, k) + if start and curr then + curr = getnext(curr) or curr + local len = parent and rangedimensions(parent, start, curr) + or dimensions(start, curr) + if len and len ~= 0 then + local g = nodenew(glueid) + setglue(g, len) + g.subtype = subtype + g.leader = final and list or nodecopy(list) + local k = nodenew(kernid) + k.kern = -len + head = insert_before(head, start, g) + head = insert_before(head, start, k) + end end return head end -local function process_uline (head, parent, items, level) - local curr, items, level = head, items or {}, level or 0 +local ulitems = {} + +local function process_uline (head, parent, level) + local curr, level, attr = head, level or 0 while curr do - local id = curr.id - if id == whatsitid - and curr.subtype == user_whatsit - and curr.user_id == uline_id then + if curr.list then + curr.list = process_uline(curr.list, curr, level+1) + + elseif curr.id == whatsitid and curr.user_id == uline_id then local value = curr.value if curr.type == lua_value then local count, list, subtype = tableunpack(value) - items[count] = { - start = curr, + ulitems[count] = { list = list, subtype = subtype, level = level, } - elseif items[value] then - head = draw_uline(head, curr, parent, items[value], true) - items[value] = nil + else + local item = ulitems[value] + if item then + head = draw_uline(head, curr, parent, item, true) + ulitems[value] = nil + attr = nil + end end - curr.user_id = no_uline_id -- avoid multiple run - elseif id == hlistid then - local list = curr.list - if list then - curr.list, items = process_uline(list, curr, items, level+1) + else + local currattr = has_attribute(curr, ulineattr) + if currattr then + local item = ulitems[currattr] + if item and not item.start then + item.start = curr + attr = currattr + end end + end curr = getnext(curr) end - curr = nodeslide(head) - for i, t in pairs(items) do - if level == t.level then - head = draw_uline(head, curr, parent, t) - t.start = nil + if attr then + local item = ulitems[attr] + if item and item.level == level then + head = draw_uline(head, nodeslide(head), parent, item) + item.start = nil end end - return head, items + + return head end -- ruby @@ -1390,7 +1412,7 @@ end local rubybox = {} luatexko.rubybox = rubybox -local function getrubystretchfactor (box) +function luatexko.getrubystretchfactor (box) local _, fid = hbox_char_font(box, true, true) local str = font_options.intercharstretch[fid] if str then @@ -1398,7 +1420,6 @@ local function getrubystretchfactor (box) set_macro("luatexkostretchfactor", stringformat("%.4f", str/em/2)) end end -luatexko.getrubystretchfactor = getrubystretchfactor local function process_ruby_pre_linebreak (head) local curr = head @@ -1458,13 +1479,11 @@ local function process_ruby_post_linebreak (head) head = insert_before(head, curr, ruby) end ruby_t = nil - unset_attribute(curr, rubyattr) - else - local list = curr.list - if list then - curr.list = process_ruby_post_linebreak(list) - end + elseif curr.list then + curr.list = process_ruby_post_linebreak(curr.list) end + elseif curr.list then + curr.list = process_ruby_post_linebreak(curr.list) end curr = getnext(curr) end @@ -1797,7 +1816,7 @@ local function process_vertical_font (fontdata) end end -local function get_horizbox_moveleft () +function luatexko.gethorizboxmoveleft () for _, v in ipairs{ fontcurrent(), texattribute.luatexkohangulfontattr, texattribute.luatexkohanjafontattr, @@ -1811,7 +1830,6 @@ local function get_horizbox_moveleft () end end end -luatexko.gethorizboxmoveleft = get_horizbox_moveleft -- charraise @@ -1885,10 +1903,13 @@ local function process_fake_slant_font (fontdata) local fsl = fontdata.slant if fsl and fsl > 0 then fsl = fsl/1000 + local hb = is_harf(fontdata) + local params = fontdata.parameters or {} - params.slant = (params.slant or 0) + fsl*65536 -- slant per point + if not hb then -- hb done by luaotfload + params.slant = (params.slant or 0) + fsl*65536 -- slant per point + end - local hb = is_harf(fontdata) local scale = hb and hb.scale or params.factor or 655.36 local shared = fontdata.shared or {} @@ -1928,6 +1949,13 @@ create_callback("luatexko_hpack_first", "data", pass_fun) create_callback("luatexko_prelinebreak_first", "data", pass_fun) create_callback("luatexko_hpack_second", "data", pass_fun) create_callback("luatexko_prelinebreak_second", "data", pass_fun) +create_callback("luatexko_do_atbegshi", "data", pass_fun) + +function luatexko.process_atbegshi (box) + if box and box.list then + box.list = call_callback("luatexko_do_atbegshi", box.list) + end +end add_to_callback("hpack_filter", function(h) h = process_fonts(h) @@ -2058,17 +2086,14 @@ add_to_callback("luaotfload.patch_font_unsafe", process_patch_font, local auxiliary_procs = { dotemph = { - hpack_filter = process_dotemph, - post_linebreak_filter = process_dotemph, + luatexko_do_atbegshi = process_dotemph, }, uline = { - hpack_filter = process_uline, - post_linebreak_filter = process_uline, + luatexko_do_atbegshi = process_uline, }, ruby = { - pre_linebreak_filter = process_ruby_pre_linebreak, - hpack_filter = process_ruby_post_linebreak, - post_linebreak_filter = process_ruby_post_linebreak, + pre_linebreak_filter = process_ruby_pre_linebreak, + luatexko_do_atbegshi = process_ruby_post_linebreak, }, autojosa = { luatexko_hpack_first = process_josa, @@ -2080,26 +2105,12 @@ local auxiliary_procs = { }, } -local function activate (name) +function luatexko.activate (name) for cbnam, cbfun in pairs( auxiliary_procs[name] ) do - local fun - if cbnam == "hpack_filter" then - fun = function(h, gc) - if gc == "hbox" or gc == "adjusted_hbox" or gc == "align_set" then - h = cbfun(h) - end - return h - end - else - fun = function(h) - h = cbfun(h) - return h - end - end - add_to_callback(cbnam, fun, "luatexko."..cbnam.."."..name) + add_to_callback(cbnam, cbfun, "luatexko."..cbnam.."."..name) end + active_processes[name] = true end -luatexko.activate = activate add_to_callback ("hyphenate", function(head) @@ -2129,12 +2140,12 @@ end, -- aux functions -local function deactivate_all (str) +function luatexko.deactivateall (str) luatexko.deactivated = {} for _, name in ipairs{ "hpack_filter", "pre_linebreak_filter", - "post_linebreak_filter", "hyphenate", + "luatexko_do_atbegshi", -- might not work properly "luaotfload.patch_font_unsafe", -- added for harf "luaotfload.patch_font" } do local t = {} @@ -2147,9 +2158,8 @@ local function deactivate_all (str) luatexko.deactivated[name] = t end end -luatexko.deactivateall = deactivate_all -local function reactivate_all () +function luatexko.reactivateall () for name, v in pairs(luatexko.deactivated or {}) do for _, vv in ipairs(v) do add_to_callback(name, tableunpack(vv)) @@ -2157,10 +2167,8 @@ local function reactivate_all () end luatexko.deactivated = nil end -luatexko.reactivateall = reactivate_all -local function current_has_hangul_chars (cnt) +function luatexko.currenthashangulchars (cnt) texcount[cnt] = char_in_font(fontcurrent(), 0xAC00) and 1 or 0 end -luatexko.currenthashangulchars = current_has_hangul_chars diff --git a/macros/luatex/generic/luatexko/luatexko.sty b/macros/luatex/generic/luatexko/luatexko.sty index dd25d17b77..f96b228a2c 100644 --- a/macros/luatex/generic/luatexko/luatexko.sty +++ b/macros/luatex/generic/luatexko/luatexko.sty @@ -14,12 +14,14 @@ \ifdefined\luatexkohangulfontattr \endinput\fi \ifdefined\selectfont \NeedsTeXFormat{LaTeX2e}[2020/02/02] - \ProvidesPackage{luatexko}[2020/03/14 v2.7 typesetting Korean with LuaTeX] + \ProvidesPackage{luatexko}[2020/03/20 v2.8 typesetting Korean with LuaTeX] \RequirePackage{luatexbase} \RequirePackage{fontspec}[2020/02/03] + \RequirePackage{atbegshi} \else \input luatexbase.sty \input luaotfload.sty + \input atbegshi.sty \chardef\luatexkoatcatcode=\catcode`\@ \catcode`\@=11 \fi @@ -31,10 +33,21 @@ \newattribute\luatexkoautojosaattr \newattribute\luatexkoclassicattr \newattribute\luatexkodotemphattr +\newattribute\luatexkoulineattr \newattribute\luatexkorubyattr \chardef\luatexkorubyalloc\allocationnumber \newattribute\luatexkohangulbyhangulattr \newattribute\luatexkohanjabyhanjaattr \directlua{ require"luatexko" } +\edef\AtBegShi@Hook{% occupy the first position + \unexpanded{% + \AtBegShi@Item{% + \directlua{% + luatexko.process_atbegshi(tex.getbox(\the\AtBeginShipoutBox)) + }% + }% + }% + \unexpanded\expandafter{\AtBegShi@Hook}% +} % classic \protected\def\typesetclassic{\luatexkoclassicattr\z@\parindent1em } \protected\def\typesetvertical{\luatexkoclassicattr\@ne\parindent1em } @@ -133,8 +146,11 @@ \setbox\z@\hbox{\raise\dotemphraise\hbox{\dotemphchar}}% \directlua{ if \the\luatexkodotemphcount == 1 then luatexko.activate("dotemph") end - luatexko.dotemphbox[\the\luatexkodotemphcount] = node.copy(tex.box[0].list) + luatexko.dotemphbox[\the\luatexkodotemphcount] = node.copy(tex.box[0]) }\luatexkodotemphattr\luatexkodotemphcount #1% + \directlua{ + luatexko.dotemphboundary(\the\luatexkodotemphattr) + }% \endgroup } % uline \newcount\luatexkoulinecount @@ -149,18 +165,17 @@ \def\luatexkomarkoverwith#1#2{% \global\advance\luatexkoulinecount\@ne \begingroup - \count@\luatexkoulinecount - \ifx\luatexkoulinerunning\relax - \edef\ulinedown{\the\dimexpr\ulinedown+\ulinewidth+.15ex\relax}\fi - \let\luatexkoulinerunning\relax \leavevmode \setbox\z@\hbox{#1}% \directlua{ if \the\luatexkoulinecount == 1 then luatexko.activate("uline") end - luatexko.ulboundary(\the\count@, tex.box[0].list, \luatexkoleaderstype) - }#2\relax + luatexko.ulboundary(\the\luatexkoulinecount, + tex.box[0].list, + \luatexkoleaderstype) + }% + \luatexkoulineattr\luatexkoulinecount #2\relax \directlua{ - luatexko.ulboundary(\the\count@) + luatexko.ulboundary(\the\luatexkoulineattr) }\endgroup } \protected\def\uline{\markoverwith{% \vrule width\z@ height-\ulinedown depth\dimexpr\ulinedown+\ulinewidth\relax }} @@ -170,13 +185,29 @@ \kern.125em }}} \protected\def\dotuline{\markoverwith*{% \lower\dimexpr\ulinedown+.2ex\relax\hbox{\kern.07em .\kern.07em }}} -\protected\def\uuline#1{\uline{\uline{#1}}} -\protected\def\sout#1{\begingroup +\protected\def\uuline{\markoverwith{% + \lower\ulinedown\vtop{% + \hrule width .2em height\z@ depth\ulinewidth + \kern .15ex + \hrule width .2em height\z@ depth\ulinewidth + }% +}} +\protected\def\sout#1{% + \begingroup \setbox\z@\hbox{#1}% - \edef\ulinedown{\the\dimexpr + \edef\soutdown{% + \the\dimexpr \directlua{ tex.sprint(luatexko.get_strike_out_down(tex.box[0])) }sp - -.5\dimexpr\ulinewidth\relax \relax }% - \uline{#1}\endgroup} + -.5\dimexpr\ulinewidth\relax \relax + }% + \markoverwith{% + \vrule width \z@ + height-\soutdown + depth \dimexpr\soutdown+\ulinewidth\relax + }% + {#1}% + \endgroup +} \protected\def\xout{\markoverwith{\hbox to.4em{\hss/\hss}}} \protected\def\uwave{\font\luatexkofontsixly=lasy6\relax \markoverwith{\lower4\p@\hbox{\luatexkofontsixly\char58}}} diff --git a/macros/luatex/optex/README b/macros/luatex/optex/README index 50bc986aa0..5217287f83 100644 --- a/macros/luatex/optex/README +++ b/macros/luatex/optex/README @@ -8,6 +8,9 @@ See http://petr.olsak.net/optex History: +<0.07> demos: op-letter.tex and op-slides.tex added. + \inkinspic, \transformbox, \slides added. + documentation improved and updated. <0.06> tables re-implemented, opmac-rest removed. footnotes, marginal notes reimplemented. sections.opm, graphics.opm, colors.opm, languages re-implemented diff --git a/macros/luatex/optex/alloc.opm b/macros/luatex/optex/alloc.opm index 6ca5939ab1..81d9e6606d 100644 --- a/macros/luatex/optex/alloc.opm +++ b/macros/luatex/optex/alloc.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \newdimen {Allocators for registers <2020-01-23>} +\_codedecl \newdimen {Allocators for registers <2020-01-23>} % loaded in format \_chardef\_maicount = 65535 % Max Allocation Index for counts registers in LuaTeX \_let\_maidimen = \_maicount diff --git a/macros/luatex/optex/basics-macros.opm b/macros/luatex/optex/basics-macros.opm index 23b6a6a43c..b86fd2e2e9 100644 --- a/macros/luatex/optex/basics-macros.opm +++ b/macros/luatex/optex/basics-macros.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \sdef {Basic macros for OpTeX <2020-02-14>} +\_codedecl \sdef {Basic macros for OpTeX <2020-02-14>} % loaded in format \_doc ------------------------------ `\bgroup`, `\egroup`, `\empty`, `\space`, `\null` and `\wlog` are classical diff --git a/macros/luatex/optex/bib-iso690.opm b/macros/luatex/optex/bib-iso690.opm index 8f341330c6..3265eaea05 100644 --- a/macros/luatex/optex/bib-iso690.opm +++ b/macros/luatex/optex/bib-iso690.opm @@ -1,6 +1,6 @@ % This is part of OpTeX project, see http://petr.olsak.net/optex -% bibliography style (iso690), version <2020-03-10> +% bibliography style (iso690), version <2020-03-10>, loaded on demand by \usebib \_ifx\_optexbibstyle\_undefined \_errmessage {This file can be read by: \_string\usebib/? (iso690) bibfiles command only} diff --git a/macros/luatex/optex/bib-simple.opm b/macros/luatex/optex/bib-simple.opm index 46824cb81d..347d90bb14 100644 --- a/macros/luatex/optex/bib-simple.opm +++ b/macros/luatex/optex/bib-simple.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -% bibliography style (simple), version <2020-03-10> +% bibliography style (simple), version <2020-03-10>, loaded on demand by \usebib \_ifx\_optexbibstyle\_undefined \_errmessage {This file can be read by: \_string\usebib/? (simple) bibfiles command only} diff --git a/macros/luatex/optex/cite-bib.opm b/macros/luatex/optex/cite-bib.opm index 505b18bb35..7f5b184d93 100644 --- a/macros/luatex/optex/cite-bib.opm +++ b/macros/luatex/optex/cite-bib.opm @@ -187,6 +187,7 @@ \_def\_bibB[#1]{\_par \_bibskip \_advance\_bibnum by1 \_noindent \_def\_tmpb{#1}\_wbib{#1}{\_the\_bibnum}{\_the\_bibmark}% + \_printlabel{#1}% \_printbib \_ignorespaces } \_def\_wbib#1#2#3{\_dest[cite:\_the\_bibnum]% diff --git a/macros/luatex/optex/colors.opm b/macros/luatex/optex/colors.opm index 52dd349f5e..c4ce83ecd9 100644 --- a/macros/luatex/optex/colors.opm +++ b/macros/luatex/optex/colors.opm @@ -1,6 +1,6 @@ %% This is part of OpTeX project, see http://petr.olsak.net/optex -\_codedecl \colordef {Colors <2020-03-07>} +\_codedecl \colordef {Colors <2020-03-18>} % loaded in format \_doc ----------------------------- We declare internal boolean value `\_iflocalcolor` ad do @@ -107,7 +107,7 @@ \_cod ----------------------------- \_def\_rgbtocmyk #1 #2 #3 ;{% - \_ea \_stripzeros \_directlua{ + \_ea \_stripzeros \_detokenize \_ea{\_directlua{ local kr = math.max(#1,#2,#3) if (kr==0) then tex.print('0. 0. 0. 1 ;') @@ -115,23 +115,23 @@ tex.print(string.format('\_pcent.3f \_pcent.3f \_pcent.3f \_pcent.3f ;', (kr-#1)/kr, (kr-#2)/kr, (kr-#3)/kr, 1-kr)) end -}} +}}} \_def\_cmyktorgb #1 #2 #3 #4 ;{% - \_ea \_stripzeros \_directlua{ + \_ea \_stripzeros \_detokenize \_ea{\_directlua{ local kr = 1-#4 tex.print(string.format('\_pcent.3f \_pcent.3f \_pcent.3f ;', (1-#1)*kr, (1-#2)*kr, (1-#3)*kr)) -}} +}}} \_def\_colorcrop{\_directlua{ local m=math.max(color_C, color_M, color_Y, color_K) if (m>1) then color_C=color_C/m color_M=color_M/m color_Y=color_Y/m color_K=color_K/m end }} -\_def\_colordefFin{\_colorcrop \_ea \_stripzeros \_directlua{ +\_def\_colordefFin{\_colorcrop \_ea \_stripzeros \_detokenize \_ea{\_directlua{ tex.print(string.format('\_pcent.3f \_pcent.3f \_pcent.3f \_pcent.3f ;', color_C, color_M, color_Y, color_K)) -}} +}}} \_def\_douseK{\_colorcrop \_directlua{ kr=math.min(color_C, color_M, color_Y) if (kr>=1) then diff --git a/macros/luatex/optex/doc/op-ring.png b/macros/luatex/optex/doc/op-ring.png deleted file mode 100644 index 8c8cb5976a..0000000000 Binary files a/macros/luatex/optex/doc/op-ring.png and /dev/null differ diff --git a/macros/luatex/optex/doc/optex-doc.pdf b/macros/luatex/optex/doc/optex-doc.pdf index 66f676f54e..8ce027841f 100644 Binary files a/macros/luatex/optex/doc/optex-doc.pdf and b/macros/luatex/optex/doc/optex-doc.pdf differ diff --git a/macros/luatex/optex/doc/optex-doc.tex b/macros/luatex/optex/doc/optex-doc.tex index 155499cba4..7035a0866f 100644 --- a/macros/luatex/optex/doc/optex-doc.tex +++ b/macros/luatex/optex/doc/optex-doc.tex @@ -8,7 +8,7 @@ \def<#1>{\hbox{$\langle$\it#1\/$\rangle$}} \everyintt={\catcode`\<=13} \everytt=\everyintt -\chardef\"="201C +\enquotes \def\new{\mnote{\Red$\blacktriangleleft$}} \fixmnotes\right @@ -22,16 +22,16 @@ \tit \OpTeX/\nl Format Based on Plain \TeX/ and OPmac\fnotemark1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\hfill Version 0.06 +\hfill Version 0.07 \centerline{\it Petr Olšák, 2020} \bigskip \centerline{\url{http://petr.olsak.net/optex}} -\fnotetext {The OPmac package is a set of simple additional macros to plain\TeX{}. It +\fnotetext {The OPmac package is a set of simple additional macros to Plain \TeX{}. It enables users to take advantage of basic \LaTeX/ functionality but keeps -plain \TeX/ simplicity. See +Plain \TeX/ simplicity. See \url{http://petr.olsak.net/opmac-e.html} for more information about it. For OPmac users: the red triangle {\Red$\blacktriangleleft$} in the right margin means that there is a difference from standard OPmac features.} @@ -42,11 +42,11 @@ means that there is a difference from standard OPmac features.} \nonum \sec Introduction %%%%%%%%%%%% -\OpTeX/ is \LuaTeX/ format with plain \TeX/ and OPmac. Only \LuaTeX/ engine +\OpTeX/ is \LuaTeX/ format with Plain \TeX/ and OPmac. Only \LuaTeX/ engine is supported. The main goal of \OpTeX/ is: \begitems -* \OpTeX/ keeps the simplicity (like in plain \TeX/ and OPmac macros). +* \OpTeX/ keeps the simplicity (like in Plain \TeX/ and OPmac macros). * There is no old obscurities concerning with various 8-bit encodings and various engines. * \OpTeX/ provides a powerful font selection system (for Unicode font @@ -54,12 +54,12 @@ is supported. The main goal of \OpTeX/ is: * \OpTeX/ supports hyphenations of all languages installed in your \TeX/ system. * All features from OPmac macros are copied. * Macros are documented in the same place where code is (macros for printing - this documentation will come in the future). + such documentation will come in the future). * User name space of control sequences is separated from internal name space - of OpTeX and primitives (`\foo` versus `\_foo`). + of \OpTeX/ and primitives (`\foo` versus `\_foo`). \enditems -\OpTeX/ should be a modern plain \TeX/ with power from OPmac (fonts selection +\OpTeX/ should be a modern Plain \TeX/ with power from OPmac (fonts selection system, colors, external graphics, references, hyperlinks, indexing, bibliography, ...) with preferred Unicode fonts. @@ -67,21 +67,25 @@ If you need to customize your document or you need to use something very specific, then you can copy relevant parts of \OpTeX/ macros into your macro file and do changes of these macros here. This is significant difference from \LaTeX/ or ConTeXt, which are an attempt to create a new user level with a -plenty of non-primitive parameters and syntax hidding \TeX/ internals. -The macros from \OpTeX/ are simple and straightforward because they solves only -what is excplicitly needed, they does not create a new user level over \TeX/. -And you can use them, understand them an modify them. +plenty of non-primitive parameters and syntax hiding \TeX/ internals. +The macros from \OpTeX/ are simple and straightforward because they solve only +what is explicitly needed, they does not create a new user level for +controlling your document over \TeX/. +And you can use \OpTeX/ macros, understand them an modify them. \OpTeX/ offers a markup language for authors of texts (like \LaTeX), -i.e. the fixed set of tags to define the structure of the document. This +i.\,e.\ the fixed set of tags to define the structure of the document. This markup is different from the \LaTeX{} markup. It may offer to write the source text of the document somewhat clearer and more attractive. \new {\bf Disclaimer:} This software is under construction. It is possible -that some features documented here will be changed in future. There exists a -large part of original OPmac macros included in \OpTeX/ which waits to its -re-implementation at current state of development. +that some features documented here will be changed in future. + +This manual desribes \OpTeX/ features only. We suppose that user knows \TeX/ +basic principles. They are described in many books. You can see a short +document \ulink[http://petr.olsak.net/ftp/olsak/optex/tex-nutshell.pdf] +{\TeX/ in nutshell} too. \sec Starting with \OpTeX/ @@ -111,7 +115,7 @@ The first line `\fontfam[LMfonts]` tells that Unicode Latin Modern fonts (derived from Computer Modern) are used. If you omit this line then preloaded Latin Modern fonts are used but preloaded fonts cannot be in Unicode\fnote -{This is technical limitations of \LuaTeX/ for fonts downloaded in formats: +{This is a technical limitation of \LuaTeX/ for fonts downloaded in formats: only 8bit fonts can be preloaded.}. So the sentence `Hello World` will be OK without the first line, but you cannot print such sentence in another languages (for example `Ahoj světe!`) @@ -121,11 +125,11 @@ fonts. A somewhat larger example with common settings should be: -\begtt -\fontfam[Termes] % selecting Unicode font family Termes -\typosize[11/13] % setting the basic font size and the baselineskip -\margins/1 a4 (1,1,1,1)in % setting 1in margins for A4 paper -\cslang % Czech hyphenation patterns +\begtt \catcode`!=0 +\fontfam[Termes] % selecting Unicode font family Termes (section !ref[fontfam]) +\typosize[11/13] % setting the basic font size and the baselineskip (sec. !ref[sizes]) +\margins/1 a4 (1,1,1,1)in % setting 1in margins for A4 paper (section !ref[marg]) +\cslang % Czech hyphenation patterns (section !ref[lang]) Tady je text. \bye @@ -137,15 +141,15 @@ You can look at `op-demo.tex` file for more examples. \sec Page layout %%%%%%%%%%%%%%%% -\secc Setting the margins -%%%%%%%%%%%%%%%%%%%%%%%% +\secc[marg] Setting the margins +%%%%%%%%%%%%%%%%%%%%%%%%%%%% \OpTeX/ declares paper formats a4, a4l (landscape~a4), a5, a5l, b5, letter and user can declare another own format by `\sdef`: \begtt -\sdef{pgs:b5l}{(250,176)mm} -\sdef{pgs:letterl}{(11,8.5)in} +\sdef{_pgs:b5l}{(250,176)mm} +\sdef{_pgs:letterl}{(11,8.5)in} \endtt The `\margins` command declares margins of the document. This command have @@ -182,10 +186,10 @@ parameter is empty (`\vsize` instead `\hsize` is used). Examples: If `=1` then all pages have the same margins. If `=2` then the declared margins are true for odd pages. The margins at the even pages are -mirrored in such case, it means that is replaced by and vice -versa. +automaticaly mirrored in such case, it means that is replaced by + and vice versa. -The `` can be in the form `(,)` where `` is +The `` can be also in the form `(,)` where `` is optional. If it is missing then `` after margins specification is used. For example: @@ -215,32 +219,34 @@ review printing. After review is done, the second line can be commented out. \secc Concept of default page %%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\OpTeX/ uses for page design very similar \"output routine" like plain +\OpTeX/ uses for page design very similar \"output routine" like Plain \TeX/. There is `\headline` followed by \"page body" followed by `\footline`. The `\headline` is empty by default and it can be used for running headers repeated on each page. The `\footline` prints -page number in the center by default. You can set the `\footline` to empty +centered page number by default. You can set the `\footline` to empty using `\nopagenumbers` macro. -The margins declared by `\margins` macro is concerned to the page body, -i.e.\ the `\headline` and `\fooline` are placed to the top and bottom +The margins declared by `\margins` macro (documented in the previous +section~\ref[marg]) is concerned to the page body, +i.e.\ the `\headline` and `\footline` are placed to the top and bottom margins. -The distance between `\headline` and the top of page body is given by -`\hedalinedist` register. The distance between bottom of page body and `\footline` is -given by `\footlinedist`. The default values are: +The distance between the `\headline` and the top of the page body is given by +`\headlinedist` register. The distance between bottom of the page body and +the `\footline` is given by `\footlinedist`. The default values are: \begtt \headline = {} \footline = {\_hss\_rmfixed \_folio \_hss} % \folio expands to page number -\headlinedist = 14pt % from baseline of \hedaline to top of page body +\headlinedist = 14pt % from baseline of \headline to top of page body \footlinedist = 24pt % from last line in pagebody to baseline of footline \endtt The page body should be divided to top insertions (floating tables and -figures), real text and footnotes. Typicaly only real text is here. +figures) followed by a real text and followed by footnotes. +Typically, only real text is here. -The `\pgbackground` tokens list is empty by default but it ca be used for +The `\pgbackground` tokens list is empty by default but it can be used for creating background of each page (colors, picture, watermark for example). The macro `\draft` uses this register and puts big text DRAFT as watermark to each page. You can try it. @@ -251,7 +257,7 @@ More about the page layout is documented in files `parameters.opm` and \secc Footnotes and marginal notes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -The plain \TeX/'s macro `\footnote` can be used as usual. But a new macro +The Plain \TeX/'s macro `\footnote` can be used as usual. But a new macro `\fnote{}` is defined. The footnote mark is added automatically and it is numbered \new @@ -259,44 +265,54 @@ on each chapter from one\fnote {You can declare `\fnotenumglobal` if you want footnotes numbered in whole document from one or `\fnotenumpages` if you want footnotes numbered at each page from one. Default setting is `\fnotenumchapters`}. -The is scaled by `\typoscale[800]`. -User can redefine fotnote mark or scaling, as shown in the file +The is scaled to 80 \%. +User can redefine footnote mark or scaling, as shown in the file `fnotes.opm`. The `\fnote` macro is fully applicable only in \"normal outer" paragraph. It doesn't work inside boxes (tables for example). If you are solving such -case you can use `\fnotemark` inside the box (only the footnote mark is -generated). When the box is finished you can use `\fnotetext{}`. This -macro puts the to the footnote. The after `\fnotemark` -have to be "1" if only one such command is in the box. Second `\fnotemark` -inside the same box have to have the parameter `2` etc. +case you can use `\fnotemark` inside the box: only the +footnote mark is generated here. When the box is finished you can use +`\fnotetext{}`. This macro puts the to the footnote. +The have to be `1` if only one such command is in the box. +Second `\fnotemark` inside the same box have to have the parameter `2` etc. The same number of `\fnotetext`s have to be written after the box as the number of `\fnotemark`s inserted inside the box. +Example: + +\begtt +Text in a paragraph\fnote{First notice}... % a "normal" footnote +\table{...}{...\fnotemark1...\fnotemark2...} % two footnotes in a box +\fnotetext{Second notice} +\fnotetext{Third notice} +... +\table{...}{...\fnotemark1...} % one footnote in a box +\fnotetext{Fourth notice} +\endtt The marginal note can be printed by the `\mnote{}` macro. The is placed to the right margin on the odd pages and it is placed to the left margin on the even pages. This is done after second \TeX{} run because the -relevant information is stored in an external file. If you need to place the -notes only to the fixed margin write `\fixmnotes\right` or -`\fixmnotes\left`. +relevant information is stored in an external file and read from it again. +If you need to place the notes only to the fixed margin write +`\fixmnotes\right` or `\fixmnotes\left`. The is formatted as a little paragraph with the maximal width `\mnotesize` ragged left on the left margins or ragged right on the right -margins. The first line of this little paragraph is at the same height as -the invisible mark created by `\mnote` in the current paragraph. The -exceptions are possible by `\mnoteskip` register. You can implement such -exceptions to each `\mnote` manually in final printing in order to margin -notes do not overlap. The positive value of `\mnoteskip` shifts the note up -and negative value shifts it down. For example -`\mnoteskip=2\baselineskip \mnote{}` shifts this (and only this) note -two lines up. +margins. The first line of this little paragraph has its vertical position +given by the position of `\mnote` in the text. The exceptions are possible +by setting the `\mnoteskip` register. You can implement such exceptions to +each `\mnote` manually in final printing in order to margin notes do not +overlap. The positive value of `\mnoteskip` shifts the note up and negative +value shifts it down. For example `\mnoteskip=2\baselineskip \mnote{}` +shifts this (and only this) note two lines up. \sec Fonts %%%%%%%%%% -\secc Font families -%%%%%%%%%%%%%%%%%%% +\secc[fontfam] Font families +%%%%%%%%%%%%%%%%%%%%%%% You can select the font family by `\fontfam[]`. The argument is case insensitive and spaces are ignored. So, @@ -306,16 +322,18 @@ to `\fontfam[lmfonts]`. Several aliases are prepared, thus If you write `\fontfam[?]` then all font families registered in \OpTeX/ are listed on the terminal and in the log file. - If you write `\fontfam[catalog]` then a catalog of all fonts registered in -\OpTeX/ and available in your \TeX/ system is printed. And the instructions +\OpTeX/ and available in your \TeX/ system is printed. The instructions how to register your own font family is appended in such catalog. If the family is loaded then {\em font modifiers} applicable in such font family are listed on the terminal: (`\caps`, `\cond` for example). And there are four basic {\em variant selectors} (`\rm`, `\bf`, `\it`, `\bi`). +The usage of variant selectors is the same as in Plain \TeX: +`{\it italics text}`, `{\bf bold text}` etc. + The font modifiers (`\caps`, `\cond` for example) can -be used immediately before a basic variant selector and they +be used before a basic variant selector and they can be (independently) combined: `\caps\it` or `\cond\caps\bf`. The modifiers keeps their internal setting until group ends or until another modifier which negates the previous feature is used. So @@ -323,14 +341,14 @@ modifier which negates the previous feature is used. So \new There is one special variant selector `\currvar` which does not change the -selected variant but reloads the font in respect of the (maybe newly -specified) font modifiers(s). +selected variant but reloads the font due to the (maybe newly +specified) font modifier(s). The context between variants `\rm`--`\it` and `\bf`--`\bi` is kept by the `\em` macro (emphasize text). It switches from current `\rm` to `\it`, from current `\it` to `\rm`, from current `\bf` to `\bi` and from current `\bi` to `\bf`. -The needed italics correction `\/` is inserted automatically. Example: +The italics correction `\/` is inserted automatically. Example: \begtt This is {\em important} text. % = This is {\it important\/} text. @@ -342,10 +360,10 @@ This is {\em important} text. % = This is {\it important\/} text. \new More about the \OpTeX/ font selection system is written the file `fonts-select.opm`. You can mix more font families in your document, you can -declare your variant selectors or modifiers etc. +declare your own variant selectors or modifiers etc. -\secc Font sizes -%%%%%%%%%%%%%%% +\secc[sizes] Font sizes +%%%%%%%%%%%%%%%%%%%%% The command `\typosize[/]` sets the font size of text and math fonts and baselineskip. If one of these two parameters is empty, the @@ -356,7 +374,7 @@ for instance `\ptunit=1mm` enlarges all font sizes declared by `\typosize`. Examples: \begtt -\typosize[10/12] % default of plainTeX +\typosize[10/12] % default of Plain TeX \typosize[11/12.5] % font 11pt, baseline 12.5pt \typosize[8/] % font 8pt, baseline unchanged \endtt @@ -379,15 +397,15 @@ i.e. the value stays unchanged. Examples: \begtt \typoscale[800/800] % fonts and baselineskip re-size to 80 % -\typoscale[\magstep2/] % fonts bigger 1,44times +\typoscale[\magstep2/] % fonts bigger 1,44times (\magstep2 expands to 1440) \endtt First usage of `\typosize` or `\typoscale` macro in your document sets so -called {\em main values}, i.~e. main font size and main baselineskip. They are internally +called {\em main values}, i.\,e.\ main font size and main baselineskip. They are internally saved in registers `\mainfosize` and `\mainbaselineskip`. \new -The `\typoscale` comand does scaling in respect to current values by default. +The `\typoscale` command does scaling in respect to current values by default. If you want to do it in respect to main values, type `\scalemain` immediately before `\typoscale` command. @@ -403,9 +421,14 @@ The size of the current font can be changed by the command baselineskip. \new -There is `\setfontsize{}` command which behaves like -font modifiers and sets given font size o fonts loaded by next variant selectors. -For example `\setfontsize{at15pt}\currvar`. +There is \"low level" `\setfontsize{}` command which behaves like +a font modifier and sets given font size used by next variant selectors. +For example `\setfontsize{at15pt}\currvar` sets current variant to 15pt. + +If you are using a font family with \"optical sizes feature" (i.\,e.\ there +are more recommended sizes of the same font which are not scaled +linearly; good example is Computer Modern aka Latin Modern fonts) +then the recommended size is selected by all mentioned commands automatically. More information about resizing of fonts is documented in `fonts-resize.opm` file. @@ -413,18 +436,20 @@ file. \secc Typesetting math %%%%%%%%%%%%%%%%%%%%% -\OpTeX/ preloads a collection of 7bit Computer Modern and AMS fonts. -You can use them in any size and in the `\boldmath` variant. +\OpTeX/ preloads a collection of 7bit Computer Modern math fonts +and AMS fonts in its format. You can use them in any size and in the +`\boldmath` variant. % \new -Most declared font families are configured with recommended Unicode -math font. This font is automaticlally loaded unless you specify +Most declared text font families (see `\fontfam` in the section~\ref[fontfam]) +are configured with recommended Unicode +math font. This font is automaticlaly loaded unless you specify `\noloadmath` before first `\fontfam` command. See log file for more information about loading text font family and Unicode math fonts. If you prefer another Unicode math font, specify it by `\loadmath{[]}` or `\loadmath{font-name}` before first `\loadfam` command. -Hundreds math symbols and operators like in AMS\TeX/ are accesible. +Hundreds math symbols and operators like in AMS\TeX/ are accessible. For example `\alpha` $\alpha$, `\geq`~$\geq$, `\sum` $\sum$, `\sphericalangle` $\sphericalangle$, `\bumpeq`, $\bumpeq$. See AMS\TeX/ manual for complete list of symbols. @@ -443,8 +468,10 @@ The following math alphabets are available: \bi % sans serif bold slanted $/bi abc-xyz,ABC-XYZ$ \endtt -The last two selectors `\bf` and `\bi` select the sans serif fonts regardless -current text font family. +The last two selectors `\bf` and `\bi` select the sans serif fonts in math regardless +the current text font family. This is common notation for vectors and +matrices. You can re-declare it, see the file `unimath-codes.opm` where math +variants of `\bf` and `\bi` selectors are defined. The math fonts can be scaled by `\typosize` and `\typoscale` macros. Two math fonts collections are prepared: `\normalmath` for normal weight @@ -474,16 +501,20 @@ braces are used): \secc Subsection title \endtt -The chapters are numbered by one number, sections by two numbers +If you want to write a title to more lines in your source file then you can +use percent character before . Such is not +scanned and reading of the title continues at next line. + +The chapters are automatically numbered by one number, sections by two numbers (chapter.section) and subsections by three numbers. If there are no chapters then section have only one number and subsection two. The implicit design of the titles of chapter etc.\ are implemented in the -macros `\printchap`, `\printsec` and `\printsecc`. User can simply change +macros `\_printchap`, `\_printsec` and `\_printsecc`. A designer can simply change these macros if he/she needs another behavior. The first paragraph after the title of chapter, section and subsection is -not indented but you can type `\let\firstnoindent=\relax` if you need all +not indented but you can type `\let\_firstnoindent=\relax` if you need all paragraphs indented. If a title is so long then it breaks to more lines. It is better to hint the @@ -501,9 +532,9 @@ Apart from chapters, sections and subsections, there are another automatically numbered objects: equations and captions for tables and figures. -If user write the `\eqmark` as the last element of the display mode then -this equation is numbered. The format is one number in brackets. This number -is reset in each section. +If user writes the `\eqmark` as the last element of the display mode then +this equation is numbered. The equation number is printed in brackets. This number +resets in each section by default. If the `\eqalignno` is used, then user can put `\eqmark` to the last column before `\cr`. For example: @@ -514,11 +545,12 @@ before `\cr`. For example: c &= \sqrt{a^2+b^2} & \eqmark \cr} \endtt -The next numbered object is caption which is tagged by `\caption/t` for +The next automatically numbered objects are captions which is tagged by `\caption/t` for tables and `\caption/f` for figures. The caption text follows. The `\cskip` can be used between `\caption` text and the real object (table -or figure). It is irrelevant, if caption or object is first. +or figure). You can use two orders: `\cskip ` or +`\cskip `. The `\cskip` creates appropriate vertical space between them. Example: \begtt @@ -556,12 +588,19 @@ The caption text is centered. If it occupies more lines then the last line is centered. The macro `\caption/f` behaves like `\caption/t` but it is intended for -figure captions. +figure captions with independent numbering. The word (Table, Figure) depends on the actual selected language (see section~\ref[lang] about languages). If you wish to make the table or figure as floating object, you need to use -plain \TeX/ macros `\midinsert` or `\topinsert` terminated by `\endinsert`. +Plain \TeX/ macros `\midinsert` or `\topinsert` terminated by `\endinsert`. +Example: + +\begtt +\topinsert % table and its caption is printed at the top of the current page + +\endinsert +\endtt \secc References %%%%%%%%%%%%%%% @@ -573,7 +612,7 @@ if optional parameter `[