From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/89852 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: filter module's inline command and supressed spacing Date: Mon, 19 Jan 2015 10:46:41 -0500 (EST) Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1667137667-1421682385=:27642" X-Trace: ger.gmane.org 1421682446 21381 80.91.229.3 (19 Jan 2015 15:47:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Jan 2015 15:47:26 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jan 19 16:47:25 2015 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YDEXz-0001yi-Lf for gctc-ntg-context-518@m.gmane.org; Mon, 19 Jan 2015 16:47:23 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0D1D010220 for ; Mon, 19 Jan 2015 16:47:23 +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 C-4zURQHCM8G for ; Mon, 19 Jan 2015 16:47:21 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 890BD1022D for ; Mon, 19 Jan 2015 16:46:51 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E15DD101EA for ; Mon, 19 Jan 2015 16:46:48 +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 UefHRBLWPSot for ; Mon, 19 Jan 2015 16:46:47 +0100 (CET) Original-Received: from filter1-utr.mf.surf.net (filter1-utr.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id CFF8F101E8 for ; Mon, 19 Jan 2015 16:46:47 +0100 (CET) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.12.86]) by filter1-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id t0JFkh6H005330 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 19 Jan 2015 16:46:45 +0100 Original-Received: FROM Decentralized.ECE.McGill.CA (Decentralized.ECE.McGill.CA [132.206.69.142]) By tombraider.mr.itd.umich.edu ID 54BD26E2.DE0E8.16613 ; Authuser adityam; 19 Jan 2015 10:46:43 EST In-Reply-To: User-Agent: Alpine 2.03 (LNX 1266 2009-07-14) Content-ID: X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=141.211.12.86; country=US; region=Michigan; city=Ann Arbor; latitude=42.3241; longitude=-83.7113; http://maps.google.com/maps?q=42.3241,-83.7113&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 07NFPKIbk - fec1d16b19ba - 20150119 (trained as not-spam) Received-SPF: none (filter1-utr.mf.surf.net: domain of adityam@umich.edu does not designate permitted sender hosts) receiver=filter1-utr.mf.surf.net; client-ip=141.211.12.86; envelope-from=; helo=tombraider.mr.itd.umich.edu; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:89852 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1667137667-1421682385=:27642 Content-Type: TEXT/PLAIN; CHARSET=ISO-8859-2; FORMAT=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Content-ID: On Tue, 30 Dec 2014, Piotr Kopszak wrote: > Hello list, > > It looks like a bug in the filter module, but maybe I'm doing > something wrong. Any help will be greatly appreciated. When using the > \inlinepandoc command in the first paragraph below the space at the > end of the paragraph in "=BFyciaA. Mickiewicza" is supressed when it > should be "=BFycia A. Mickiewicza". This does not happen when using > pandoc environment. If you want to run the minimal example you have to > make sure you got the recent pandoc which supports twiki input format > and create the "output" subdirectory in your working directory. > > Best > > Piotr > -------------------------------------------------------------------------= --- > \usemodule[filter] > \defineexternalfilter > [pandoc] > [ > filter=3D{pandoc -f \externalfilterparameter{format} -t context > -o \externalfilteroutputfile}, > format=3Dtwiki, > directory=3Doutput, > ] > \starttext > Inne tyt.: Wizyta pana Franciszka Grzyma=B3y, Exegi monumentum aere > perennius.... Powst. Pary=BF, na autografie podpis: "Pary=BF, 12 marca > 1833. Wiersze natchnione wizyt=B1 Fr. Grzyma=B3y". Pdr: {\it Czas} 1859 > nr nr 118 s. 2. (\inlinepandoc{w artykule L*** (E. > Januszkiewicza) "Notatki wspomnie=F1 z =BFycia A. Mickiewicza"}). > > \startpandoc > Inne tyt.: Wizyta pana Franciszka Grzyma=B3y, Exegi monumentum aere > perennius.... Powst. Pary=BF, na autografie podpis: "Pary=BF, 12 marca > 1833. Wiersze natchnione wizyt=B1 Fr. Grzyma=B3y". Pdr: {\it Czas} 1859 > nr nr 118 s. 2. (w artykule L*** (E. Januszkiewicza) > "Notatki wspomnie=F1 z =BFycia A. Mickiewicza"). > \stoppandoc > \stoptext Sorry for the late reply. Short answer: Change \defineexternalfilter to (add --no-wrap): fineexternalfilter [pandoc] [ filter=3D{pandoc --no-wrap -f \externalfilterparameter{format} -t=20 context -o \externalfilteroutputfile}, format=3Dtwiki, directory=3Doutput, ] Long answer: This is what is happening. Normally, when an external filter like pandoc creates an output, it adds a= =20 `\n` at the end of the last line. This leads to an empty line when the=20 file is read back in ConTeXt. To prevent that I set \endlinechar=3D-1 in th= e=20 inline mode. However, this also means that the linebreak at the end of every line is=20 ignored. Typically this is not a problem because you expect \inline<...>=20 snippets to be short. But pandoc formats its output to 80 characters. So, the example that you=20 gave is formatted as: ----- w artykule L*** (E.Januszkiewicza) \quotation{Notatki wspomnie=F1 z =BFycia A. Mickiewicza} ---- When reading it, the space at the end of 'zycia' is ignored. I can try not setting \endlinechar=3D-1, and adding \removeunwantedspaces= =20 after reading a file, but this will require some extensive testing. An=20 easier solution is to add --no-wrap option to pandoc, so that pandoc does= =20 not wrap the lines in the first place. Aditya --0-1667137667-1421682385=:27642 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --0-1667137667-1421682385=:27642--