Sigitas Tolusis | 3 Oct 08:43 2014
Picon

luaotfload readable cache and skipping system fonts

Hi,

I have two issues concerning some use case using luaotfload package with LuaLaTeX.
The idea is to use TeX system in network multiuser environment with central control.
So, there are no place for using system fonts from different users or different font cache. 

1. Suppress using/reading/caching system fonts. My idea is to add some configuration item to luaotfload. 
Let say (as example):

-- luaotfload.conf --
[db]
scan-system = false

--- luaotfload-configuration.lua        2014-08-04 03:11:40.000000000 +0300
+++ luaotfload-configuration.lua.new    2014-10-02 12:17:04.000000000 +0300
 <at>  <at>  -137,6 +137,7  <at>  <at> 
   db = {
     formats     = "otf,ttf,ttc,dfont",
     scan_local  = false,
+    scan_system = true,
     skip_read   = false,
     strip       = true,
     update_live = true,
 <at>  <at>  -409,6 +410,7  <at>  <at> 
       end
     },
     scan_local   = { in_t = boolean_t, },
+    scan_system  = { in_t = boolean_t, },
     skip_read    = { in_t = boolean_t, },
     strip        = { in_t = boolean_t, },
(Continue reading)

Vafa Khalighi | 25 Sep 13:04 2014
Picon

ConTeXt unibidi

Hi List

Has anyone ported ConTeXt unibidi features to plain TeX or LaTeX just
like luaotfload package? About a year ago Philipp Ge­sang gave me some
codes that one could use ConTeXt default method for bidi in LaTeX but
with the recent version of luaotfload that code no longer works. I
think it would be good to port method two to plain/LaTeX.

Vafa

Mittelbach, Frank | 24 Sep 23:12 2014

paragraph breaking in lua (node-ltp)

I'm very much interested in playing around with variations of Knuth's 
paragraph breaking algorithm.

I recently learned that Taco (I think) did a full reimplementation in 
lua that would be perfect for me to do a few experiments.

Unfortunately I'm unable to to make this work e.g., produce a short TeX 
file that actually uses the code. Anybody out there who could give a 
helping hand?

meteorically I think such code should work with any flavor of TeX (eg 
plain) but if there are some reasons that right now it is only possible 
to use it with a very specific environment that doesn't matter for what 
I'm trying to do ... all I need is something that I can feed paragraph 
examples to.

thanks
frank

Christophe Devalland | 19 May 14:28 2014
Picon

[luamplib] I can't open file `plain.mp'

Hi,
I tried to compile :

\documentclass[a4paper,10pt]{article}

\usepackage{luamplib}

\begin{document}


A%

\begin{mplibcode}

beginfig(1);

fill fullcircle scaled 20;

endfig;

\end{mplibcode}

B\par


\end{document}


but I get :


Module luamplib info: This is MetaPost, Version 1.803

(luamplib)

(luamplib)

(luamplib)

(luamplib) ! I can't open file `plain.mp'.

(luamplib) <*> input plain.mp

(luamplib) ;

(luamplib) Please type another input file name

(luamplib) ! Emergency stop.

(luamplib) <*> input plain.mp

(luamplib) ;

(luamplib)

(luamplib)

! LuaTeX error ...texlive/2011/texmf-dist/tex/luatex/luamplib/luamplib.lua:327:

Module luamplib error: unknown, no error, terminal or log messages


stack traceback:

[C]: in function 'error'

...xlive/2011/texmf-dist/tex/luatex/luatexbase/modutils.lua:26: in function 'mo

dule_error_int'

...xlive/2011/texmf-dist/tex/luatex/luatexbase/modutils.lua:49: in function 'er

r'

...texlive/2011/texmf-dist/tex/luatex/luamplib/luamplib.lua:327: in function 'r

eporterror'

...texlive/2011/texmf-dist/tex/luatex/luamplib/luamplib.lua:299: in function 'l

oad'

...texlive/2011/texmf-dist/tex/luatex/luamplib/luamplib.lua:661: in function 'm

akeTEXboxes'

[string "\directlua "]:1: in main chunk.

\ltxdomplibcodeindeed ...([===[\reserved <at> a ]===])}

