ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: right item marks for associative questions?
@ 2022-04-15  8:54 Damien Thiriet via ntg-context
  2022-04-15 12:52 ` śrīrāma via ntg-context
  0 siblings, 1 reply; 8+ messages in thread
From: Damien Thiriet via ntg-context @ 2022-04-15  8:54 UTC (permalink / raw)
  To: ntg-context; +Cc: Damien Thiriet

> You can use different alignment settings to move the bullet points to
> the right side of your lists.

Thank you Wolfgang, this is exactly what I need.
One more question: I am typesetting those questions in lua,
because lua vectors were more convenient for reading the whole 
but I am not sure how should I pass the righttoleft option.
I read the cld manual and my guess is I should use function() 
but looks like I lack some understanding of context proceeding.


This is what I did so far


\startluacode 
   userdata = userdata or {}
   function ListeAleatoireGauche(t)
      context.startitemize {"8","packed","random"}
         for k=1,#t do
            context.startitem()
               context.lefttoright(t[k])
            context.stopitem()
         end
      context.stopitemize()
   end
   function ListeAleatoireDroite(t)
      context.startitemize {"8","packed","random"}
         for k=1,#t do
            context.startitem()
               context(t[k])
            context.stopitem()
         end
      context.stopitemize()
   end

   function QCMAssociatif(t,u)
      context.startxtable {"frame=no","columndistance=3cm"}
         context.startxrow()
            context.startxcell()
               ListeAleatoireGauche(t)
            context.stopxcell()
            context.startxcell()
               ListeAleatoireDroite(u)
            context.stopxcell()
         context.stopxrow()
      context.stopxtable()
   end
\stopluacode
\starttext
\startluacode 
Author = {"Nietzsche","God"}
Quote = {"God is dead","Nietzsche is Dead"}
QCMAssociatif (Author,Quote)
\stoptext


Damien Thiriet 
___________________________________________________________________________________
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] 8+ messages in thread

* Re: right item marks for associative questions?
  2022-04-15  8:54 right item marks for associative questions? Damien Thiriet via ntg-context
@ 2022-04-15 12:52 ` śrīrāma via ntg-context
  0 siblings, 0 replies; 8+ messages in thread
From: śrīrāma via ntg-context @ 2022-04-15 12:52 UTC (permalink / raw)
  To: ntg-context, Damien Thiriet; +Cc: śrīrāma

On 4/15/22 2:24 PM Damien Thiriet via ntg-context wrote:
> I read the cld manual and my guess is I should use function() 
> but looks like I lack some understanding of context proceeding.
> 
> 
> This is what I did so far
> [...]

In function 'ListeAleatoireGauche' calling startitemize as below should help:
  context.startitemize ({"8","packed","random"}, {align="righttoleft"})

Further, I think you might also need to put the entry into stream in a group:
  context.start() context.lefttoright(t[k]) context.stop()

  Sreeram


___________________________________________________________________________________
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] 8+ messages in thread

* Re: right item marks for associative questions?
  2022-04-12 18:46 Damien Thiriet via ntg-context
@ 2022-04-12 19:58 ` Wolfgang Schuster via ntg-context
  0 siblings, 0 replies; 8+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2022-04-12 19:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Damien Thiriet via ntg-context
  Cc: Wolfgang Schuster, Damien Thiriet

Damien Thiriet via ntg-context schrieb am 12.04.2022 um 20:46:
> Thank you for all your answers.
> I will have a deeper look at them.
> My first comments:
>
>> If you are certain that the there will be no
>> multi-line item
> Unfortunately there are often some. History
> teachers are not known for loving short texts,
> at least in France.
>
>> Using the “columns" feature is one way to go
> Might be, but I do not always give the same
> number of answers on both columns
>
> Something I forgot to put in my MWE is that I
> randomize both lists. Messing the answers is a
> good way to prevent pupils from cheating,
> especially with long answers..
> That makes a four columns table more cumbersome,
> so I believe.

You can use different alignment settings to move the bullet points to 
the right side of your lists.

\starttext

\bTABLE[frame=off,width=.4\textwidth,columndistance=.2\textwidth,align={normal,lohi}]
   \bTR
     \bTD
       \startitemize[circle,random][align=righttoleft]
       \startitem {\lefttoright One} \stopitem
       \startitem {\lefttoright Two} \stopitem
       \startitem {\lefttoright Three} \stopitem
       \stopitemize
     \eTD
     \bTD
       \startitemize[circle,random]
       \startitem First \stopitem
       \startitem Second \stopitem
       \startitem Third \stopitem
       \startitem Foruth \stopitem
       \stopitemize
     \eTD
   \eTR
\eTABLE

\stoptext

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] 8+ messages in thread

* Re: right item marks for associative questions?
@ 2022-04-12 18:46 Damien Thiriet via ntg-context
  2022-04-12 19:58 ` Wolfgang Schuster via ntg-context
  0 siblings, 1 reply; 8+ messages in thread
From: Damien Thiriet via ntg-context @ 2022-04-12 18:46 UTC (permalink / raw)
  To: ntg-context; +Cc: Damien Thiriet

Thank you for all your answers.
I will have a deeper look at them. 
My first comments:

> If you are certain that the there will be no
> multi-line item
Unfortunately there are often some. History
teachers are not known for loving short texts,
at least in France.

> Using the “columns" feature is one way to go
Might be, but I do not always give the same
number of answers on both columns

Something I forgot to put in my MWE is that I 
randomize both lists. Messing the answers is a 
good way to prevent pupils from cheating, 
especially with long answers..
That makes a four columns table more cumbersome,
so I believe.

Damien

___________________________________________________________________________________
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] 8+ messages in thread

* Re: right item marks for associative questions?
  2022-04-11 18:46 Damien Thiriet via ntg-context
  2022-04-11 20:18 ` Pablo Rodriguez via ntg-context
  2022-04-11 22:04 ` Jeong Dal via ntg-context
@ 2022-04-12  5:48 ` śrīrāma via ntg-context
  2 siblings, 0 replies; 8+ messages in thread
From: śrīrāma via ntg-context @ 2022-04-12  5:48 UTC (permalink / raw)
  To: ntg-context, Damien Thiriet; +Cc: śrīrāma

On 4/12/22 12:16 AM Damien Thiriet via ntg-context wrote:
> Hi!
> 
> I am used to giving associative questions to my pupils,
> something like
> 
> * connect the author with its ideas
> 
> Friedrich Nietzsche *      * "God is dead"
> Woody Allen *              * "Nietzsche is dead, God is dead 
>                               and I don't feel so good"
> God *                      * "Nietzsche is dead"
> 
> I design it as a two-cells xtable with itemized lists inside.
> How can I have the item mark on the right side?

If you are certain that the there will be no multi-line item (i.e. item text is short enough that it fits in slightly less than half of textwidth) you can use an enumeration, and put the contents inside a two-column layout:

%%% start example-1
  \define[1]\aitemcmd{\inframed[width=1cm,align=flushright,frame=off]{(#1)}}
  \defineenumeration
    [aitem]
  \setupenumeration
    [aitem]
    [text=,
    alternative=empty,
    headstyle=normal,
    width=fit,
    align=flushright,
    closesymbol={\getnumber[aitem]},
    closecommand=\aitemcmd]

  \starttext
  \startcolumns[distance=1cm]
  \startitemize[n]
  \dorecurse{5}{
    \startaitem
      whatever left
    \stopaitem
  }
  \stopitemize

  \startitemize[a][left=(,right=),stopper=,width=1cm]
  \dorecurse{5}{
    \startitem
      whatever right
    \stopitem
  }
  \stopitemize
  \stopcolumns
  \stoptext
%%% stop example-1

[You can tweak the alternative, align, closesymbol, closecommand to get exactly what you want; the example above will give a somewhat symmetric layout]

More generally, if the text can multi-line, then I think TABLE (with proper alignment options) might be better-suited:

%%% start example-2
  \define\startItemize{
    \bTABLE\setupTABLE[frame=on,align=lohi]
    \setupTABLE[2][distance=1cm,align={flushright,lohi}]
    \setupTABLE[2,3][width=0.05\textwidth]
    \setupTABLE[1][align=flushright,width=0.4\textwidth]
    \setupTABLE[4][align=flushleft,width=0.4\textwidth]
  }
  \define\stopItemize{\eTABLE}
  \define[1]\metI{\bTR \bTD #1 \eTD \bTD (\character{\currentTABLErow}) \eTD}
  \define[1]\Item{\bTD (\currentTABLErow) \eTD \bTD #1 \eTD  \eTR}

  \starttext
  \startItemize
  \dorecurse{5}{
  \metI {whatever here on the left}
  \Item {whatever here on the right}
  }
  \stopItemize
  \stoptext
%%% stop example-2

Best,
  Sreeram


___________________________________________________________________________________
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] 8+ messages in thread

* Re: right item marks for associative questions?
  2022-04-11 18:46 Damien Thiriet via ntg-context
  2022-04-11 20:18 ` Pablo Rodriguez via ntg-context
