summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/luatex/luaintro/04-04-17.lualtx
blob: 387c6be9dde0795ba892b9a756276a82ffb3395b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
%% 
%%  Ein Beispiel der DANTE-Edition
%%  
%%  1. Auflage
%% 
%% 
%%  Copyright (C) 2013 Herbert Voss
%% 
%%  It may be distributed and/or modified under the conditions
%%  of the LaTeX Project Public License, either version 1.3
%%  of this license or (at your option) any later version.
%% 
%%  See http://www.latex-project.org/lppl.txt for details.
%% 
%% 
%% ==== 
% Show page(s) 1
%% 
%% 
\documentclass[]{exaarticle}
\pagestyle{empty}
\setlength\textwidth{352.81416pt}
\textwidth=320pt
%StartShownPreambleCommands
\usepackage{luacode,libertine}
\begin{luacode*}
function active_hyphen (head)
  local orig_head = head
  while head do
    if head.id == 37 then
      head.subtype = 1
      if head.char == 45 then
        local p = node.new("penalty")
        p.penalty = 10000
        local g = node.new("glue")
        g.spec = node.new("glue_spec")
        g.spec.width = 0
        head.prev.next = p
        p.next = head
        p.prev = head.prev
        g.prev = head
        g.next = head.next
        head.prev = p
        head.next = g
        g.next.prev = g
      end
    end
    head = head.next
  end
  lang.hyphenate(orig_head) -- Trennungen neu testen
  return true
end
\end{luacode*}
%StopShownPreambleCommands
\begin{document}
\noindent\rule{\linewidth}{0.5pt}\makebox(0,0){\put(0,-200){\line(0,1){100}}}
\par
Finally, all of the three antibiotics examined had a negative effect on
$\beta$-galactosidase activity from the time they were introduced to the
assay.  \par
\directlua{luatexbase.add_to_callback("pre_linebreak_filter",active_hyphen,"hyphen")}
Finally, all of the three antibiotics examined had a negative effect on
$\beta$-galactosidase activity from the time they were introduced to the
assay.\par
\directlua{luatexbase.remove_from_callback("pre_linebreak_filter","hyphen")}
Finally, all of the three antibiotics examined had a negative effect on
$\beta$-galactosidase activity from the time they were introduced to the
assay.
\end{document}