\directlua {luamplib.proce...

l.10 \end{mplibcode}


I didn't find anything on the web.
Can you help me ? Thanks





Stephan Hennig | 15 Apr 00:09 2014
Picon

hyphenation disabled with polyglossia and variant=usmax

Hi,

in this document

\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage[variant=usmax]{english}
\begin{document}
\parbox{0pt}{\mbox{} example}
\end{document}

the word 'example' is happily hyphenated using either

  xelatex + variant=us
  xelatex + variant=usmax
  lualatex + variant=us

But not with

  lualatex + variant=usmax

Is that to be expected or a bug?

Best regards,
Stephan Hennig

Stephan Hennig | 11 Feb 23:54 2014
Picon

convert language name to number in Lua

Hi,

consider the following macro \langnum, which stores the language number
corresponding to an arbitrary language name in a Lua variable

  \documentclass{article}
  \usepackage[UKenglish]{babel}
  \newcommand*{\langnum}[1]{%
    \directlua{
      local number = \the\csname l <at> #1\endcsname
      tex.print(number)
    }
  }
  \begin{document}
  \langnum{USenglish} \langnum{UKenglish}
  \end{document}

How would I do the same conversion of a name to a number in pure Lua,
given a string containing an arbitrary language name?

Best regards,
Stephan Hennig

Stephan Hennig | 26 Jan 18:39 2014
Picon

towards non-standard hyphenation support in LuaTeX

[ To tex-hyphen@...
  CC luatex@...
  CC lualatex-dev@...
  Please keep tex-hyphen copied in your replies.]

Hi,

I'd like to invite you to checkout
<URL:https://github.com/sh2d/padrinoma>.  The repository contains a
package that provides support for pattern driven node list manipulations
in LuaTeX.

There are a handful of typographic features missing in TeX that involve
certain kinds of glyph replacement and in principle can be implemented
at the node list level in LuaTeX.  Examples are non-standard
hyphenation, smart ligature building or long/round s handling in
black-letter fonts.  There's two main questions that need to be answered
when doing low-level operations like this on node lists:

  a) Where to apply manipulations?

  b) What manipulations to apply?

The purpose of the padrinoma package is to give a higher-level answer to
the first question.  Given suitable patterns (that look like ordinary
Liang patterns), the package can scan a node list, apply the patterns to
the words found and return data structures that contain the results of
the pattern matching.

