From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/66377 Path: news.gmane.org!not-for-mail From: Patrick Gundlach Newsgroups: gmane.comp.tex.context Subject: post_linebreak_filter in context Date: Fri, 25 Feb 2011 12:28:58 +0100 Message-ID: <65243520-DA54-4978-A996-AA761054D3EB@gundla.ch> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1298633387 8579 80.91.229.12 (25 Feb 2011 11:29:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 25 Feb 2011 11:29:47 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Feb 25 12:29:43 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Psvri-0006Xf-JM for gctc-ntg-context-518@m.gmane.org; Fri, 25 Feb 2011 12:29:42 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CC69DCAA6B; Fri, 25 Feb 2011 12:29:41 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id RTCIEPqakfVf; Fri, 25 Feb 2011 12:29:29 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6EB8ECAA66; Fri, 25 Feb 2011 12:29:29 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B1415CAA66 for ; Fri, 25 Feb 2011 12:29:28 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id VX5VOoyNNiI2 for ; Fri, 25 Feb 2011 12:29:07 +0100 (CET) Original-Received: from filter5-ams.mf.surf.net (filter5-ams.mf.surf.net [192.87.102.73]) by balder.ntg.nl (Postfix) with ESMTP id B387DCAA5E for ; Fri, 25 Feb 2011 12:29:07 +0100 (CET) Original-Received: from unimail.uni-dortmund.de (mx1.HRZ.Uni-Dortmund.DE [129.217.128.51]) by filter5-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p1PBT6dU020264 for ; Fri, 25 Feb 2011 12:29:07 +0100 Original-Received: from [192.168.1.100] (f053012064.adsl.alicedsl.de [78.53.12.64]) (authenticated bits=0) by unimail.uni-dortmund.de (8.14.4/8.14.4) with ESMTP id p1PBSwOW001736 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Fri, 25 Feb 2011 12:29:04 +0100 (CET) X-Mailer: Apple Mail (2.1082) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=129.217.128.51; country=DE; region=07; city=Dortmund; latitude=51.5167; longitude=7.4500; http://maps.google.com/maps?q=51.5167,7.4500&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0BEcbt6yF - 2a0a7066a28c - 20110225 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.73 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:66377 Archived-At: Hi, how do I install a custom post_linebreak_filter in ConTeXt? I have this LaTeX file: ------------------------------------------------------------------------------------ \documentclass[12pt,a4paper]{scrartcl} \usepackage[english]{babel} \usepackage{blindtext} \usepackage{fontspec} \directlua{ show_hyph = function(head) while head do if head.id == 0 or head.id == 1 then % hlist, vlist show_hyph(head.list) % should be head.head in a newer luatex than 0.64 elseif head.id == 7 then % disc local n = node.new("whatsit","pdf_literal") n.mode = 0 n.data = "q 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") } \begin{document} \begin{minipage}{5cm} \blindtext \end{minipage} \end{document} ------------------------------------------------------------------------------------ which registers a function "show_hyph" as the post_linebreak_filter (the rest is not really interesting). How would I do this in ConTeXt? (also asked on tex.se: http://tex.stackexchange.com/questions/11960/how-to-register-a-callback-in-context) Thanks Patrick ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________