Dropped Capital (Drop Cap) in TeXmacs

Hello all,

Today I found out that there is a thing called drop cap which is used in some conference templates (like IEEE). This can be typeset in LaTeX but I don’t know how to do this in TeXmacs:

1 Like

It’s called small-caps in TeXmacs. It is used for example in the name macro. In the definition you can find how to use it:

<with|font-shape|small-caps| your text here >

Note that there are two IEEE inspired document style under Document -> Style -> Article -> Ieee. The Ieeetrans style uses the small-caps in section titles.

If you want to see how that’s done, select the style, then go to Document->Style->Edit style. There you will find the following:


Thanks! But actually I am referring to the big “W” in the first line. Sorry for the confusion.

Ah yes, of course :slightly_smiling_face: You could drop the capital, but then the next line would either be pushed down or overwritten. To do it as in the example, you would need to wrap the text, which is not yet possible in TeXmacs:

Looking here : https://texblog.org/2011/05/21/drop-caps-with-lettrine/ it seems to me that you have to tell for how many lines one needs a different indent to leave space for the large letter. I guess this could be reproducible in TeXmacs provided we have some access to some low level activity of the typesetter, like when it goes no a new line. Maybe \datom could help here.

1 Like

I read in a place that I cannot find anymore that document formats represented by trees cannot “do that” (it was something in place of “do that”, perhaps “distribute the text in an arbitrary shape” but I do not recall what either). There was then an example with a TeX document that “did that”.

On the other hand I found this conference paper which is maybe interesting: https://eprints.soton.ac.uk/262087/1/p64-dasilva.pdf (Support for Arbitrary Regions in XSL-FO, da Silva et al.)

1 Like

I was not thinking about specific markup for this, one just need to have a hook which is called at every linebreak in the typesetter and which after a certain amount of them change the value of the indent for the current typesetting environment. Of course this is a procedural implementation but for this kind of visual results which do not affect the meaning of the document, I guess it is fine. The tricky part is that it has to act during linebreaking so \datoms is not the right primitive to use (as I previously suggested). Maybe one need to modify the C++ code to support such hooks. I should give a look to see if there is some possibilities right now. If one really need it it is always possible to locally change the indent with a \with tag for few lines, but this has to be adjusted manually.

I think this is really relevant to text wrapping (Can you wrap text around an image?), which is also an important functionality TeXmacs does not have (Maybe one can cope with using a table somehow…

In principle yes, but certainly drop caps are easier to code than a general text wrapping facility, I guess. Probably Joris didn’t considered it at the beginning because it would complexify the typesetting making it too slow for interactive editing, but with modern computers this should not be a real problem. It is also true that most scientific document do not need complex wrapping, and that this would anyway not be really portable across formats (i.e. conversion to LaTeX or to HTML).

You are indeed right that most scientific documents don’t need wrapping. A counterexample where I would find wrapped figures very useful is in documents with strong space limitation, such as project proposals.

Another use case that I think is currently not possible due to the global nature of page formats is having a mix of different page layouts in one document. Think for example of articles with very large tables, where one page is landscape orientation.

I’m not sure what an implementation would look like. We’d need an array of page formats instead of one global height and width variable. Then we’d need a way to render these “minipages” next to and on top of each other.

Did anyone found a workaround for dropped capitals?

Nope, I am thinking about making a float or something but didn’t try.