4

I would like to get placing both an intial and a figure in a paragraph working. I am using the following MWE in this question:

\mainlanguage[de]
\useMPlibrary[dum]
\setupinitial[n=2]

\starttext
\placefigure[right,none,5*hang]{}{%
  \externalfigure[dummy][width=.25\textwidth]
}

\placeinitial Weit hinten, hinter den Wortbergen, fern der Länder
Vokalien und Konsonantien leben die Blindtexte. Abgeschieden wohnen
sie in {\sl Buchstabhausen} an der Küste des {\sl Semantik,} eines
großen Sprachozeans. Ein kleines Bächlein namens {\sl Duden} fließt
durch ihren Ort und versorgt sie mit den nötigen Regelialien. Es ist
ein paradiesmatisches Land, in dem einem gebratene Satzteile in den
Mund fliegen. Nicht einmal von der allmächtigen Interpunktion werden
die Blindtexte beherrscht – ein geradezu unorthographisches Leben.

Eines Tages aber beschloss eine kleine Zeile Blindtext, ihr Name war
{\sc Lorem Ipsum,} hinauszugehen in die weite Grammatik. Der große
{\sc Oxmox} riet ihr davon ab, da es dort wimmele von bösen Kommata,
wilden Fragezeichen und hinterhältigen Semikoli, doch das
Blindtextchen ließ sich nicht beirren. Es packte seine sieben
Versalien, schob sich sein Initial in den Gürtel und machte sich auf
den Weg. Als es die ersten Hügel des {\it Kursivgebirges} erklommen
hatte, warf es einen letzten Blick zurück auf die Skyline seiner
Heimatstadt {\it Buchstabhausen,} die Headline von {\it Alphabetdorf}
und die Subline seiner eigenen Straße, der Zeilengasse. Wehmütig lief
ihm eine rhetorische Frage über die Wange, dann setzte es seinen Weg
fort.
\stoptext

Let's start simple and look at the initial and the figure separately. With the command placefigure commented out only the figure will be shown. The output looks like this:

Text is wrapping around a figure at the right.

With the command placefigure{ ... } commented out only the initial will be shown. The output looks like this:

An initial starts the first paragraph of this text.

However, as soon as I try to show both the figure and the initial, it looks like this:

Text is wrapping around a figure at the right and an initial starts the first paragraph. However, the initial moved into the margin.

Is there any way to use both an initial and a figure in a paragraph without the initial moving into the margin?

Thanks in advance for your help!

Edit: Add missing \mainlanguage[de] to MWE.

1
  • 2
    Both \placefigure[hang] and \placeinitial use \hangindent/\parshape, so I don't think that it's possible to use both right now. If you report it to the ConTeXt mailing list, one of the developers will probably have a fix for it. Commented May 30 at 7:49

1 Answer 1

4

As Max pointed out in a comment, two mechanisms are competing with each other. I talked to Hans, and he quickly fixed it, so now I get with your example (and \mainlanguage[de]) the following output.

Both initial and figure

I think you can expect the fix to be included in the next update of ConTeXt.

Let us look at a few more examples After testing a bit, it became clear that one has to assume sane usage, but that one can in fact get a bit help with the new keyword paragraph. Let us look at a few more examples. First the code blob and an image of the six pages, then some discussion.

\mainlanguage[de]

\setuppapersize[A5,landscape][A5,landscape]

\useMPlibrary[dum]
\setupinitial[n=2]

\startbuffer
\placeinitial Weit hinten, hinter den Wortbergen, fern der Länder
Vokalien und Konsonantien leben die Blindtexte. Abgeschieden wohnen
sie in {\sl Buchstabhausen} an der Küste des {\sl Semantik,} eines
großen Sprachozeans. Ein kleines Bächlein namens {\sl Duden} fließt
durch ihren Ort und versorgt sie mit den nötigen Regelialien. Es ist
ein paradiesmatisches Land, in dem einem gebratene Satzteile in den
Mund fliegen. Nicht einmal von der allmächtigen Interpunktion werden
die Blindtexte beherrscht – ein geradezu unorthographisches Leben.

Eines Tages aber beschloss eine kleine Zeile Blindtext, ihr Name war
{\sc Lorem Ipsum,} hinauszugehen in die weite Grammatik. Der große
{\sc Oxmox} riet ihr davon ab, da es dort wimmele von bösen Kommata,
wilden Fragezeichen und hinterhältigen Semikoli, doch das
Blindtextchen ließ sich nicht beirren. Es packte seine sieben
Versalien, schob sich sein Initial in den Gürtel und machte sich auf
den Weg. Als es die ersten Hügel des {\it Kursivgebirges} erklommen
hatte, warf es einen letzten Blick zurück auf die Skyline seiner
Heimatstadt {\it Buchstabhausen,} die Headline von {\it Alphabetdorf}
und die Subline seiner eigenen Straße, der Zeilengasse. Wehmütig lief
ihm eine rhetorische Frage über die Wange, dann setzte es seinen Weg
fort.
\stopbuffer

\starttext

\startplacefigure
  [location={right,none,5*hang}]
  \externalfigure[dummy][width=.25\textwidth]
\stopplacefigure

\getbuffer

\page[yes]

\startplacefigure
  [location={left,none,5*hang}]
  \externalfigure[dummy][width=.25\textwidth]
\stopplacefigure

\getbuffer

\page[yes]

\startplacefigure
  [location={left,none,2*hang}]
  \externalfigure[dummy][width=.25\textwidth]
\stopplacefigure

\getbuffer

\page[yes]

\startplacefigure
  [location={left,none}]
  \externalfigure[dummy][width=.25\textwidth]
\stopplacefigure

\getbuffer

\page[yes]

\startplacefigure
  [location={left,none,paragraph}]
  \externalfigure[dummy][width=.25\textwidth]
\stopplacefigure

\getbuffer

\page[yes]

\startplacefigure
  [location={right,none,paragraph}]
  \externalfigure[dummy][width=.25\textwidth]
\stopplacefigure

\getbuffer

\stoptext

more examples

The first page shows the example from the question. The second page shows that it also works if the figure is on the left. The third one shows that it works even if we just hang 2 lines (since the initial by default occupies two lines). In the fourth image we see that if we do not hang then we get a clash. The result would also be bad if we did hang 1 line. The reason is that the hangindent used by the initial and the parshape used by the float did not know of each other. In the fifth float we used the new paragraph key, and then the two mechanisms use parshape and the paragraph shape is recalculated. As is seen in the sixth figure, that also works if the float is on the right side.

It is good if this will be tested when there is a new upload, and if eventual problems are reported on the mailing list.

4
  • Wow ... and many thanks to both of you, that's what I call service! Can I expect the new version in the next few days or does ConTeXt follow a specific release schedule?
    – guemax
    Commented May 30 at 12:20
  • 1
    There is no specific schedule. Hans usually release when there is something new (or some important fix) and when things are stable. He released a few days ago, so maybe it is possible to get a quick new release again. In fact, it would be good if this new possibility could be tested a bit more.
    – mickep
    Commented May 30 at 12:26
  • The fact that there's a second paragraph is evident only because the last line of the first paragraph is short. (Other than that, very nice!) Can that be addressed? (I realize that the original model doesn't have a paragraph indentation.) Commented May 30 at 22:48
  • @barbarabeeton: In the default setup, ConTeXt sets \parindent to 0. That can be enabled via \setupindenting[medium,yes]; which is roughly equal to \parindent=1.5em.
    – Aditya
    Commented May 31 at 6:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .