Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am seeing broken positioning of letters produced by the lettrine module. Here is my MVE:

\setuppapersize[A4][A4]
\usemodule[lettrine]

\definehead[recipe][section]
\setuphead[recipe][
  beforesection={\startcolumns[n=2, rule=on]},
  aftersection={\stopcolumns}]

\definenumber[stepnum][way=bytext,prefix=no]

\definestartstop[steps][
  before={\startsubsubsubject[title={Příprava}]\setnumber[stepnum]{1}},
  after={\stopsubsubsubject}]

\definestartstop[step][
  before={\lettrine[Lines=3]{\getnumber[stepnum]}{}},
  after={\incrementnumber[stepnum]}]

\starttext
\startrecipe[title={Bábovka}, reference={babovka}]
  \startsteps
    \startstep
      A word word word word.
    \stopstep

    \startstep
      Another word word word word word word word word word word word
      word word word word word word word word word word word word word
      word word word word word word word word word word word word word
      word word word.
    \stopstep

    \startstep
      Yet another word word word word word word word word word word
      word word word word word word word word word word word word word
      word word word word word word word word word word word word word
      word word word word word word word word.
    \stopstep
  \stopsteps
\stoprecipe

\stoptext

And here is a screenshot:

Lettrine problem

Can I fix it anyhow or is this the lettrine module problem?


UPDATE

The \setnumber[stepnum]{1} in the source should be \setnumber[stepnum][1]. But this does not fix the problem.


UPDATE 2

While using \placeinitial works better, it still has some problems in the two column layout:

Imgur

Please notice the 2 and the extra vertical space at the beginning of the second column. Here is my updated MVE:

\setuppapersize[A4][A4]
\usemodule[lettrine]

\definehead[recipe][section]
\setuphead[recipe][
  beforesection={\startcolumns[n=2, rule=on]},
  aftersection={\stopcolumns}]

\definenumber[stepnum][way=bytext,prefix=no]

\definestartstop[steps][
  before={\startsubsubsubject[title={\bf Příprava}]\setnumber[stepnum][1]},
  after={\stopsubsubsubject}]

\definestartstop[step][
  before={\lettrine[Lines=2]{\getnumber[stepnum]}{}},
  after={\incrementnumber[stepnum]}]

\setupinitial[font=Regular sa 2.5,distance=1pt,state=start,n=2]

\definestartstop[xstep][
  before={\placeinitial {\getnumber[stepnum]}{}},
  after={\incrementnumber[stepnum]}]

\starttext
\startrecipe[title={Bábovka}, reference={babovka}]
  A word word word word. A word word word word. A word word word
  word. A word word word word. A word word word word. A word word word
  word. A word word word word. A word word word word.

  \startsteps
    \startxstep
      A word word word word.
    \stopxstep

    \startxstep
      Another word word word word word word word word word word word
      word word word word word word word word word word word word word
      word word word word word word word word word word word word word
      word word word.
    \stopxstep

    \startxstep
      Yet another word word word word word word word word word word
      word word word word word word word word word word word word word
      word word word word word word word word word word word word word
      word word word word word word word word.
    \stopxstep
  \stopsteps
\stoprecipe

\stoptext
share|improve this question
1  
Have you tried using initials instead of lettine: wiki.contextgarden.net/Initials –  Aditya Jun 16 '13 at 20:41
    
@Aditya: Thanks, using \setupinitial/\placeinitial it works a lot better. –  Václav Zeman Jun 16 '13 at 21:27
    
@Aditya: Please see my second update. –  Václav Zeman Jun 16 '13 at 21:59
1  
Change before={\testpage[3]\placeinitial {\getnumber[stepnum]}}} The \testpage[3] macro will cause a page break if there are less than 3 lines on the current page. (Not sure if it works well with columns). –  Aditya Jun 16 '13 at 23:15
    
@Aditya: Using \testpage[3] does not seem to do anything for the test case. –  Václav Zeman Jun 18 '13 at 5:57

1 Answer 1

I omitted the title and reference number from the recipe, as it was causing an unwanted gap. I also started the two columns before the recipe. I have seen this problem before, but can't remember now if it was here or for a document I was compiling.


\setuppapersize[A4][A4]
\usemodule[lettrine]

\setupcolumns[n=2,rule=on]
\setuphead[section][number=no]

\definenumber[stepnum][way=bytext,prefix=no]

\definestartstop[steps][
  before={\startsubsubsubject\setnumber[stepnum]{1}},
  after={\stopsubsubsubject}]

\definestartstop[step][
  before={\lettrine[Lines=3]{\getnumber[stepnum]}{}},
  after={\incrementnumber[stepnum]}]

\starttext
\startcolumns
\startrecipe
  \startsteps
    \section{\bf{Bábovka}}
   \startstep
      A word word word word.Another word word word word word word word word word word word
      word word word word word word word word word word word word word
      word word word word word word word word word word word word word
      word word word.
    \stopstep

    \startstep
      Another word word word word word word word word word word word
      word word word word word word word word word word word word word
      word word word word word word word word word word word word word
      word word word.
    \stopstep

   \section{\bf{Příprava}}
    \startstep
      Yet another word word word word word word word word word word
      word word word word word word word word word word word word word
      word word word word word word word word word word word word word
      word word word word word word word word.
    \stopstep

  \stopsteps
\stoprecipe
\stopcolumns

\stoptext

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.