Difference between revisions of "Command/items"

From Wiki
Jump to navigation Jump to search
(add examples from source)
m (edited examples)
 
(One intermediate revision by the same user not shown)
Line 22: Line 22:
 
</cd:description>
 
</cd:description>
 
<cd:examples><cd:example title=""><context source="yes" text="Gives:">
 
<cd:examples><cd:example title=""><context source="yes" text="Gives:">
\items[symbol=8,n=5,width=\hsize,alternative=bottom]{png,eps,pdf,jpg,tif}
+
\setupitems[symbol=8]
 +
 
 +
\items[n=5,width=\hsize,alternative=bottom]{png,eps,pdf,jpg,tif}
  
 
\blank
 
\blank
  
\items[symbol=8,n=3,alternative=left]{Yes,No,I don’t know}
+
\items[n=3,alternative=left]{Yes,No,I don’t know}
</context></cd:example><cd:example title="Examples from the source"><context source="yes">
+
</context></cd:example><cd:example title="Alignment alternatives"><context source="yes">
\items[alternative=left]{a,b,c}
+
\setupitems[symbol=8]
 
 
\items[alternative=left,align=middle,textalign=flushright,distance=1em]{a,b,c}
 
  
\items[alternative=right]{a,b,c}
+
\items[alternative=left]{acorn,bunny,cycle}
  
\items[alternative=inmargin]{a,b,c}
+
\items[alternative=right]{Athens,Berlin,Cairo}
  
\items[alternative=top]{a,b,c}
+
\items[alternative=left,align=middle,textalign=flushright,distance=1em]{Alabama,Bahamas,Cuba}
 +
</context>
 +
</cd:example><cd:example title="Alignment top/bottom"><context source="yes">
 +
\setupitems[symbol=8]
  
\items[alternative=bottom]{a,b,c}
+
\items[alternative=top]{A,B,C}
  
\items[alternative=bottom,align=flushleft,textstyle=bold,color=red,textcolor=green]{a,b,c}
+
\items[alternative=bottom]{X,Y,Z}
 +
</context></cd:example><cd:example title="Symbols in margin"><context source="yes">
 +
\setuppapersize[A10]
 +
\showframe
 +
\starttext
 +
\items[alternative=inmargin]{one,two,three}
 +
\stoptext
 +
</context></cd:example><cd:example title="Styling"><context source="yes">
 +
\items[symbol=8,alternative=bottom,align=flushleft,textstyle=bold,color=red,textcolor=green]{RED,GREEN,BLUE}
 
</context></cd:example></cd:examples>
 
</context></cd:example></cd:examples>
 
<cd:notes></cd:notes>
 
<cd:notes></cd:notes>

Latest revision as of 16:39, 30 October 2023


\items

Summary

The command \items creates a short list of items

Settings

\items[...=...,...]{...}
...=...,...inherits from \setupitems
{...}text

OptionExplanation
text this is a comma-separated list of values

Description

This command gives a list of items with a symbol next to each one (actually the symbol it can be to the left, on top or below each item), meant for questionnaires.

You can also use \startitemize with \ran and \its.


Examples

Example 1

\setupitems[symbol=8]

\items[n=5,width=\hsize,alternative=bottom]{png,eps,pdf,jpg,tif}

\blank

\items[n=3,alternative=left]{Yes,No,I don’t know}

Gives:

Alignment alternatives

\setupitems[symbol=8]

\items[alternative=left]{acorn,bunny,cycle}

\items[alternative=right]{Athens,Berlin,Cairo}

\items[alternative=left,align=middle,textalign=flushright,distance=1em]{Alabama,Bahamas,Cuba}

Alignment top/bottom

\setupitems[symbol=8]

\items[alternative=top]{A,B,C}

\items[alternative=bottom]{X,Y,Z}

Symbols in margin

\setuppapersize[A10]
\showframe
\starttext
\items[alternative=inmargin]{one,two,three}
\stoptext

Styling

\items[symbol=8,alternative=bottom,align=flushleft,textstyle=bold,color=red,textcolor=green]{RED,GREEN,BLUE}

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: