ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* dictionary example
@ 2021-06-12 10:39 jbf
  2021-06-12 13:25 ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: jbf @ 2021-06-12 10:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1501 bytes --]

I am wondering if someone has tried a two-column dictionary layout with 
ConTeXt. What is confounding me at the moment is the gap between entries 
in the columns. My MWE is below. Try as I may, I seem unable to get rid 
of those gaps! I obviously want each entry to follow on from the other. 
I'm obviously not doing things right! If someone has already set up a 
dictionary and has a model they could share I'd be grateful. I'm 
attaching a screenshot of the result from the code below.

Julian

----------

\setuphead[subsubject][before=,after=]

\definemarking[subsubject]
\setupheadertexts
[{\getmarking[subsubject][top]–\getmarking[subsubject][bottom]}][][{\getmarking[subsubject][top]–\getmarking[subsubject][bottom]}][]

\setupcolumns[n=2,align=raggedright,balance=no,tolerance={verytolerant,stretch}]
\definedescription[des][headstyle=bold,style=normal,alternative=serried, 
width=fit]
\starttext

\startsubject[title={A}]
\startsubsubject[marking={Term 1}]
\startcolumns
\startdes{term 1}1. bla. 2. bla bla 3. bla bla bla. {\em adjective}. 
\textbullet\hskip 2pt
\input weisman
\rightarrow {\bf something else}.
\stopdes
\stopsubsubject

\startsubsubject[marking={Term 2}]
\startdes{term 2}1. bla. 2. bla bla 3. bla bla bla. {\em noun} 
\textbullet\hskip 2pt \input weisman
\stopdes
\stopsubsubject

\startsubsubject[marking={Term 3}]
\startdes{term 3}1. bla. 2. bla bla 3. bla bla bla. {\em noun} 
\textbullet\hskip 2pt \input weisman
\stopdes
\stopcolumns
\stopsubsubject
\stopsubject


[-- Attachment #2: Screenshot from 2021-06-12 20-36-08.png --]
[-- Type: image/png, Size: 28651 bytes --]

[-- Attachment #3: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: dictionary example
  2021-06-12 10:39 dictionary example jbf
@ 2021-06-12 13:25 ` Wolfgang Schuster
  2021-06-12 22:49   ` jbf
  2021-06-12 23:52   ` jbf
  0 siblings, 2 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2021-06-12 13:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

jbf schrieb am 12.06.2021 um 12:39:
> I am wondering if someone has tried a two-column dictionary layout 
> with ConTeXt. What is confounding me at the moment is the gap between 
> entries in the columns. My MWE is below. Try as I may, I seem unable 
> to get rid of those gaps! I obviously want each entry to follow on 
> from the other. I'm obviously not doing things right! If someone has 
> already set up a dictionary and has a model they could share I'd be 
> grateful. I'm attaching a screenshot of the result from the code below.

The gaps between the entries are the subsubject titles where you omit 
the title. Omitting the title for a heading doesn't mean no space is 
inserted, to change this you can use the 'placehead=hidden' setting but 
I guess your goal is to add a mark entry for each description.

Wolfgang

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: dictionary example
  2021-06-12 13:25 ` Wolfgang Schuster
@ 2021-06-12 22:49   ` jbf
  2021-06-12 23:52   ` jbf
  1 sibling, 0 replies; 7+ messages in thread
From: jbf @ 2021-06-12 22:49 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users

Indeed, Wolfgang, the whole idea is to use whatever head (I chose 
subsubject, but am not tied to that) to be able to get headers which 
show me the first and last item on each page, as dictionaries usually 
do. So my next question would be... is there another way I can get a 
mark entry of this kind without using heads that automatically have 
spaces before and after (which is what I tried to get rid of with my 
before=, after= keys). Could I, for example, use \getmarking with 
specifically designed paragraphs?

BTW, I can do exactly what I need to do in LaTeX (have already produced 
a working model), but I want to be able to do it in ConTeXt. Maybe the 
approach I've taken thus far is the completely wrong one, which I why I 
was wondering if someone has already produced a standard dictionary 
format with ConTeXt.

Julian

On 12/6/21 11:25 pm, Wolfgang Schuster wrote:
> jbf schrieb am 12.06.2021 um 12:39:
>> I am wondering if someone has tried a two-column dictionary layout 
>> with ConTeXt. What is confounding me at the moment is the gap between 
>> entries in the columns. My MWE is below. Try as I may, I seem unable 
>> to get rid of those gaps! I obviously want each entry to follow on 
>> from the other. I'm obviously not doing things right! If someone has 
>> already set up a dictionary and has a model they could share I'd be 
>> grateful. I'm attaching a screenshot of the result from the code below.
>
> The gaps between the entries are the subsubject titles where you omit 
> the title. Omitting the title for a heading doesn't mean no space is 
> inserted, to change this you can use the 'placehead=hidden' setting 
> but I guess your goal is to add a mark entry for each description.
>
> Wolfgang
>
> ___________________________________________________________________________________ 
>
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________ 
>
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: dictionary example
  2021-06-12 13:25 ` Wolfgang Schuster
  2021-06-12 22:49   ` jbf
@ 2021-06-12 23:52   ` jbf
  2021-06-13  7:48     ` Hans Hagen
  1 sibling, 1 reply; 7+ messages in thread
From: jbf @ 2021-06-12 23:52 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users

Assuming that the default space before and after a head (e.g. 
subsubject) is something like \blank[2*big], if there is a way I can 
change that default behaviour just for that particular head, then I can 
solve my problem. Is there such a possibility?

Julian

On 12/6/21 11:25 pm, Wolfgang Schuster wrote:
> jbf schrieb am 12.06.2021 um 12:39:
>> I am wondering if someone has tried a two-column dictionary layout 
>> with ConTeXt. What is confounding me at the moment is the gap between 
>> entries in the columns. My MWE is below. Try as I may, I seem unable 
>> to get rid of those gaps! I obviously want each entry to follow on 
>> from the other. I'm obviously not doing things right! If someone has 
>> already set up a dictionary and has a model they could share I'd be 
>> grateful. I'm attaching a screenshot of the result from the code below.
>
> The gaps between the entries are the subsubject titles where you omit 
> the title. Omitting the title for a heading doesn't mean no space is 
> inserted, to change this you can use the 'placehead=hidden' setting 
> but I guess your goal is to add a mark entry for each description.
>
> Wolfgang
>
> ___________________________________________________________________________________ 
>
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________ 
>
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: dictionary example
  2021-06-12 23:52   ` jbf
@ 2021-06-13  7:48     ` Hans Hagen
  2021-06-13  9:09       ` jbf
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2021-06-13  7:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 6/13/2021 1:52 AM, jbf wrote:
> Assuming that the default space before and after a head (e.g. 
> subsubject) is something like \blank[2*big], if there is a way I can 
> change that default behaviour just for that particular head, then I can 
> solve my problem. Is there such a possibility?
\definehead[mysubject][subject]

and then set up mysubject differently

\startmysubject[title={....}]  etc

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: dictionary example
  2021-06-13  7:48     ` Hans Hagen
@ 2021-06-13  9:09       ` jbf
  2021-06-13  9:33         ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: jbf @ 2021-06-13  9:09 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

I worked out a solution - not quite what you are suggesting, but it 
works perfectly, and I can get ahead with the dictionary.

1st, I defined a paragraph based on subsubject. This enabled me to do 
away with the description I was using earlier and greatly simplifies 
each dictionary entry:

\definehead[entry][subsubject]
\setuphead [entry]
            [
              number=no,
              textdistance=3pt,
              alternative=text,
              align=raggedright,
              style=\bf,
              before={\vskip 0.5\lineheight}
           ]

2nd, note the before={\vskip 0.5\lineheight}. A bit of a hack one has to 
admit, but it solves the problem of reducing the gap between each entry.

All good.

Julian

On 13/6/21 5:48 pm, Hans Hagen wrote:
> On 6/13/2021 1:52 AM, jbf wrote:
>> Assuming that the default space before and after a head (e.g. 
>> subsubject) is something like \blank[2*big], if there is a way I can 
>> change that default behaviour just for that particular head, then I 
>> can solve my problem. Is there such a possibility?
> \definehead[mysubject][subject]
>
> and then set up mysubject differently
>
> \startmysubject[title={....}]  etc
>
> Hans
>
>
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------
> ___________________________________________________________________________________ 
>
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________ 
>
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: dictionary example
  2021-06-13  9:09       ` jbf
@ 2021-06-13  9:33         ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2021-06-13  9:33 UTC (permalink / raw)
  To: jbf; +Cc: mailing list for ConTeXt users

On 6/13/2021 11:09 AM, jbf wrote:
> I worked out a solution - not quite what you are suggesting, but it 
> works perfectly, and I can get ahead with the dictionary.
> 
> 1st, I defined a paragraph based on subsubject. This enabled me to do 
> away with the description I was using earlier and greatly simplifies 
> each dictionary entry:
> 
> \definehead[entry][subsubject]
> \setuphead [entry]
>             [
>               number=no,
>               textdistance=3pt,
>               alternative=text,
>               align=raggedright,
>               style=\bf,
>               before={\vskip 0.5\lineheight}
>            ]
> 
> 2nd, note the before={\vskip 0.5\lineheight}. A bit of a hack one has to 
> admit, but it solves the problem of reducing the gap between each entry.

Instead of using \vskip try to use blank because that also handles 
whitespace and unwanted breaks.

\starttext

\showmakeup[line,glue]

\strut test

\blank[line]

\strut test

\blank[line]
\blank[back,halfline]

\strut test

\blank[back,halfline]

\strut test

\stoptext

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-06-13  9:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-12 10:39 dictionary example jbf
2021-06-12 13:25 ` Wolfgang Schuster
2021-06-12 22:49   ` jbf
2021-06-12 23:52   ` jbf
2021-06-13  7:48     ` Hans Hagen
2021-06-13  9:09       ` jbf
2021-06-13  9:33         ` Hans Hagen

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).