@ 2022-04-11 22:04 ` Jeong Dal via ntg-context
  2022-04-12  5:48 ` śrīrāma via ntg-context
  2 siblings, 0 replies; 8+ messages in thread
From: Jeong Dal via ntg-context @ 2022-04-11 22:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Jeong Dal, Dal Jeong


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

Dear Damien,

Using the “columns" feature is one way to go if you don’t mind the vertical alignment mismatch  in the third items.

Best regards,
Dalyoung

\starttext
\startitemize [8,columns]%,two]
\startitem Nietzsche \stopitem
\startitem Woody Allen \stopitem
\startitem God \stopitem
\startitem God is dead \stopitem
\startitem Nietzsche is dead, God is dead and I don't feel so good \stopitem
\startitem Nietzsche is dead \stopitem
\stopitemize
\stoptext




> 2022. 4. 12. 오전 3:46, Damien Thiriet via ntg-context <ntg-context@ntg.nl> 작성:
> 
> Hi!
> 
> I am used to giving associative questions to my pupils,
> something like
> 
> * connect the author with its ideas
> 
> Friedrich Nietzsche *      * "God is dead"
> Woody Allen *              * "Nietzsche is dead, God is dead 
>                              and I don't feel so good"
> God *                      * "Nietzsche is dead"
> 
> I design it as a two-cells xtable with itemized lists inside.
> How can I have the item mark on the right side?
> 
> \starttext
> \startitemize [8]
> \startitem Nietzsche \stopitem
> \startitem Allen \stopitem
> \startitem God \stopitem
> \stopitemize
> \stoptext
> 
> Greetings,
> 
> Damien Thiriet 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________


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

[-- Attachment #2: 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] 8+ messages in thread

* Re: right item marks for associative questions?
  2022-04-11 18:46 Damien Thiriet via ntg-context
@ 2022-04-11 20:18 ` Pablo Rodriguez via ntg-context
  2022-04-11 22:04 ` Jeong Dal via ntg-context
  2022-04-12  5:48 ` śrīrāma via ntg-context
  2 siblings, 0 replies; 8+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2022-04-11 20:18 UTC (permalink / raw)
  To: Damien Thiriet via ntg-context; +Cc: Pablo Rodriguez

On 4/11/22 20:46, Damien Thiriet via ntg-context wrote:
> [...]
> I design it as a two-cells xtable with itemized lists inside.
> How can I have the item mark on the right side?

Hi Damien,

I’m not sure I get your point, but this may be helpful:

 \startitem \inrightmargin{\currentitemnumber} Nietzsche\stopitem

Just in case it might give you some inspiration.

Cheers,

Pablo
___________________________________________________________________________________
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] 8+ messages in thread

* right item marks for associative questions?
@ 2022-04-11 18:46 Damien Thiriet via ntg-context
  2022-04-11 20:18 ` Pablo Rodriguez via ntg-context
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Damien Thiriet via ntg-context @ 2022-04-11 18:46 UTC (permalink / raw)
  To: ntg-context; +Cc: Damien Thiriet

Hi!

I am used to giving associative questions to my pupils,
something like

* connect the author with its ideas

Friedrich Nietzsche *      * "God is dead"
Woody Allen *              * "Nietzsche is dead, God is dead 
                              and I don't feel so good"
God *                      * "Nietzsche is dead"

I design it as a two-cells xtable with itemized lists inside.
How can I have the item mark on the right side?

\starttext
\startitemize [8]
\startitem Nietzsche \stopitem
\startitem Allen \stopitem
\startitem God \stopitem
\stopitemize
\stoptext

Greetings,

Damien Thiriet 
___________________________________________________________________________________
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] 8+ messages in thread

end of thread, other threads:[~2022-04-15 12:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-15  8:54 right item marks for associative questions? Damien Thiriet via ntg-context
2022-04-15 12:52 ` śrīrāma via ntg-context
  -- strict thread matches above, loose matches on Subject: below --
2022-04-12 18:46 Damien Thiriet via ntg-context
2022-04-12 19:58 ` Wolfgang Schuster via ntg-context
2022-04-11 18:46 Damien Thiriet via ntg-context
2022-04-11 20:18 ` Pablo Rodriguez via ntg-context
2022-04-11 22:04 ` Jeong Dal via ntg-context
2022-04-12  5:48 ` śrīrāma via ntg-context

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