Some basic, illustrative examples of how that can be used can be found
in directory examples/pdnm/.  Document hyph-mark-color.tex colours all
letter pairs surrounding valid hyphenation points in a word (without
falling-back to LuaTeX's lang.hyphenate function).  Document
hyph-mark-explicit.tex is similar, but inserts a certain character at a
valid hyphenation position instead of the colouring.  Document
german-nstd-hyph.tex is a bit more ambitious and shows an attempt to
bring non-standard ck hyphenation to German users.  Example patterns are
provided.

Quick start:  To compile the sample documents, the following files

  lua-classes/cls_pdnm*.lua
  lua-modules/pdnm*.lua

have to be placed in a local TEXMF tree.  In general, mktexlsr needs to
be run afterwards.  Then move to the example documents and compile them
using LuaLaTeX.

There's not much user-level documentation, currently.  That's because
the package doesn't contain user-level code. :-)  The API of Lua modules
and classes is documented in LuaDoc format.  Documentation of examples,
on the other hand, is terse or non-existent.  If you want to play with
the example documents, look for a line

>   nlm.register_manipulation('hyph-la.pat.txt', 'pdnm_hyph-mark-explicit')

or similar.  The first argument to the function call is the name of an
ordinary pattern file (plain UTF-8 text) and the second argument is the
name of a Lua module implementing a particular kind of node list
manipulation.

Directory lua-classes/ contains basic data structures needed for the
pattern matching.  Pure TeX hackers need not care about the code there.
 Directory lua-modules/ contains modules that apply the data structures
from the former directory to LuaTeX's node lists.

What works: The example documents, see above.

What's missing: Much!

I'm announcing the package here, because it is at a point where input
and code contributions from people more firm in TeX and LaTeX internals
than me is desired.

Format:

  * A user-level TeX and LaTeX interface is missing.

  * How should a low-level LuaTeX interface look like?
    If the approach shown here proves useful, I think
    non-standard hyphenation and other application should get
    first class support similar to regular hyphenation by formats.

  * What about Babel/Polyglossia/hyph-utf8 integration?

Plain TeX:

  * Currently, only a very basic notion of a "word" is implemented.
    Basically, a word is a series of glyph, discretionary or
    user-defined whatsit nodes.  Plain TeX has a much more sophisticated
    notion of a "word subject to hyphenation".
      => see file lua-modules/pdnm_nl_iterate_words.lua

  * The language of a "word" is currently completely ignored.

  * "Words" are currently not checked against the list of hyphenation
    exceptions.

  * There's no way to locally switch off a particular manipulation for
    a single word or phrase.  This is needed for words where certain
    glyph replacements might not be desirable, e.g., names for better
    recognition.

  * And much more ...

Prospectively, I hope that LuaTeX gets means to apply more than one type
of patterns and custom manipulations to a node list built-in so that
this package renders superfluous.  (Well, if this approach works out,
Hans and Taco might as well get reluctant adding that functionality to
the core. :-)  Until then, please share your ideas and -- more important
-- your coding skills!

Happy TeXing!
Stephan Hennig

Stephan Hennig | 15 Jan 18:26 2014
Picon

hyphenation with ligatures in input

[CC: lualatex-dev@...
Please reply to tex-hyphen@...]

Hi,

in the following, I'm only considering LuaTeX with UTF-8 encoded input.

When a ligature character, e.g., fi, is already present in the input
stream, LuaTeX won't hyphenate that word correctly.

\showhyphens{financial financial}
\bye

> This is LuaTeX, Version beta-0.76.0-2013120414 (rev 4627)  (format=luatex 2013.12.11)  15 JAN 2014 18:17
> [...]
> [][] \tenrm fi-nan-cial finan-cial

The same is true for LuaLaTeX, by default, or when activating US
hyphenation patterns with either Babel or Polyglossia.

However, when activating UK hyphenation patterns the word containing the
ligature is also hyphenated (code attached at the end).

> This is LuaTeX, Version beta-0.76.0-2013120414 (rev 4627)  (format=lualatex 2013.12.11)  15 JAN 2014 18:20
> [...]
> [][] \EU2/lmr/m/n/10 fin-an-cial fin-an-cial

Why is that?  I can't find an fi ligature character neither in UK
hyphenation patterns nor in the exception list (hyph-en-gb.pat.txt,
hyph-en-gb.hyp.txt).

What set of (ligature) characters is handled such a special way?

Does the handling depend on the fonts used?

Best regards,
Stephan Hennig

% -*- coding: utf-8 -*-
\documentclass{article}
%\usepackage[USenglish]{babel}
%\usepackage[UKenglish]{babel}
\usepackage{polyglossia}
%\setmainlanguage[variant=us]{english}
\setmainlanguage[variant=uk]{english}
\begin{document}
\showhyphens{financial financial}
\end{document}

Wolfgang Jeltsch | 16 Aug 13:45 2013

luatex.sty and luatexbase.sty

Hi,

it seems that luatex.sty tries to solve problems that also
luatexbase.sty tries to solve. For example, both seem to deal with
attributes and catcode tables.

Now I have discovered that I cannot load luatexbase if I have already
loaded luacolor, which uses luatex.sty. If I try, I get the following
error message:

    ! LuaTeX error
    $TEXMFROOT/texmf-dist/tex/luatex/luatexbase/attr.lua:43:
    luatexbase error: attribute 0 has already been set by
    ewattributemacro from luatex.sty, not belonging to this package,
    this makesluaotfload unusable. Please report to the maintainer of
    luatex.sty
    stack traceback:
            [C]: in function 'error'
            $TEXMFROOT/texmf-dist/tex/luatex/luatexbase/attr.lua:43:
            in main chunk
            [C]: in function 'require'
            [string "\directlua "]:1: in main chunk.
    l.90 ...exbase <at> directlua{require('luatexbase.attr')}

Is luatex.sty just outdated and shouldn’t be used anymore? If yes, than
maybe I shouldn’t tell the maintainer of luatex.sty about this problem,
but ask the maintainer of luacolor (which happens to be the same person)
to not use luatex.sty anymore.

Any enlightenment would be greatly appreciated.

Best wishes,
Wolfgang

Wolfgang Jeltsch | 3 Aug 19:28 2013
Picon
Picon

patch for lualatex-math.lua

Hi Philipp,

I don’t know if you have followed the recent discussion on lualatex-dev
about an issue with the lualatex-math package.

The code in lualatex-math.lua relies on unpack being a global variable,
which was the case in Lua 5.1, but is not the case anymore in Lua 5.2.
As a result, I get the following error when importing amsmath and
lualatex-math in the same document:

    ! LuaTeX error
    .../texmf-dist/tex/lualatex/lualatex-math/lualatex-math.lua:46:
    attempt to call upvalue 'unpack' (a nil value)
    stack traceback:
            .../texmf-dist/tex/lualatex/lualatex-math/lualatex-math.lua:46:
            in function 'print_class_fam_slot'
            [string "\directlua "]:1: in main chunk.
    \__lltxmath_set_mathchar:NN ...\int_eval:n {`#2})}
                                                      \scan_stop: 

Other Lua files (lualibs-basic-merged.lua, lualibs-lua.lua, and
luaotfload-merged.lua) use the following code to work around this
incompatibility between Lua 5.1 and Lua 5.2:

    if not table.unpack then
      table.unpack=_G.unpack
    elseif not unpack then
      _G.unpack=table.unpack
    end

By adding this code to lualatex-math.lua at an appropriate place, I was
able to fix the issue with lualatex-math and amsmath.

I’ve attached a patch. Could this patch or some other fix for the
problem please be incorporated into lualatex-math? Thank you.

Best wishes,
Wolfgang
Attachment (lualatex-math.lua.diff): text/x-patch, 121 bytes
Wolfgang Jeltsch | 3 Aug 13:27 2013

lualatex-math cannot find unpack function

Hi,

if I import both amsmath and lualatex-math, I get the following error
message when LuaLaTeX tries to process \begin{document}:

! LuaTeX error
.../texmf-dist/tex/lualatex/lualatex-math/lualatex-math.lua:46:
attempt to call upvalue 'unpack' (a nil value)
stack traceback:
        .../texmf-dist/tex/lualatex/lualatex-math/lualatex-math.lua:46:
        in function 'print_class_fam_slot'
        [string "\directlua "]:1: in main chunk.
\__lltxmath_set_mathchar:NN ...\int_eval:n {`#2})}
                                                  \scan_stop: 

What is the reason for this?

Best wishes,
Wolfgang


Gmane