From 737df2d11a464a5d565da5ac24076a08944d4221 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 13 Sep 2011 22:53:49 +0000 Subject: new lualatex package showhyphens (13sep11) git-svn-id: svn://tug.org/texlive/trunk@23937 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/lualatex/showhyphens/README | 11 ++++++ .../doc/lualatex/showhyphens/showhyphens-doc.pdf | Bin 0 -> 67382 bytes .../doc/lualatex/showhyphens/showhyphens-doc.tex | 41 ++++++++++++++++++++ .../lualatex/showhyphens/showhyphens-sample.pdf | Bin 0 -> 17790 bytes .../tex/lualatex/showhyphens/showhyphens.sty | 43 +++++++++++++++++++++ Master/tlpkg/tlpsrc/collection-luatex.tlpsrc | 1 + Master/tlpkg/tlpsrc/showhyphens.tlpsrc | 0 7 files changed, 96 insertions(+) create mode 100644 Master/texmf-dist/doc/lualatex/showhyphens/README create mode 100644 Master/texmf-dist/doc/lualatex/showhyphens/showhyphens-doc.pdf create mode 100644 Master/texmf-dist/doc/lualatex/showhyphens/showhyphens-doc.tex create mode 100644 Master/texmf-dist/doc/lualatex/showhyphens/showhyphens-sample.pdf create mode 100644 Master/texmf-dist/tex/lualatex/showhyphens/showhyphens.sty create mode 100644 Master/tlpkg/tlpsrc/showhyphens.tlpsrc diff --git a/Master/texmf-dist/doc/lualatex/showhyphens/README b/Master/texmf-dist/doc/lualatex/showhyphens/README new file mode 100644 index 00000000000..1305b5cdc6f --- /dev/null +++ b/Master/texmf-dist/doc/lualatex/showhyphens/README @@ -0,0 +1,11 @@ +The LaTeX package 'showhyphens' shows all possible hyphenation points in +the PDF output. + +Usage: + +\usepackage{showhyphens} + +Requirements: The package only works with LuaLaTeX. + +Copyright 2011 Patrick Gundlach (patrick@gundla.ch), +licensed under the MIT license. See the style for details. diff --git a/Master/texmf-dist/doc/lualatex/showhyphens/showhyphens-doc.pdf b/Master/texmf-dist/doc/lualatex/showhyphens/showhyphens-doc.pdf new file mode 100644 index 00000000000..a267772d9e1 Binary files /dev/null and b/Master/texmf-dist/doc/lualatex/showhyphens/showhyphens-doc.pdf differ diff --git a/Master/texmf-dist/doc/lualatex/showhyphens/showhyphens-doc.tex b/Master/texmf-dist/doc/lualatex/showhyphens/showhyphens-doc.tex new file mode 100644 index 00000000000..1b85d473d9e --- /dev/null +++ b/Master/texmf-dist/doc/lualatex/showhyphens/showhyphens-doc.tex @@ -0,0 +1,41 @@ +\documentclass{article} +\usepackage{graphics} +\newcommand\LuaLaTeX{Lua\LaTeX} + +\begin{document} +\section{Documentation} + +When you load the package \texttt{showhyphens} in your \LuaLaTeX\ document, \LaTeX\ will show all possible hyphenation points. This +package requires you to process the document with \LuaLaTeX. + +\begin{verbatim} +\documentclass{article} +\usepackage{showhyphens} + +\begin{document} +A wonderful serenity has taken +possession of my entire soul, like these +sweet mornings of spring which I enjoy +with my whole heart. I am alone, and +feel the charm of existence in this +spot, which was created for the bliss of +souls like mine. I am so happy, my dear +friend, so absorbed in the exquisite +sense of mere tranquil existence, that I +neglect my talents. I should be +incapable of drawing a single stroke at +the present moment; and yet I feel that +I never was a greater artist than now. +\end{document} +\end{verbatim} + +yields \vspace{5mm} + +\noindent \includegraphics{showhyphens-sample} + +\section{Copying} + +Copyright 2011 Patrick Gundlach (patrick@gundla.ch), licensed under the MIT license. See the style for details. + + +\end{document} diff --git a/Master/texmf-dist/doc/lualatex/showhyphens/showhyphens-sample.pdf b/Master/texmf-dist/doc/lualatex/showhyphens/showhyphens-sample.pdf new file mode 100644 index 00000000000..1a961538abc Binary files /dev/null and b/Master/texmf-dist/doc/lualatex/showhyphens/showhyphens-sample.pdf differ diff --git a/Master/texmf-dist/tex/lualatex/showhyphens/showhyphens.sty b/Master/texmf-dist/tex/lualatex/showhyphens/showhyphens.sty new file mode 100644 index 00000000000..849164d8b10 --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/showhyphens/showhyphens.sty @@ -0,0 +1,43 @@ +\ProvidesPackage{showhyphens}[2011/09/12 v0.1 Show hyphenation points (PGU)] +\RequirePackage{ifluatex,luatexbase} +% License: MIT style license + +% Copyright (c) 2011 Patrick Gundlach patrick@gundla.ch + +% Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the +% "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, +% publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do +% so, subject to the following conditions: +% +% The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +% +% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +% MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +% FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +% WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +\ifluatex +\directlua{ +show_hyph = function(head) + while head do + if head.id == 0 or head.id == 1 then % hlist, vlist + show_hyph(head.head) + elseif head.id == 7 then % disc + local n = node.new("whatsit","pdf_literal") + n.mode = 0 + n.data = "q 1 0 0 RG 0.3 w 0 2 m 0 7 l S Q" + n.next = head.next + n.prev = head + head.next = n + head = n + end + head = head.next + end + return true +end +luatexbase.add_to_callback("post_linebreak_filter",show_hyph,"show_hyph") +} +\else +\errhelp{Please use LuaLaTeX when you require the package 'showhyphens'} +\errmessage{Package showhyphens error: This works only with LuaLaTeX!} +\fi diff --git a/Master/tlpkg/tlpsrc/collection-luatex.tlpsrc b/Master/tlpkg/tlpsrc/collection-luatex.tlpsrc index 4f7a1b5bc80..a4f6b4b2e2b 100644 --- a/Master/tlpkg/tlpsrc/collection-luatex.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-luatex.tlpsrc @@ -19,3 +19,4 @@ depend luapersian depend luasseq depend luatexbase depend luatextra +depend showhyphens diff --git a/Master/tlpkg/tlpsrc/showhyphens.tlpsrc b/Master/tlpkg/tlpsrc/showhyphens.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d -- cgit v1.2.3