diff options
author | Norbert Preining <norbert@preining.info> | 2020-05-08 03:02:15 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-05-08 03:02:15 +0000 |
commit | 8b5866024fec68c13a91973cc6cfc2cb5697baba (patch) | |
tree | 6abad841dced763b6ee50ae5bb83fc50d8816ca1 /macros/luatex | |
parent | 56bd1f5b8377f54b4af39a114362a7762d27f13c (diff) |
CTAN sync 202005080302
Diffstat (limited to 'macros/luatex')
52 files changed, 482 insertions, 104 deletions
diff --git a/macros/luatex/generic/luaotfload/NEWS b/macros/luatex/generic/luaotfload/NEWS index 501af67e47..cec3defd4c 100644 --- a/macros/luatex/generic/luaotfload/NEWS +++ b/macros/luatex/generic/luaotfload/NEWS @@ -1,5 +1,9 @@ Change History -------------- +2020-05-01 luaotfload v3.14 + * bug fix for luaotfload-tool, luaotfload-tool --list=basename failed (texlive list) + * fontloader patched to resolve issue #124 + 2020-05-01 luaotfload v3.13 * A problem with text fonts with minimal math table has been fixed (issue 148.) In new luaotfload versions, math parameters will only be loaded for fonts with `script=math`. diff --git a/macros/luatex/generic/luaotfload/README.md b/macros/luatex/generic/luaotfload/README.md index 91d1d45acf..7ceb1797fb 100644 --- a/macros/luatex/generic/luaotfload/README.md +++ b/macros/luatex/generic/luaotfload/README.md @@ -1,8 +1,8 @@ # The Luaotfload Package -VERSION: 3.13 +VERSION: 3.14 -DATE: 2020-05-01 +DATE: 2020-05-06 ## Description diff --git a/macros/luatex/generic/luaotfload/filegraph.pdf b/macros/luatex/generic/luaotfload/filegraph.pdf Binary files differindex 76c5754744..4b8c2922fb 100644 --- a/macros/luatex/generic/luaotfload/filegraph.pdf +++ b/macros/luatex/generic/luaotfload/filegraph.pdf diff --git a/macros/luatex/generic/luaotfload/fontloader-2020-04-30.lua b/macros/luatex/generic/luaotfload/fontloader-2020-05-06.lua index 721d246121..418ca726ba 100644 --- a/macros/luatex/generic/luaotfload/fontloader-2020-04-30.lua +++ b/macros/luatex/generic/luaotfload/fontloader-2020-05-06.lua @@ -27853,10 +27853,11 @@ local function initializeoverlay(tfmdata,kind,value) local s=#colorlist local goback=w~=0 and leftcommand[w] or nil local t={ + start, not u and actualb or { "pdf","page",(getactualtext(tounicode(u))) }, push, } - local n=2 + local n=3 local l=nil for i=1,s do local entry=colorlist[i] diff --git a/macros/luatex/generic/luaotfload/fontloader-basics-gen.lua b/macros/luatex/generic/luaotfload/fontloader-basics-gen.lua index 3959ca0222..f52fec6967 100644 --- a/macros/luatex/generic/luaotfload/fontloader-basics-gen.lua +++ b/macros/luatex/generic/luaotfload/fontloader-basics-gen.lua @@ -189,7 +189,7 @@ local readables = { } local usingjit = jit if not caches.namespace or caches.namespace == "" or caches.namespace == "context" then - caches.namespace = 'generic' + caches.namespace = 'generic-dev' end do diff --git a/macros/luatex/generic/luaotfload/fontloader-font-ocl.lua b/macros/luatex/generic/luaotfload/fontloader-font-ocl.lua index 1890e5ec54..094e8b88ee 100644 --- a/macros/luatex/generic/luaotfload/fontloader-font-ocl.lua +++ b/macros/luatex/generic/luaotfload/fontloader-font-ocl.lua @@ -5,7 +5,7 @@ if not modules then modules = { } end modules ['font-ocl'] = { copyright = "PRAGMA ADE / ConTeXt Development Team", license = "see context related readme files" } - +-- patched version 2020-05-06 UF (colr/restorefix -- -- todo : user list of colors if CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 then @@ -278,10 +278,11 @@ local function initializeoverlay(tfmdata,kind,value) local s = #colorlist local goback = w ~= 0 and leftcommand[w] or nil -- needs checking: are widths the same local t = { + start, not u and actualb or { "pdf", "page", (getactualtext(tounicode(u))) }, push, } - local n = 2 + local n = 3 local l = nil for i=1,s do local entry = colorlist[i] diff --git a/macros/luatex/generic/luaotfload/fontloader-reference.lua b/macros/luatex/generic/luaotfload/fontloader-reference.lua index 32f25b931e..9f381d358a 100644 --- a/macros/luatex/generic/luaotfload/fontloader-reference.lua +++ b/macros/luatex/generic/luaotfload/fontloader-reference.lua @@ -1,6 +1,7 @@ -- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua -- merge date : 2020-04-30 11:10 +-- patched on 2020-05-06 (colr-restore fix do -- begin closure to overcome local limits and interference @@ -32531,10 +32532,11 @@ local function initializeoverlay(tfmdata,kind,value) local s=#colorlist local goback=w~=0 and leftcommand[w] or nil local t={ + start, not u and actualb or { "pdf","page",(getactualtext(tounicode(u))) }, push, } - local n=2 + local n=3 local l=nil for i=1,s do local entry=colorlist[i] diff --git a/macros/luatex/generic/luaotfload/luaotfload-auxiliary.lua b/macros/luatex/generic/luaotfload/luaotfload-auxiliary.lua index 02f52f59bd..62ef5d57a9 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-auxiliary.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-auxiliary.lua @@ -6,8 +6,8 @@ local ProvidesLuaModule = { name = "luaotfload-auxiliary", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / auxiliary functions", license = "GPL v2.0" } diff --git a/macros/luatex/generic/luaotfload/luaotfload-colors.lua b/macros/luatex/generic/luaotfload/luaotfload-colors.lua index 52d38a7eec..070fe868c7 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-colors.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-colors.lua @@ -5,8 +5,8 @@ local ProvidesLuaModule = { name = "luaotfload-colors", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / color", license = "GPL v2.0", author = "Khaled Hosny, Elie Roux, Philipp Gesang, Dohyun Kim, David Carlisle", diff --git a/macros/luatex/generic/luaotfload/luaotfload-conf.pdf b/macros/luatex/generic/luaotfload/luaotfload-conf.pdf Binary files differindex 1e112f413f..c1efb7d479 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-conf.pdf +++ b/macros/luatex/generic/luaotfload/luaotfload-conf.pdf diff --git a/macros/luatex/generic/luaotfload/luaotfload-configuration.lua b/macros/luatex/generic/luaotfload/luaotfload-configuration.lua index 736b9c64d3..36bb31dda1 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-configuration.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-configuration.lua @@ -7,8 +7,8 @@ local ProvidesLuaModule = { name = "luaotfload-configuration", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / config file reader", license = "GPL v2.0" } diff --git a/macros/luatex/generic/luaotfload/luaotfload-database.lua b/macros/luatex/generic/luaotfload/luaotfload-database.lua index 11f3d91142..af123a0296 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-database.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-database.lua @@ -5,8 +5,8 @@ do -- block to avoid to many local variables error local ProvidesLuaModule = { name = "luaotfload-database", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / database", license = "GPL v2.0", author = "Khaled Hosny, Elie Roux, Philipp Gesang, Marcel Krüger", diff --git a/macros/luatex/generic/luaotfload/luaotfload-diagnostics.lua b/macros/luatex/generic/luaotfload/luaotfload-diagnostics.lua index 956e24e747..c90aa0f5be 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-diagnostics.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-diagnostics.lua @@ -7,8 +7,8 @@ local ProvidesLuaModule = { name = "luaotfload-diagnostics", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload-tool submodule / diagnostics", license = "GPL v2.0" } diff --git a/macros/luatex/generic/luaotfload/luaotfload-embolden.lua b/macros/luatex/generic/luaotfload/luaotfload-embolden.lua index 9d36071c03..479c485d62 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-embolden.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-embolden.lua @@ -5,8 +5,8 @@ local ProvidesLuaModule = { name = "luaotfload-embolden", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / color", license = "GPL v2.0", author = "Marcel Krüger" diff --git a/macros/luatex/generic/luaotfload/luaotfload-fallback.lua b/macros/luatex/generic/luaotfload/luaotfload-fallback.lua index 9b790ae854..6218d9caeb 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-fallback.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-fallback.lua @@ -5,8 +5,8 @@ local ProvidesLuaModule = { name = "luaotfload-fallback", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / fallback", license = "GPL v2.0", author = "Marcel Krüger" diff --git a/macros/luatex/generic/luaotfload/luaotfload-features.lua b/macros/luatex/generic/luaotfload/luaotfload-features.lua index a54ef20e9d..59fe42da32 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-features.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-features.lua @@ -5,8 +5,8 @@ local ProvidesLuaModule = { name = "luaotfload-features", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / features", license = "GPL v2.0", author = "Hans Hagen, Khaled Hosny, Elie Roux, Philipp Gesang, Marcel Krüger", diff --git a/macros/luatex/generic/luaotfload/luaotfload-filelist.lua b/macros/luatex/generic/luaotfload/luaotfload-filelist.lua index 35b74f6fa3..1e3a4fff38 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-filelist.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-filelist.lua @@ -6,8 +6,8 @@ local ProvidesLuaModule = { name = "luaotfload-filelist", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / filelist", license = "GPL v2.0" } diff --git a/macros/luatex/generic/luaotfload/luaotfload-glyphlist.lua b/macros/luatex/generic/luaotfload/luaotfload-glyphlist.lua index ca74e47257..6c19570ab7 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-glyphlist.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-glyphlist.lua @@ -1,7 +1,7 @@ local ProvidesLuaModule = { name = "luaotfload-glyphlist", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / autogenerated glyphlist", copyright = "derived from https://raw.githubusercontent.com/adobe-type-tools/agl-aglfn/master/glyphlist.txt", original = "Adobe Glyph List, version 2.0, September 20, 2002", diff --git a/macros/luatex/generic/luaotfload/luaotfload-harf-define.lua b/macros/luatex/generic/luaotfload/luaotfload-harf-define.lua index 80895d0f4f..31a92e4aa0 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-harf-define.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-harf-define.lua @@ -5,8 +5,8 @@ do -- block to avoid to many local variables error local ProvidesLuaModule = { name = "luaotfload-harf-define", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / database", license = "GPL v2.0", author = "Khaled Hosny, Marcel Krüger", diff --git a/macros/luatex/generic/luaotfload/luaotfload-harf-plug.lua b/macros/luatex/generic/luaotfload/luaotfload-harf-plug.lua index 726aaaea7e..8e1883e23f 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-harf-plug.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-harf-plug.lua @@ -5,8 +5,8 @@ do -- block to avoid to many local variables error local ProvidesLuaModule = { name = "luaotfload-harf-plug", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / database", license = "GPL v2.0", author = "Khaled Hosny, Marcel Krüger", diff --git a/macros/luatex/generic/luaotfload/luaotfload-init.lua b/macros/luatex/generic/luaotfload/luaotfload-init.lua index e68741666a..e86945b033 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-init.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-init.lua @@ -7,8 +7,8 @@ local ProvidesLuaModule = { name = "luaotfload-init", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / initialization", license = "GPL v2.0" } diff --git a/macros/luatex/generic/luaotfload/luaotfload-latex.pdf b/macros/luatex/generic/luaotfload/luaotfload-latex.pdf Binary files differindex 673ae5f976..fbdcad78c9 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-latex.pdf +++ b/macros/luatex/generic/luaotfload/luaotfload-latex.pdf diff --git a/macros/luatex/generic/luaotfload/luaotfload-letterspace.lua b/macros/luatex/generic/luaotfload/luaotfload-letterspace.lua index 2825b87ea7..927fa68771 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-letterspace.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-letterspace.lua @@ -5,8 +5,8 @@ local ProvidesLuaModule = { name = "luaotfload-letterspace", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / color", license = "GPL v2.0", copyright = "PRAGMA ADE / ConTeXt Development Team", diff --git a/macros/luatex/generic/luaotfload/luaotfload-loaders.lua b/macros/luatex/generic/luaotfload/luaotfload-loaders.lua index 3146fbd3c3..02dd8359e6 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-loaders.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-loaders.lua @@ -8,8 +8,8 @@ local ProvidesLuaModule = { name = "luaotfload-loaders", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / callback handling", license = "GPL v2.0" } diff --git a/macros/luatex/generic/luaotfload/luaotfload-log.lua b/macros/luatex/generic/luaotfload/luaotfload-log.lua index 2a084772f5..801310981d 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-log.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-log.lua @@ -6,8 +6,8 @@ local ProvidesLuaModule = { name = "luaotfload-log", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / logging", license = "GPL v2.0", author = "Khaled Hosny, Elie Roux, Philipp Gesang", diff --git a/macros/luatex/generic/luaotfload/luaotfload-main.lua b/macros/luatex/generic/luaotfload/luaotfload-main.lua index 1c962c3950..0c8a909c1b 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-main.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-main.lua @@ -20,8 +20,8 @@ local authors = "\z -- version number is used below! local ProvidesLuaModule = { name = "luaotfload-main", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload entry point", author = authors, copyright = authors, diff --git a/macros/luatex/generic/luaotfload/luaotfload-main.tex b/macros/luatex/generic/luaotfload/luaotfload-main.tex index 91983354bc..69502b5b12 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-main.tex +++ b/macros/luatex/generic/luaotfload/luaotfload-main.tex @@ -32,7 +32,7 @@ \beginfrontmatter \setdocumenttitle {The \identifier{luaotfload} package} - \setdocumentdate {2020-05-01 v3.13} + \setdocumentdate {2020-05-06 v3.14} \setdocumentauthor {LaTeX3 Project\\ Elie Roux · Khaled Hosny · Philipp Gesang · Ulrike Fischer · Marcel Krüger\\ Home: \hyperlink {https://github.com/latex3/luaotfload}} @@ -62,6 +62,13 @@ Supported is the \identifier{luatex} versions of a current TeXLive 2019 (and a c \endsection \beginsection{Changes} +\beginsubsection {New in version 3.14 (by Ulrike Fischer/Marcel Krüger)} +\begin{itemize} +\item a bug in luaotfload-tool has been corrected (reported on the texlive list) +\item the fontloader has been patched to resolve a problem with color fonts and save/restore pairs \gitissue{124} +\end{itemize} +\endsubsection + \beginsubsection {New in version 3.13 (by Ulrike Fischer/Marcel Krüger)} \begin{itemize} \item A\marginpar{\mbox{}\hfill \textbf{Change!}} problem with text fonts with minimal math table has been fixed \gitissue{148}: diff --git a/macros/luatex/generic/luaotfload/luaotfload-multiscript.lua b/macros/luatex/generic/luaotfload/luaotfload-multiscript.lua index 5638d281c7..fe6cf17985 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-multiscript.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-multiscript.lua @@ -5,8 +5,8 @@ local ProvidesLuaModule = { name = "luaotfload-multiscript", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / multiscript", license = "GPL v2.0", author = "Marcel Krüger" diff --git a/macros/luatex/generic/luaotfload/luaotfload-notdef.lua b/macros/luatex/generic/luaotfload/luaotfload-notdef.lua index 7108e7d7df..e027d20666 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-notdef.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-notdef.lua @@ -5,8 +5,8 @@ local ProvidesLuaModule = { name = "luaotfload-notdef", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / color", license = "GPL v2.0", author = "Marcel Krüger" diff --git a/macros/luatex/generic/luaotfload/luaotfload-parsers.lua b/macros/luatex/generic/luaotfload/luaotfload-parsers.lua index c331cb4ef0..c69cb86f56 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-parsers.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-parsers.lua @@ -7,8 +7,8 @@ local ProvidesLuaModule = { name = "luaotfload-parsers", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / filelist", license = "GPL v2.0" } diff --git a/macros/luatex/generic/luaotfload/luaotfload-resolvers.lua b/macros/luatex/generic/luaotfload/luaotfload-resolvers.lua index e07c09cde6..14a503bb14 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-resolvers.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-resolvers.lua @@ -11,8 +11,8 @@ local ProvidesLuaModule = { name = "luaotfload-resolvers", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / resolvers", license = "GPL v2.0" } diff --git a/macros/luatex/generic/luaotfload/luaotfload-scripts.lua b/macros/luatex/generic/luaotfload/luaotfload-scripts.lua index 4a9ec0f6dc..fb842c5532 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-scripts.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-scripts.lua @@ -5,8 +5,8 @@ local ProvidesLuaModule = { name = "luaotfload-script", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / Script helpers", license = "CC0 1.0 Universal", author = "Marcel Krüger" diff --git a/macros/luatex/generic/luaotfload/luaotfload-status.lua b/macros/luatex/generic/luaotfload/luaotfload-status.lua index 02cf06f89c..69fa2f6ab5 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-status.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-status.lua @@ -1,6 +1,6 @@ return { ["hashes"]={ - { "fontloader-2020-04-30.lua", "e3b9c1d6344645b552f8002a97aa09ca" }, + { "fontloader-2020-05-06.lua", "cb465e20137d75429cb876688189ff36" }, { "fontloader-util-fil.lua", "4bb3e4dc72e308d8ed67cd7a80027fa7" }, { "fontloader-util-str.lua", "2c1a12d8248d3719c0b5fc93184242bf" }, { "fontloader-l-unicode.lua", "9bc311ce08ce498f9caacb6164ea1d9f" }, @@ -32,7 +32,7 @@ return { { "fontloader-font-one.lua", "987c5c5ed3754ad2feab80985067d59e" }, { "fontloader-font-onr.lua", "22572ec0f86f53631e14b6d1ed43ee51" }, { "fontloader-font-otc.lua", "1204a2fdc436e644127c0aa38ab69607" }, - { "fontloader-font-ocl.lua", "e6b45379971219a6227e8655cda14aff" }, + { "fontloader-font-ocl.lua", "ee310c8d0ac411d5ba6b50d338548013" }, { "fontloader-font-osd.lua", "61f05fcf91add1aa5dac9bc8b235adc9" }, { "fontloader-font-ots.lua", "113b7ad0c40d4786bb026706e479c3f3" }, { "fontloader-font-ota.lua", "dd5f1c8ba28abaf4505fd960d04a3a98" }, @@ -52,44 +52,46 @@ return { { "fontloader-font-con.lua", "40e3a857b2f31be1959dc6d445aaa9c4" }, { "fontloader-font-ini.lua", "4dee96e1e1474d324dd126bd5d375df8" }, { "fontloader-data-con.lua", "de6ae0997b0e70a23bcc9afff5d8b072" }, - { "fontloader-reference.lua", "87a3b4d84d8ca6551dc8ccb539d30fd8" }, - { "fontloader-basics-gen.lua", "b21e91bbd534f77e368f0ec13f865aed" }, + { "fontloader-reference.lua", "2479b532aa53f60c4a83041c4f0e6632" }, + { "fontloader-basics-gen.lua", "b88f9848c3247e4222b7bb63b0ee3f35" }, { "mktests", "c7cff7025962922944376acc1ffa9c47" }, - { "mkstatus", "879eb12b7dc63a18d94ed61b90c4b3da" }, + { "mkstatus", "8f230b751f58ec989604884a58cb5cfa" }, { "mkcharacters", "92c24bb582fc84c0365634f29eb89863" }, { "mkglyphlist", "95bbf91338214d40b2102114285ccd3f" }, { "mkimport", "60e0b11a1a68719033e86a3e0f4d5e86" }, - { "luaotfload-glyphlist.lua", "d717ba808181ed805d7012259ceec613" }, + { "luaotfload-glyphlist.lua", "f14bb296a5a4eb9a6cb130f6a703d160" }, { "luaotfload-characters.lua", "6a46f4749368e4f56a863da9c61b7bd6" }, - { "luaotfload-tounicode.lua", "1423c465dd9674c1d048314566e4c9e5" }, - { "luaotfload-unicode.lua", "2ef5d6f97171db54da3fbb304571bf4d" }, - { "luaotfload-resolvers.lua", "028ada14621d61296d6c193113841a3c" }, - { "luaotfload-parsers.lua", "1bb3f4e75cd433de2b29ea9961896dba" }, - { "luaotfload-fallback.lua", "26ac47f65211bee402055d656ebedf30" }, - { "luaotfload-multiscript.lua", "bc5cd5ca148d8938310317f8f70b51f4" }, - { "luaotfload-loaders.lua", "b6bca1abc2fef454a4e14997b87c500e" }, - { "luaotfload-harf-plug.lua", "e0b02973cd653b50d5ad8c0f971bbf44" }, - { "luaotfload-harf-define.lua", "74026f364fd71375c6ac0fcdabaf2c69" }, - { "luaotfload-notdef.lua", "feccfc85ad4ddb6ccaeb4974f50d93c1" }, - { "luaotfload-embolden.lua", "faa7cdeb00ba548b7f8f4cf79f52ea62" }, - { "luaotfload-letterspace.lua", "d12550ea62b1edb348f0f6d388b2701f" }, - { "luaotfload-features.lua", "4941176787992fa1b319d3e8822672a6" }, - { "luaotfload-database.lua", "6a17fb92cbb4d0e2ccdb435b7f33c052" }, - { "luaotfload-configuration.lua", "5ba63b9b0731e3701c39c06a1217dbe4" }, - { "luaotfload-colors.lua", "5fe6a37d50374deb75f041a4c26e08ce" }, - { "luaotfload-auxiliary.lua", "f721a22653fe32413af7d057b6236382" }, - { "luaotfload-filelist.lua", "b9383bafa3dbf4ef3140592f6ed47e54" }, - { "luaotfload-tool.lua", "2b1a2aabe4f9c3f88836feb833c89e78" }, - { "luaotfload-diagnostics.lua", "b32da598f5bbb68e2b76cce03a7df033" }, - { "luaotfload-log.lua", "30158f122a25bc38eecd61ab86c4bc70" }, - { "luaotfload-init.lua", "ab2d6107e6d94455f1d024afb8f6a8c1" }, - { "luaotfload-main.lua", "6ee30f9b6f5d381df4d5f9c868bc9d9f" }, + { "luaotfload-tounicode.lua", "610d27c11ea928a7a299ada038db3a6d" }, + { "luaotfload-unicode.lua", "737a96fb0cd50197bb2ceb6e28fec021" }, + { "luaotfload-resolvers.lua", "8349bdce20fa37470f985f1aabc7946f" }, + { "luaotfload-parsers.lua", "f61808c1b01a3a40385b3e74f8171c3e" }, + { "luaotfload-fallback.lua", "5d613223f8153767305bd8d3d4387de7" }, + { "luaotfload-szss.lua", "58a838170ea2d61affee0a83cbf602c2" }, + { "luaotfload-scripts.lua", "702a128883d033ab9f3726ba2e21fc8d" }, + { "luaotfload-multiscript.lua", "7089c788fa75d8074e73919532fefa92" }, + { "luaotfload-loaders.lua", "53d26bba499abf18cf823675c77e36de" }, + { "luaotfload-harf-plug.lua", "840abb8a4965dd32532cc73e670f5906" }, + { "luaotfload-harf-define.lua", "ba5861271933078de634b9e00172f69a" }, + { "luaotfload-notdef.lua", "af12a1afe613f42b0d8d1033776eefaf" }, + { "luaotfload-embolden.lua", "9f2cda5502e5a0ceb6402f6dd075732f" }, + { "luaotfload-letterspace.lua", "06639c9e935da07c4694da6579a36781" }, + { "luaotfload-features.lua", "0bd3943f65c0688738407ff1a186900f" }, + { "luaotfload-database.lua", "8e9e26a9acd048ec1217fad9fa80cd0d" }, + { "luaotfload-configuration.lua", "827b91b6f6881a69ea48885093f10c71" }, + { "luaotfload-colors.lua", "23cfde48b9609e33e9b809a3ebd1a670" }, + { "luaotfload-auxiliary.lua", "50a56ccd209e59b66514c483fd8af85d" }, + { "luaotfload-filelist.lua", "e3139b052bc5789b9135c1eb20753d3e" }, + { "luaotfload-tool.lua", "89fc62620ef6f534ea1f6a3f6253886b" }, + { "luaotfload-diagnostics.lua", "a4635cd5da922b6cb3ef27e74a3cf6d8" }, + { "luaotfload-log.lua", "b37a69c07eecaecc17d2d069e088b133" }, + { "luaotfload-init.lua", "8c9b852cdf019fa43c938618773ecd5e" }, + { "luaotfload-main.lua", "5ccffdfbe87102c13d6d1910873935d3" }, }, ["notes"]={ - ["committer"]="Ulrike Fischer <fischer@troubleshooting-tex.de>", - ["description"]="v3.13/2020-05-01", - ["loader"]="fontloader-2020-04-30.lua", - ["revision"]="aa279bff2274832c341338d7763132bad3941768", - ["timestamp"]="2020-05-01 15:37:41 +0200", + ["committer"]="Marcel Fabian Krüger <tex@2krueger.de>", + ["description"]="v3.14/2020-05-06", + ["loader"]="fontloader-2020-05-06.lua", + ["revision"]="79077b0311ec65e8eb3c60bfc306500d72fd270e", + ["timestamp"]="2020-05-06 20:58:39 +0200", }, }
\ No newline at end of file diff --git a/macros/luatex/generic/luaotfload/luaotfload-suppress.lua b/macros/luatex/generic/luaotfload/luaotfload-suppress.lua index eba776fe85..50a0037c43 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-suppress.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-suppress.lua @@ -5,8 +5,8 @@ local ProvidesLuaModule = { name = "luaotfload-suppress", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / suppress", license = "GPL v2.0", author = "Marcel Krüger" diff --git a/macros/luatex/generic/luaotfload/luaotfload-szss.lua b/macros/luatex/generic/luaotfload/luaotfload-szss.lua index 23b479f33e..de3b47230c 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-szss.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-szss.lua @@ -5,8 +5,8 @@ local ProvidesLuaModule = { name = "luaotfload-szss", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / color", license = "GPL v2.0", author = "Marcel Krüger" diff --git a/macros/luatex/generic/luaotfload/luaotfload-tool.1 b/macros/luatex/generic/luaotfload/luaotfload-tool.1 index a2ea173474..98d1a0abc5 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-tool.1 +++ b/macros/luatex/generic/luaotfload/luaotfload-tool.1 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH LUAOTFLOAD-TOOL 1 "2020-05-01" "3.13" "text processing" +.TH LUAOTFLOAD-TOOL 1 "2020-05-06" "3.14" "text processing" .SH NAME luaotfload-tool \- generate and query the Luaotfload font names database . diff --git a/macros/luatex/generic/luaotfload/luaotfload-tool.lua b/macros/luatex/generic/luaotfload/luaotfload-tool.lua index 6994bfc755..eabd8e4434 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-tool.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-tool.lua @@ -9,8 +9,8 @@ local ProvidesLuaModule = { name = "luaotfload-tool", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload-tool / database functionality", license = "GPL v2.0" } @@ -1334,7 +1334,6 @@ function actions.list (job) else criterion = stringexplode(criterion, ":") --> { field, value } local asked_value = criterion[2] - local sane_asked_pattern = sane_pattern(criterion[2]) criterion = criterion[1] asked_fields = set_primary_field(asked_fields, criterion) @@ -1343,6 +1342,7 @@ function actions.list (job) --- firstly, build a list of fonts to operate on local targets = { } if asked_value then --- only those whose value matches + local sane_asked_pattern = sane_pattern(asked_value) logreport (false, 2, "list", "Restricting to value %s", asked_value) for i=1, nmappings do local entry = mappings[i] diff --git a/macros/luatex/generic/luaotfload/luaotfload-tool.pdf b/macros/luatex/generic/luaotfload/luaotfload-tool.pdf Binary files differindex cbd3cd06b4..142a65e486 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-tool.pdf +++ b/macros/luatex/generic/luaotfload/luaotfload-tool.pdf diff --git a/macros/luatex/generic/luaotfload/luaotfload-tool.rst b/macros/luatex/generic/luaotfload/luaotfload-tool.rst index 98168422c3..20ab6b253e 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-tool.rst +++ b/macros/luatex/generic/luaotfload/luaotfload-tool.rst @@ -6,9 +6,9 @@ generate and query the Luaotfload font names database ----------------------------------------------------------------------- -:Date: 2020-05-01 +:Date: 2020-05-06 :Copyright: GPL v2.0 -:Version: 3.13 +:Version: 3.14 :Manual section: 1 :Manual group: text processing diff --git a/macros/luatex/generic/luaotfload/luaotfload-tounicode.lua b/macros/luatex/generic/luaotfload/luaotfload-tounicode.lua index 95e4b55b66..73bab11709 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-tounicode.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-tounicode.lua @@ -5,8 +5,8 @@ local ProvidesLuaModule = { name = "luaotfload-tounicode", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / tounicode", license = "GPL v2.0", author = "Hans Hagen, Khaled Hosny, Elie Roux, Philipp Gesang, Marcel Krüger", diff --git a/macros/luatex/generic/luaotfload/luaotfload-unicode.lua b/macros/luatex/generic/luaotfload/luaotfload-unicode.lua index 79d196fb64..0fd71ec27a 100644 --- a/macros/luatex/generic/luaotfload/luaotfload-unicode.lua +++ b/macros/luatex/generic/luaotfload/luaotfload-unicode.lua @@ -5,8 +5,8 @@ local ProvidesLuaModule = { name = "luaotfload-unicode", - version = "3.13", --TAGVERSION - date = "2020-05-01", --TAGDATE + version = "3.14", --TAGVERSION + date = "2020-05-06", --TAGDATE description = "luaotfload submodule / Unicode helpers", license = "CC0 1.0 Universal", author = "Marcel Krüger" diff --git a/macros/luatex/generic/luaotfload/luaotfload.conf.5 b/macros/luatex/generic/luaotfload/luaotfload.conf.5 index 151cc6aea2..54a845709f 100644 --- a/macros/luatex/generic/luaotfload/luaotfload.conf.5 +++ b/macros/luatex/generic/luaotfload/luaotfload.conf.5 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH LUAOTFLOAD.CONF 5 "2020-05-01" "3.13" "text processing" +.TH LUAOTFLOAD.CONF 5 "2020-05-06" "3.14" "text processing" .SH NAME luaotfload.conf \- Luaotfload configuration file . diff --git a/macros/luatex/generic/luaotfload/luaotfload.conf.rst b/macros/luatex/generic/luaotfload/luaotfload.conf.rst index 779bcb7370..589fcd9825 100644 --- a/macros/luatex/generic/luaotfload/luaotfload.conf.rst +++ b/macros/luatex/generic/luaotfload/luaotfload.conf.rst @@ -6,9 +6,9 @@ Luaotfload configuration file ----------------------------------------------------------------------- -:Date: 2020-05-01 +:Date: 2020-05-06 :Copyright: GPL v2.0 -:Version: 3.13 +:Version: 3.14 :Manual section: 5 :Manual group: text processing diff --git a/macros/luatex/generic/luaotfload/luaotfload.sty b/macros/luatex/generic/luaotfload/luaotfload.sty index 383bbde5fd..590a0b27ab 100644 --- a/macros/luatex/generic/luaotfload/luaotfload.sty +++ b/macros/luatex/generic/luaotfload/luaotfload.sty @@ -40,7 +40,7 @@ \fi \ifdefined\ProvidesPackage \ProvidesPackage{luaotfload}% - [2020/05/01 v3.13 OpenType layout system] + [2020/05/06 v3.14 OpenType layout system] \fi \directlua{ if xpcall(function ()% diff --git a/macros/luatex/generic/luaotfload/scripts-demo.pdf b/macros/luatex/generic/luaotfload/scripts-demo.pdf Binary files differindex 16e1a6163d..319824cb1e 100644 --- a/macros/luatex/generic/luaotfload/scripts-demo.pdf +++ b/macros/luatex/generic/luaotfload/scripts-demo.pdf diff --git a/macros/luatex/generic/luaotfload/shaper-demo-graphite.pdf b/macros/luatex/generic/luaotfload/shaper-demo-graphite.pdf Binary files differindex 285cb48353..602f3ce86f 100644 --- a/macros/luatex/generic/luaotfload/shaper-demo-graphite.pdf +++ b/macros/luatex/generic/luaotfload/shaper-demo-graphite.pdf diff --git a/macros/luatex/generic/luaotfload/shaper-demo.pdf b/macros/luatex/generic/luaotfload/shaper-demo.pdf Binary files differindex 15775d568b..8861d5067a 100644 --- a/macros/luatex/generic/luaotfload/shaper-demo.pdf +++ b/macros/luatex/generic/luaotfload/shaper-demo.pdf diff --git a/macros/luatex/latex/unitconv/Changes b/macros/luatex/latex/unitconv/Changes new file mode 100644 index 0000000000..bf2c7386aa --- /dev/null +++ b/macros/luatex/latex/unitconv/Changes @@ -0,0 +1 @@ +0.01 2020-05-07 - first CTAN version diff --git a/macros/luatex/latex/unitconv/README.md b/macros/luatex/latex/unitconv/README.md new file mode 100644 index 0000000000..8bef4b5b65 --- /dev/null +++ b/macros/luatex/latex/unitconv/README.md @@ -0,0 +1,16 @@ +# README # +Package unitconv can conver t a TeX length or a given +value with unit into another unit, Supported are all +TeX units and also m and km. The output can be in +scientic notation for large values. + +This package needs lualatex! + +% This file is distributed under the terms of the LaTeX Project Public +% License from CTAN archives in directory macros/latex/base/lppl.txt. +% Either version 1.3 or, at your option, any later version. +% +% Copyright 2020 Herbert Voss hvoss@tug.org +% + +%% $Id: README.md 1177 2020-05-07 15:38:43Z herbert $ diff --git a/macros/luatex/latex/unitconv/doc/unitconv-doc.pdf b/macros/luatex/latex/unitconv/doc/unitconv-doc.pdf Binary files differnew file mode 100644 index 0000000000..6932069f0d --- /dev/null +++ b/macros/luatex/latex/unitconv/doc/unitconv-doc.pdf diff --git a/macros/luatex/latex/unitconv/doc/unitconv-doc.tex b/macros/luatex/latex/unitconv/doc/unitconv-doc.tex new file mode 100644 index 0000000000..c0dfa1de4b --- /dev/null +++ b/macros/luatex/latex/unitconv/doc/unitconv-doc.tex @@ -0,0 +1,216 @@ +%% $Id: unitconv-doc.tex 1177 2020-05-07 15:38:43Z herbert $ +\listfiles +\documentclass[english,parskip=half]{scrartcl} +\usepackage{libertinus} +\setmonofont[Scale=MatchLowercase,FakeStretch=0.9]{AnonymousPro} +\usepackage{babel} +\usepackage[autostyle]{csquotes} + +\usepackage{unitconv} +\usepackage{showexpl,xltabular,nicefrac,booktabs} +\lstset{basicstyle=\ttfamily\small} + +\title{Convert a length into one with another unit +with Lua\TeX} +\author{Herbert Voß} +\parindent=0pt + +\begin{document} +\maketitle +\tableofcontents +\section{Using} + +\begin{verbatim} +\usepackage{unitconv} +\end{verbatim} + + +\section{Macros} + +\begin{verbatim} +\convTeXLength*[<unit>][<digits>]{<TeX length>} +\convLength*[<unit>][<digits>]{<value>}[<unit>] +\end{verbatim} + +The star version prints the number in scientific notation. +The default setting for the unit is \verb|cm| +and for the number of digits \verb|-1| (print all digits). +The dynamic units \verb|em|, \verb|ex|, and \verb|mu| depend on the +current fontsize. + +\begin{itemize} +\item This package works only with \verb|lualatex|! +\item With \textsf{AmsMath} you have to load the package before \texttt{unitconv}. +\end{itemize} + + +\section{The units} + +\def\Index#1{#1}% +\begin{tabular}{@{}>{\bfseries\ttfamily}c l @{}}\toprule +\rmfamily\normalfont\emph{Short}& \emph{Long} \\\midrule +\Index{bp} & Big Point (72\,bp/in) \\ +\Index{cc} & Cîcero (1\,cc=12\,dd) \\ +\Index{cm} & Centimeter \\ +\Index{dd} & Didôt ($1157\,\mathrm{dd}=1238\,\mathrm{pt}$) \\ +\Index{em} & Width of »M« in the current font \\ +\Index{ex} & Height of »x« in the current font \\ +\Index{in} & Inch (72.27\,pt) \\ +\Index{km} & Kilometer \\ +\Index{m} & Meter \\ +\Index{mm} & Millimeter \\ +\Index{mu} & Math unit (1\,mu=\nicefrac{1}{18}em) \\ +\Index{pc} & Pica (12\,pt/pc) \\ +\Index{pt} & (\TeX-)Points ($\nicefrac{1}{72.27}$\,Inch) \\ +\Index{px} & Pixel, 1\,px=\nicefrac{1}{72}in (pdf\TeX)\\ +\Index{sp} & Scaled Point (65536\,sp/pt) \\ +\bottomrule +\end{tabular} + + +\section{Examples} +\subsection{Converting a \TeX\ length} + +\begin{LTXexample}[width=0.5\linewidth] +The current example linewidth is +\the\linewidth, which is + +\convTeXLength{\linewidth}\\ +\convTeXLength[bp]{\linewidth}\\ +\convTeXLength[cc]{\linewidth}\\ +\convTeXLength[dd]{\linewidth}\\ +\convTeXLength[em]{\linewidth}\\ +\convTeXLength[ex]{\linewidth}\\ +\convTeXLength[in]{\linewidth}\\ +\convTeXLength[km]{\linewidth}\\ +\convTeXLength[m]{\linewidth}\\ +\convTeXLength[mm]{\linewidth}\\ +\convTeXLength[mu]{\linewidth}\\ +\convTeXLength[pc]{\linewidth}\\ +\convTeXLength[pt]{\linewidth}\\ +\convTeXLength[px]{\linewidth}\\ +\convTeXLength*[sp]{\linewidth} +\end{LTXexample} + +\begin{LTXexample}[width=0.5\linewidth] +The current character width of M +is 1\,em, which is + +\convTeXLength{1em}\\ +\convTeXLength[bp]{1em}\\ +\convTeXLength[cc]{1em}\\ +\convTeXLength[dd]{1em}\\ +\convTeXLength[em]{1em}\\ +\convTeXLength[ex]{1em}\\ +\convTeXLength[in]{1em}\\ +\convTeXLength[km]{1em}\\ +\convTeXLength[m]{1em}\\ +\convTeXLength[mm]{1em}\\ +\convTeXLength[mu]{1em}\\ +\convTeXLength[pc]{1em}\\ +\convTeXLength[pt]{1em}\\ +\convTeXLength[px]{1em}\\ +\convTeXLength*[sp]{1em} +\end{LTXexample} + + +\begin{LTXexample}[width=0.5\linewidth] +The current example linewidth is +\the\linewidth, which is + +\convTeXLength[bp][3]{\linewidth}\\ +\convTeXLength[cc][3]{\linewidth}\\ +\convTeXLength[cm][3]{\linewidth}\\ +\convTeXLength[dd][3]{\linewidth}\\ +\convTeXLength[em][3]{\linewidth}\\ +\convTeXLength[ex][3]{\linewidth}\\ +\convTeXLength[in][3]{\linewidth}\\ +\convTeXLength[km][3]{\linewidth}\\ +\convTeXLength[m][3]{\linewidth}\\ +\convTeXLength[mm][3]{\linewidth}\\ +\convTeXLength[mu][3]{\linewidth}\\ +\convTeXLength[pc][3]{\linewidth}\\ +\convTeXLength[pt][3]{\linewidth}\\ +\convTeXLength[px][3]{\linewidth}\\ +\convTeXLength*[sp][3]{\linewidth} +\end{LTXexample} + +\begin{LTXexample}[width=0.5\linewidth] +The current width of the letter M is +1\,em, which is + +\convTeXLength[bp][3]{1em}\\ +\convTeXLength[cc][3]{1em}\\ +\convTeXLength[cm][3]{1em}\\ +\convTeXLength[dd][3]{1em}\\ +\convTeXLength[em][3]{1em}\\ +\convTeXLength[ex][3]{1em}\\ +\convTeXLength[in][3]{1em}\\ +\convTeXLength[km][3]{1em}\\ +\convTeXLength[m][3]{1em}\\ +\convTeXLength[mm][3]{1em}\\ +\convTeXLength[mu][3]{1em}\\ +\convTeXLength[pc][3]{1em}\\ +\convTeXLength[pt][3]{1em}\\ +\convTeXLength[px][3]{1em}\\ +\convTeXLength*[sp][3]{1em} +\end{LTXexample} + +\begin{LTXexample}[width=0.5\linewidth] +The current example linewidth is +\the\linewidth, which is + +\convTeXLength[bp][-1]{\linewidth}\\ +\convTeXLength[cc][0]{\linewidth}\\ +\convTeXLength[cm][1]{\linewidth}\\ +\convTeXLength[dd][2]{\linewidth}\\ +\convTeXLength[em][3]{\linewidth}\\ +\convTeXLength[ex][4]{\linewidth}\\ +\convTeXLength[in][5]{\linewidth}\\ +\convTeXLength[km][6]{\linewidth}\\ +\convTeXLength[m][7]{\linewidth}\\ +\convTeXLength[mm][8]{\linewidth}\\ +\convTeXLength[mu][9]{\linewidth}\\ +\convTeXLength[pc][10]{\linewidth}\\ +\convTeXLength[pt][11]{\linewidth}\\ +\convTeXLength[px][12]{\linewidth}\\ +\convTeXLength*[sp][13]{\linewidth} +\end{LTXexample} + + + +\begin{LTXexample}[width=0.5\linewidth] +\convTeXLength[em][2]{1}\\ % default is cm +\convTeXLength[em][2]{2}\\ +\convTeXLength[em][2]{3} +\end{LTXexample} + + + +\begin{LTXexample}[width=0.5\linewidth] +The current example linewidth is +\the\linewidth, which is + +\convTeXLength[em][2]{\linewidth}\\ +\convTeXLength[ex][2]{\linewidth}\\ +\convTeXLength[mu][2]{\linewidth} + +\Huge Test\\ +\convTeXLength[em][2]{\linewidth}\\ +\convTeXLength[ex][2]{\linewidth}\\ +\convTeXLength[mu][2]{\linewidth} +\end{LTXexample} + +\subsection{Converting a value with given unit into another one} + +\begin{LTXexample}[width=0.5\linewidth] +\convLength[m]{1.2345}[km]\\ +\convLength[cm]{1.2345}[km]\\ +\convLength*[mm]{1.2345}[km]\\ +\convLength[bp]{1.2345}[km]\\ +\convLength[km][4]{3499402.985833}[bp] +\end{LTXexample} + + + +\end{document} diff --git a/macros/luatex/latex/unitconv/latex/unitconv.sty b/macros/luatex/latex/unitconv/latex/unitconv.sty new file mode 100644 index 0000000000..9a16dcd2c9 --- /dev/null +++ b/macros/luatex/latex/unitconv/latex/unitconv.sty @@ -0,0 +1,128 @@ +%% $Id: unitconv.sty 1177 2020-05-07 15:38:43Z herbert $ +%% +%% This file is distributed under the terms of the LaTeX Project Public +%% License from CTAN archives in directory macros/latex/base/lppl.txt. +%% Either version 1.3 or, at your option, any later version. +%% +% +% Copyright 2020 Herbert Voss hvoss@tug.org +% +\RequirePackage{iftex,xparse,luacode} +\ProvidesPackage{unitconv}[% + 2020/05/07 v. 0.01 (Herbert Voss) Supports unit conversion of a length (only lualatex)] + +\ifluatex +\else + \ExplSyntaxOn + \msg_new:nnn {unitconv} {need-lualatex} + { + The~ unitconv~ package~ requires~ LuaLaTeX.\\\\ + You~ must~ change~ your~ typesetting~ engine~ to,~ + "lualatex" instead~ of~ "latex", ~"pdflatex",~ or~ + "xelatex". + } + \msg_fatal:nn {unitconv} {need-lualatex} + \ExpSyntaxOff + \endinput +\fi + +\newif\ifconv@Scientific + +\providecommand\text{\mbox} + +\begin{luacode} + convList = { ["bp"] = 1.00374, -- 1bp = 1.00374pt + ["cc"] = 12.8401, + ["cm"] = 28.45274, -- 1cm = 28.45274pt + ["dd"] = 1.07, + ["em"] = 10, + ["ex"] = 4.37, + ["in"] = 72.27, + ["km"] = 2.845274e6, + ["m"] = 2845.274, + ["mm"] = 2.84526, + ["mu"] = 0.05554, + ["pc"] = 12.0, + ["pt"] = 1.0, + ["px"] = 1.00374, + ["sp"] = 0.00005 } +\end{luacode} + +\def\convLength{\@ifnextchar*{\global\conv@Scientifictrue\conv@Length}{\global\conv@Scientificfalse\conv@Length*}} +\def\conv@Length*{\@ifnextchar[\convLength@i{\convLength@i[cm]}}% [unit] +\def\convLength@i[#1]{\@ifnextchar[{\convLength@ii[#1]}{\convLength@ii[#1][-1]}} +\def\convLength@ii[#1][#2]#3{\convLen@iii{#3}{#1}{#2}} + +\def\convTeXLength{\@ifnextchar*{\global\conv@Scientifictrue\conv@TeXLength}{\global\conv@Scientificfalse\conv@TeXLength*}} +\def\conv@TeXLength*{\@ifnextchar[\convTeXLength@i{\convTeXLength@i[cm]}}% [unit] +\def\convTeXLength@i[#1]{\@ifnextchar[{\convTeXLength@ii[#1]}{\convTeXLength@ii[#1][-1]}} +\def\convTeXLength@ii[#1][#2]#3{% + \conv@setlength\@tempdima{#3}% + \expandafter\convLen@iii\expandafter{\expandafter\rem@pt\the\@tempdima}{#1}{#2}} + +\def\convLen@iii#1#2#3{% #1 length; #2 unit; #3 decimals + \@ifnextchar[{\convLen@v{#1}{#2}{#3}}{\convLen@iv{#1}{#2}{#3}}} + +\def\convLen@iv#1#2#3{% + \@tempdima=1em \@tempdimb=1ex + \directlua{% + convList["em"]=\strip@pt\@tempdima; + convList["ex"]=\strip@pt\@tempdimb; + convList["mu"]=convList["em"]/18 + }% + \ifconv@Scientific + \luaexec{% + div0 = convList["#2"] + if (#3 < 0) then + tex.print(string.format("\%e",#1/div0)) + else + tex.print(string.format("\%#3e",#1/div0)) + end}% + \else + \luaexec{% + div0 = convList["#2"] + if (#3 < 0) then + tex.print(string.format(#1/div0)) + else + tex.print(string.format("\%.#3f",#1/div0)) + end}% + \fi + \text{\,#2}}% + +\def\convLen@v#1#2#3[#4]{% #1 length; #2 unit; #3 decimals; #4 orig unit + \@tempdima=1em \@tempdimb=1ex + \directlua{convList["em"]=\strip@pt\@tempdima; convList["ex"]=\strip@pt\@tempdimb; convList["mu"]=convList["em"]/18;}% + \ifconv@Scientific + \luaexec{% + divOrig = convList["#4"] + div0 = convList["#2"] + if (#3 < 0) then + tex.print(string.format("\%e",#1*divOrig/div0)) + else + tex.print(string.format("\%#3e",#1*divOrig/div0)) + end}% + \else + \luaexec{% + divOrig = convList["#4"] + div0 = convList["#2"] + if (#3 < 0) then + tex.print(string.format(#1*divOrig/div0)) + else + tex.print(string.format("\%.#3f",#1*divOrig/div0)) + end}% + \fi + \text{\,#2}}% + + +\newdimen\conv@unit \conv@unit 1cm +\def\conv@unit@off{\let\@conv@unit\ignorespaces\ignorespaces} +% +\def\conv@setlength#1#2{% + \let\@conv@unit\conv@unit + \afterassignment\conv@unit@off + #1 #2\@conv@unit% +} + + +\endinput + |