dictionary example
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
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
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 ___________________________________________________________________________________
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 ___________________________________________________________________________________
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 -----------------------------------------------------------------
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 ___________________________________________________________________________________
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 -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
jbf
-
Wolfgang Schuster