From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/80685 Path: news.gmane.org!not-for-mail From: Ingo Hohmann Newsgroups: gmane.comp.tex.context Subject: Re: block with different formatting per line? Date: Wed, 06 Feb 2013 07:04:52 +0100 Message-ID: <5111F284.70404@ingohohmann.de> References: <510C4CBA.3010806@ingohohmann.de> <1E5A50C784A8AD44B420EF5A1E9B2806C82321D2@e14mbx23n.Enterprise.emory.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0117068213==" X-Trace: ger.gmane.org 1360130706 17639 80.91.229.3 (6 Feb 2013 06:05:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Feb 2013 06:05:06 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Feb 06 07:05:27 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U2y8G-0000xu-Oa for gctc-ntg-context-518@m.gmane.org; Wed, 06 Feb 2013 07:05:20 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id BF3711024C; Wed, 6 Feb 2013 07:05:00 +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 OFSWiuiaOn8E; Wed, 6 Feb 2013 07:04:57 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 8DE83101E7; Wed, 6 Feb 2013 07:04:57 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E3710101E7 for ; Wed, 6 Feb 2013 07:04:55 +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 Pf919UmL79Wk for ; Wed, 6 Feb 2013 07:04:55 +0100 (CET) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id EB45D101E5 for ; Wed, 6 Feb 2013 07:04:54 +0100 (CET) Original-Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r1664rt1008285 for ; Wed, 6 Feb 2013 07:04:54 +0100 Original-Received: from [192.168.178.107] (hmbg-4d06faa8.pool.mediaWays.net [77.6.250.168]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0Mg2LJ-1UGue02C4z-00OBu4; Wed, 06 Feb 2013 07:04:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 In-Reply-To: <1E5A50C784A8AD44B420EF5A1E9B2806C82321D2@e14mbx23n.Enterprise.emory.net> X-Provags-ID: V02:K0:RhzfBxbQ0NmSIOLkLUDFxkSB8qDZA5cCn6CKiOFjGaL 7/NGnrho9/yDapOMtTk9aWEHqNna4Knxxj9YPrcFT4YIdq9KfB nzLnZG9vPEiiyJErGgDtQsQIMggKF0r23y9jPxJ0b2nzy+4Iwk sXAtBuM9hSNYxuX6CK5N9d2Zw3J4OiPXoem2QU1DMkuOvMlUBR s5K5kX5uyqfB9KmmGATYjwwXADvQKYSvSi4Ya0Y0LVwBfotvhT Ft3IA9eELMnKgTzHgFKFUMyeufN6qRJaVRnZXTRSVbCs5gHVse eNDYFaIArhJ1/M+GOPW50KoH9eKNce3dkeVmMaPDm1ULzl2pGd 43kztHIqckBevPrZApME= X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=212.227.126.171; country=DE; latitude=51.0000; longitude=9.0000; http://maps.google.com/maps?q=51.0000,9.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0QIUS4Sly - 2b7e07360cd3 - 20130206 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 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-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:80685 Archived-At: This is a multi-part message in MIME format. --===============0117068213== Content-Type: multipart/alternative; boundary="------------000100020608040103010103" This is a multi-part message in MIME format. --------------000100020608040103010103 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 02/03/2013 04:56 AM, Rogers, Michael K wrote: > On Feb 1, 2013, at 6:16 PM, Ingo Hohmann wrote: > >> Hi, >> >> is it possible to define a block, where lines are automatically formatted differently? >> For example: >> first line in caps, >> second in bold, >> others normal. >> >> Is this possible? And how? > If you mean input lines, then yes. But if you mean output lines, then I don't know. It seems a well-defined task, but a hard task judging by how the line-breaking algorithm is described by Knuth. I'll leave that question to experts. > > Here's a way to process the input lines. If there's a counter that counts the line number, there would be another way; but I couldn't find out that there was a counter. There may be better ways anyway. > > \define\FirstLine{\let\myLine\SecondLine\sc} > \define\SecondLine{\let\myLine\OtherLine\bf} > \define\OtherLine{\tf} > \definelines[doMyLines][command=\myLine] > \def\startMyLines{\let\myLine\FirstLine\startdoMyLines} > \def\stopMyLines{\stopdoMyLines} As I said that works, but while trying to understand this, I found that the documentation for \definelines doesn't mention the "command=" option. On the other hand it does mention "align=" and this doesn't work. Neither does \setuplines. I always get "undefined control sequence". \definelines[doFirstBoldRight][command=\myLine] \setupdoFirstBoldRight[align=flushleft] OR \definelines[doFirstBoldRight][align=flushleft,command=\myLine] gives the same error. Do you have any idea what I am doing wrong? Thank you in advance, Ingo --------------000100020608040103010103 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 02/03/2013 04:56 AM, Rogers, Michael K wrote:
On Feb 1, 2013, at 6:16 PM, Ingo Hohmann <context@ingohohmann.de> wrote:

Hi,

is it possible to define a block, where lines are automatically formatted differently?
For example:
first line in caps,
second in bold,
others normal.

Is this possible? And how?
If you mean input lines, then yes.  But if you mean output lines, then I don't know.  It seems a well-defined task, but a hard task judging by how the line-breaking algorithm is described by Knuth.  I'll leave that question to experts.

Here's a way to process the input lines.  If there's a counter that counts the line number, there would be another way; but I couldn't find out that there was a counter.  There may be better ways anyway.

\define\FirstLine{\let\myLine\SecondLine\sc}
\define\SecondLine{\let\myLine\OtherLine\bf}
\define\OtherLine{\tf}
\definelines[doMyLines][command=\myLine]
\def\startMyLines{\let\myLine\FirstLine\startdoMyLines}
\def\stopMyLines{\stopdoMyLines}
As I said that works, but while trying to understand this, I found that the documentation for \definelines doesn't mention the "command=" option. On the other hand it does mention "align=" and this doesn't work. Neither does \setuplines.

I always get "undefined control sequence".

\definelines[doFirstBoldRight][command=\myLine]
\setupdoFirstBoldRight[align=flushleft]

OR

\definelines[doFirstBoldRight][align=flushleft,command=\myLine]

gives the same error.

Do you have any idea what I am doing wrong?


Thank you in advance,

Ingo


--------------000100020608040103010103-- --===============0117068213== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0117068213==--