7

I want to have inline paragraph titles in ConTeXt with a mark and spacing:

This is my paragraph @ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

The @ above should be a symbol (diamond or bullet) and I need 2em spacing before and after it. Paragraph title style should be smallcaps.

I was attempting to do it with \setuphead without success, as I can not disable the newline after the title. I also don't like inheriting subsubsubject. I would prefer to add it one level below subsubsubject despite I don't want paragraph titles in the TOC.

\definehead[bekezdes][subsubsubject]
\setuphead[bekezdes][
  after=\quad\bullet\quad,
  style=\sc
]

The above code produces the following title:

enter image description here

I would very appreciate a solution. Thanks in advance!

1
  • 1
    Add alternative=text to get rid of the newline after the section title. Regarding TOC, can you create a MWE to show how you are invoking the TOC.
    – Aditya
    Commented Jun 20, 2017 at 15:20

2 Answers 2

8

Simply set alternative=text to get the correct spacing. With altenative=text, before and after keys are ignored. Instead you can use commandafter to set the bullet after the section title. By default, ConTeXt inserts a skip of textdistance after the section head, so I set it to 0pt. Here is the complete example:

\definehead[paragraph][subsubsubsection]
\setuphead [paragraph]
           [
             number=no, % To imitate LaTeX
             textdistance=0pt,
             commandafter={\quad\bullet\quad\null},
             alternative=text,
             style=sc,
          ]

\starttext
\startparagraph[title=Knuth quote]
  \input knuth
\stopparagraph
\stoptext

which gives

enter image description here

2
  • Note that there is more space after the bullet. Without a fix, Henri's answer does this better. I tried to adjust head and indentation settings to fix this without success yet. Still, I would happily accept this one as it is based on the headings which seems more transparent to me. Not that it only affects \startparagraph and not \paragraph{}. Commented Jun 28, 2017 at 10:31
  • @SzieberthAdam: There appears to be a regular space after the head title (and I couldn't figure out a way to signal that the space should not be inserted). You can get rid of that by using textdistance=-\currentspaceskip (I think, I did not measure the resulting output).
    – Aditya
    Commented Jun 28, 2017 at 13:30
4

As an alternative approach you could define an enumeration.

\defineenumeration
  [paragraph]
  [
    text=,
    number=no,
    title=yes,
    titlestyle=sc,
    titledistance=0pt,
    titleleft=,
    titleright={\quad\bullet},
    distance=1em,
    alternative=serried,
  ]

\starttext

\startparagraph{Knuth quote}
  \input knuth
\stopparagraph

\stoptext

enter image description here

1
  • 1
    For the sake of consistency, I prefer to use \startparagraoh[title=..] which also works with descriptions and enumerations... and why not use a description environment instead or enumeration?
    – Aditya
    Commented Jun 22, 2017 at 16:53

You must log in to answer this question.

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