ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: luigi scarso <luigi.scarso@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Overlapping terms in description lists
Date: Thu, 21 Apr 2016 13:18:00 +0200	[thread overview]
Message-ID: <CAG5iGsDtSSF6dyhKRHbGVyySMuFXv+kdP+n1sK_jnFjd2vR39Q@mail.gmail.com> (raw)
In-Reply-To: <571760CF.3000708@ird.fr>


[-- Attachment #1.1: Type: text/plain, Size: 2061 bytes --]

On Wed, Apr 20, 2016 at 12:58 PM, Tom Harrop <thomas.harrop@ird.fr> wrote:

> Hello again,
>
> The document I'm typsetting uses description lists. To keep the list
> entries close together I'm using before=\nowhitespace and
> after=\nowhitespace in \definedescription. This is fine so long as the term
> is short, but when the term wraps to two lines it can overlap with the term
> below.
>
> Here's an example:
>
> \setuppapersize[A5]
>> \setupalign[flushleft, nothyphenated]
>>
>> \definedescription[description]
>>     [before=\nowhitespace, after=\nowhitespace]
>>
>> \starttext
>>
>> \startdescription{Short term:}
>>   Items with short terms are fine.
>> \stopdescription
>>
>> \startdescription{This is a really long term:}
>>   Long term + short definition
>> \stopdescription
>>
>> \startdescription{This is a really long term:}
>>   ... the long term of the item above the mashes into the term below.
>> \stopdescription
>>
>> \stoptext
>>
>
> And here is an attempt at a plain text representation of what I'm trying
> to achieve:
>
> Short term:         Items with short terms are fine.
>> This is a really
>> long term:          Long term + short definition
>> This is a really
>> long term:          ... the long term of the item above the mashes into
>> the
>>                     term below.
>>
>
> Is this possible using \definedescription? I tried some combinations of
> \vfill and \framed but I couldn't get it to work.
>
> Sorry to repeatedly post newbie questions. Any tips would be appreciated!
>

the title is in  a \vtop and not a \vbox, and its height is fixed to
\strutht (and the depth to \strutdp)
so basically the title is one line.

You can try with hand-tuning, ie

\definedescription[description][before=\nowhitespace,
after=\vskip0.25em,width=7\emwidth]
\starttext
\startdescription[title=This is a really long term:]
\crlf
  Long term + short definition
\stopdescription

\startdescription[title=This is a really long term:]
\crlf
  ... the long term of the item above the mashes into the term below.
\stopdescription
\stoptext

[-- Attachment #1.2: Type: text/html, Size: 3154 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2016-04-21 11:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-20 10:58 Tom Harrop
2016-04-21 11:18 ` luigi scarso [this message]
2016-04-23 14:15   ` Tom Harrop

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAG5iGsDtSSF6dyhKRHbGVyySMuFXv+kdP+n1sK_jnFjd2vR39Q@mail.gmail.com \
    --to=luigi.scarso@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).