From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/25670 Path: news.gmane.org!not-for-mail From: Taco Hoekwater Newsgroups: gmane.comp.tex.context Subject: Re: Lettrine and \startnarrower question Date: Sun, 29 Jan 2006 18:53:35 +0100 Message-ID: <43DD011F.5040806@elvenkind.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040609030104080405040300" X-Trace: sea.gmane.org 1138557188 27184 80.91.229.2 (29 Jan 2006 17:53:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 29 Jan 2006 17:53:08 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sun Jan 29 18:53:06 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1F3GjU-0006O8-VE for gctc-ntg-context-518@m.gmane.org; Sun, 29 Jan 2006 18:53:01 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 4DDA7127E9; Sun, 29 Jan 2006 18:53:00 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 08578-02; Sun, 29 Jan 2006 18:52:56 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6AEB2127D7; Sun, 29 Jan 2006 18:52:56 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C59AD127D7 for ; Sun, 29 Jan 2006 18:52:54 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 08440-07 for ; Sun, 29 Jan 2006 18:52:53 +0100 (CET) Original-Received: from post-23.mail.nl.demon.net (post-23.mail.nl.demon.net [194.159.73.193]) by ronja.ntg.nl (Postfix) with SMTP id D8772127D6 for ; Sun, 29 Jan 2006 18:52:53 +0100 (CET) Original-Received: from boo.demon.nl ([82.161.175.147]:34365 helo=[192.168.1.3]) by post-23.mail.nl.demon.net with esmtp (Exim 4.51) id 1F3GjN-000LqJ-1Z for ntg-context@ntg.nl; Sun, 29 Jan 2006 17:52:53 +0000 User-Agent: Mozilla Thunderbird 1.0 (X11/20050215) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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 X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:25670 Archived-At: This is a multi-part message in MIME format. --------------040609030104080405040300 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Adrian Drury wrote: > Hello, > > Using \lettrine (version 2005.08.29) inside \startnarrower\stopnarrower > gives results I didn't expect - see the example below. Part of the text > seems to be shifted right by an additional left-indent amount. Is this > correct and/or expected behavior? If it is, is there a workaround to Not it was wrong. Please try the attached version and let me know if that is ok (is so, I will upload the new version to contextgarden.net) Cheers, Taco --------------040609030104080405040300 Content-Type: application/x-tex; name="t-lettrine.tex" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="t-lettrine.tex" %D \module %D [ file=t-lettri, %D version=2005.08.29, %D title=\CONTEXT\ Lettrines, %D subtitle=Funny stuff, %D author=Taco Hoekwater, %D date=\currentdate, %D copyright=Public Domain] %C %C Donated to the public domain. %D This is just a quick and dirty conversion of the LaTeX package %D %D \ProvidesFile{lettrine.sty}[2004/05/22 v1.6 (D. Flipo)] %D %D Errors are likely mine, credit is due to Daniel.Flipo@univ-lille1.fr %D %D If enough people like it, I may even clean this mess up sometime. The %D current version is just a (c)rude conversion of the low-level LaTeX %D stuff to sometimes even lower-level ConTeXt. %D \unprotect \newbox\Lettrinelbox \newbox\Lettrinetbox \newcount\Lettrinelines \newdimen\LettrineHeight \newdimen\Lettrinefirst \newdimen\Lettrinenext \newdimen\Lettrineraise \newdimen\Lettrinepindent \newdimen\Lettrinefindent \newdimen\Lettrinenindent \getparameters[LettrineDefault] [Lines=2, Hang=0, Oversize=0, Raise=0, Findent=0pt, Nindent=0.5em, Slope=0pt, Ante=, FontHook=, TextFont=\sc, Image=\v!no] \def\setuplettrine{\dodoubleempty\dosetuplettrine} \def\dosetuplettrine[#1][#2]{% \doifassignmentelse{#1}{% \dodosetuplettrine[][#1]% }{% \def\ascii{}% \doifsomething{#1}{\convertargument#1\to\ascii }% \expandafter\dodosetuplettrine\expandafter[\ascii][#2]% }% } \def\dodosetuplettrine[#1][#2]{% \getparameters[LettrineDefault#1][#2] } \def\doLettrineHeight{% \LettrineHeight =\Lettrinelines\baselineskip\relax \ifnum\Lettrinelines>1 \advance\LettrineHeight -\baselineskip \fi \setbox\Lettrinetbox\hbox{{\LettrineTextFont x}}% \LettrineHeight = \dimexpr \LettrineHeight+ \ht\Lettrinetbox + \LettrineOversize\LettrineHeight \relax } \def\doLettrineEPS#1{% \doLettrineHeight\LettrineFontHook \externalfigure[#1][\c!height=\LettrineHeight]} \def\doLettrineFont{% \doLettrineHeight \definefontsynonym[LettrineFont][Serif]% \setbox\Lettrinetbox=\hbox{{\LettrineFontHook \definedfont[LettrineFont at \the\LettrineHeight] X}}% \scratchcounter = \numexpr (100*\LettrineHeight)/(\ht\Lettrinetbox/100) - 9999\relax \ifnum\scratchcounter>0 \def\tempa{1.\the\scratchcounter}% \else \def\tempa{1}% \fi \LettrineFontHook \!!dimena = \tempa\LettrineHeight \definedfont[LettrineFont at \the\!!dimena]% }% \def\lettrine{\dosingleempty\dolettrine} \def\dolettrine[#1]#2#3{% \convertargument#2\to\ascii \def\lettrgetparam##1{% \ifcsname LettrineDefault\ascii##1\endcsname \setevalue{Lettrine##1}{\csname LettrineDefault\ascii##1\endcsname}% \else \setevalue{Lettrine##1}{\csname LettrineDefault##1\endcsname}% \fi}% \processcommalist [Lines,Hang,Oversize,Raise,Findent,Nindent,Slope,Ante,FontHook,TextFont,Image]\lettrgetparam \getparameters[Lettrine][#1]% \Lettrinenindent=\LettrineNindent\relax \Lettrinefindent=\LettrineFindent\relax \Lettrinelines =\LettrineLines\relax \setbox\Lettrinelbox\hbox{{\ifx\LettrineImage\v!yes\doLettrineEPS{#2}\else \ifx\LettrineImage\v!true\doLettrineEPS{#2}\else \doLettrineFont #2\fi\fi}}% \setbox\Lettrinetbox\hbox{{\LettrineTextFont{#3}}}% \ifnum\Lettrinelines=1 \Lettrinefirst = \dimexpr \ht\Lettrinelbox-\ht\Lettrinetbox \relax \Lettrineraise=0pt \else \setbox\scratchbox\hbox{{\LettrineTextFont x}}% \Lettrinefirst = \dimexpr -\Lettrinelines\baselineskip + \baselineskip -\ht\scratchbox \relax \Lettrineraise = \dimexpr\LettrineRaise\Lettrinefirst \relax \Lettrineraise = -\Lettrineraise \relax \Lettrinefirst = \dimexpr\Lettrinefirst+\Lettrineraise+\ht\Lettrinelbox \relax \Lettrineraise = \dimexpr\Lettrineraise-\Lettrinelines\baselineskip +\baselineskip \relax \fi \par \ifdim\Lettrinefirst>0.2pt\vskip\Lettrinefirst\fi \setbox\scratchbox= \hbox{\LettrineAnte}% \setlocalhsize \Lettrinepindent= \dimexpr \wd\Lettrinelbox -\LettrineHang\wd\Lettrinelbox + \wd\scratchbox + \Lettrinefindent \relax \Lettrinefirst=\dimexpr \localhsize -\Lettrinepindent +\rightskip+\leftskip\relax \advance\Lettrinenindent \Lettrinepindent \Lettrinenext=\dimexpr \localhsize -\Lettrinenindent +\rightskip+\leftskip\relax \def\Lparshape{\the\numexpr\Lettrinelines+1\relax\space \the\Lettrinepindent\space \the\Lettrinefirst}% \dorecurse{\numexpr \Lettrinelines - 1 \relax}{% \edef\Lparshape{\Lparshape\space \the\Lettrinenindent\space \the\Lettrinenext}% \advance\Lettrinenindent\LettrineSlope \advance\Lettrinenext -\LettrineSlope }% \edef\Lparshape{\Lparshape\space 0pt\space \the\localhsize}% \setbox\scratchbox = \hbox{\hbox{\LettrineAnte}\raise \Lettrineraise \hbox{\box\Lettrinelbox }}% \scratchdimen = \dimexpr \dp\scratchbox + \ht\strutbox + 1pt\relax \vskip\scratchdimen \penalty0\vskip-\scratchdimen \noindent \scratchdimen = \leftskip \leftskip=\scratchdimen \scratchdimen = \rightskip \rightskip=\scratchdimen \parshape=\Lparshape \smash{\llap{\box\scratchbox}}% \hskip \the\Lettrinefindent \box\Lettrinetbox } \protect \endinput --------------040609030104080405040300 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context --------------040609030104080405040300--