ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \defineparagraphs
@ 2016-07-08 11:53 kitz
  2016-07-08 13:20 ` \defineparagraphs Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: kitz @ 2016-07-08 11:53 UTC (permalink / raw)
  To: ntg-context

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

The code below works with context2016.02.15, but fails with context2016.05.19.

Itemize within the defined paragraph (Mypar) no longer puts the thinrule in the margin (see the third question.) The \ansblank command seems to the second part of Mypar is 
the margin?  Pdf of the success and fail attached.

Thanks! John


\defineparagraphs[Mypar][n=2]
 \setupparagraphs[Mypar][1][width=0.5\textwidth] 

% label subquestions (a, b, c, etc) with answerblanks
\defineconversionset[myitemize][n,a][n]

% define the answerblank in right margin
\define\ansblank
  {\inright{\simplealignedbox{2em}{flushleft}{\convertedcounter[itemgroup:itemize][numberconversionset=myitemize,numberstopper=.]}\thinrule}\ignorespaces}

% \define\noblank
\define\noblank
  {\inright{~}}

% put them together to toggle printing of the answerblank
\define\blankon{\setupitemgroup [itemize] [style=bold,command=\ansblank]}
\define\blankoff{\setupitemgroup [itemize] [style=bold,command=\noblank]}

\starttext
\showframe
\startitemize[n]
\blankon
\item First question.
\blankoff
\item Second question has two parts.
  \startitemize[a]
  \blankon
  \item subquestion a
  \item subquestion b
  \stopitemize
\blankon
\startMypar
\item Third question refers to graphic at right. 
\Mypar
<A graphic/MPcode goes herer>
\stopMypar
\item Final question.
\stopitemize
\stoptext






[-- Attachment #2: mwe2016.02.15.pdf --]
[-- Type: application/octet-stream, Size: 10323 bytes --]

[-- Attachment #3: mwe2016.05.19.pdf --]
[-- Type: application/octet-stream, Size: 10415 bytes --]

[-- Attachment #4: 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
___________________________________________________________________________________

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

* Re: \defineparagraphs
  2016-07-08 11:53 \defineparagraphs kitz
@ 2016-07-08 13:20 ` Wolfgang Schuster
  2016-07-09 12:48   ` \defineparagraphs John Kitzmiller
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2016-07-08 13:20 UTC (permalink / raw)
  To: kitz, mailing list for ConTeXt users


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

> kitz@inradius.net <mailto:kitz@inradius.net>
> 8. Juli 2016 um 13:53
> The code below works with context2016.02.15, but fails with 
> context2016.05.19.
>
> Itemize within the defined paragraph (Mypar) no longer puts the 
> thinrule in the margin (see the third question.) The \ansblank command 
> seems to the second part of Mypar is
> the margin? Pdf of the success and fail attached.
>
> Thanks! John
>
> \startMypar
> \item Third question refers to graphic at right.
> \Mypar
> <A graphic/MPcode goes herer>
> \stopMypar
\item
     \startcombination[nx=2,ny=1]
         
{\framed[frame=off,align=flushleft,location=top,width=.5\localhsize]{Third 
question refers to graphic at right.}}{}
         {\tbox{\externalfigure[cow]}}{}
     \stopcombination

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 1814 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
___________________________________________________________________________________

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

* Re: \defineparagraphs
  2016-07-08 13:20 ` \defineparagraphs Wolfgang Schuster
@ 2016-07-09 12:48   ` John Kitzmiller
  2016-07-09 15:10     ` \defineparagraphs Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: John Kitzmiller @ 2016-07-09 12:48 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: ntg-context@ntg.nl ConTeXt users


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


> On 8Jul, 2016, at 09:20, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:
> 
>> The code below works with context2016.02.15, but fails with context2016.05.19.
>> 
>> Itemize within the defined paragraph (Mypar) no longer puts the thinrule in the margin (see the third question.) The \ansblank command seems to the second part of Mypar is 
>> the margin? Pdf of the success and fail attached.
>> 
>> Thanks! John
>> 
>> \startMypar
>> \item Third question refers to graphic at right. 
>> \Mypar
>> <A graphic/MPcode goes herer>
>> \stopMypar
> \item
>     \startcombination[nx=2,ny=1]
>         {\framed[frame=off,align=flushleft,location=top,width=.5\localhsize]{Third question refers to graphic at right.}}{}
>         {\tbox{\externalfigure[cow]}}{}
>     \stopcombination

Thank you Wolfgang. I had to change .5\localhsize to .5\textwidth for it to work here (and scale down the cow to make it fit in the barn.)

I am looking into combinations to center the graphic in the second x box, and make a \setupcombination[mycombination] similar to \defineparagraph[Mypar] to reduce typing.

\tbox is new to me. Is that a ConTeXt macro of TEX \vtop{\hbox}?

Thanks again, John

[-- Attachment #1.2: Type: text/html, Size: 6647 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
___________________________________________________________________________________

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

* Re: \defineparagraphs
  2016-07-09 12:48   ` \defineparagraphs John Kitzmiller
@ 2016-07-09 15:10     ` Wolfgang Schuster
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Schuster @ 2016-07-09 15:10 UTC (permalink / raw)
  To: John Kitzmiller; +Cc: mailing list for ConTeXt users


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

> John Kitzmiller <mailto:kitz@inradius.net>
> 9. Juli 2016 um 14:48
>
>
> Thank you Wolfgang. I had to change .5\localhsize to .5\textwidth for 
> it to work here (and scale down the cow to make it fit in the barn.)
>
> I am looking into combinations to center the graphic in the second x 
> box, and make a \setupcombination[mycombination] similar to 
> \defineparagraph[Mypar] to reduce typing.
\definecombination[john][nx=2,ny=1,width=.5\textwidth]

\startcombination[john]
     {...}{}
     {...}{}
\stopcombination
> \tbox is new to me. Is that a ConTeXt macro of TEX \vtop{\hbox}?
The command changes the vertical position of the content (by putting it 
into an \hbox and changing the height/depth values).

\setupblackrules[width=2cm,height=2cm]

\setuplayout[grid=yes]\showgrid

\starttext
XXX      {\blackrule}
XXX \tbox{\blackrule}
XXX \bbox{\blackrule}
XXX
\stoptext

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 2401 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
___________________________________________________________________________________

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

end of thread, other threads:[~2016-07-09 15:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-08 11:53 \defineparagraphs kitz
2016-07-08 13:20 ` \defineparagraphs Wolfgang Schuster
2016-07-09 12:48   ` \defineparagraphs John Kitzmiller
2016-07-09 15:10     ` \defineparagraphs Wolfgang Schuster

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