Hello,

I have a few questions.

1. What is the best way to get a symbol from a font you are not using as
your main?

%% start MWE

\starttext

\definesymbol[cedis][\utfchar{“20B5}]
\def\cedis{
  \switchtobodyfont[dejavu]\tf\symbol[cedis]
}

I have GH\cedis 10.00 in my pocket


\stoptext

%% end MWE

I tried to use \getglyph because I saw it being used in a similar way (but
not with unicode characters) like this:
\definesymbol[cedis][\getglyph{dejavu}{\utfchar{"20B5}}]

It didn't work.

2. I would like a more robust method to create a diagram (ie., a series of
input and outputs where you are then required to tell the rule of the
mapping). The inputs will be up with the outputs below and a downward
pointing arrow between them.

%% start MWE

\starttext

\define[2]\xdownarrow{
\startframed[frame=off,offset=0pt,width=0.8cm]
\startMPcode
numeric u, w; u := .3cm; w := 2pt;
pair pointX, pointY; path pointXY;
pointX := origin; pointY := pointX shifted (0,-3u);
draw pointX -- pointY withpen pencircle scaled .6w;
drawarrow pointX -- pointY withpen pencircle scaled .6w;
labeloffset := u;
label.top (textext("\dm{#1}"), pointX);
label.bot (textext("\dm{ #2 }"), pointY);
\stopMPcode
\stopframed
}

\startitemize[n]

\item Find the rule of the mapping:
\startplacefigure[location=none]
\startframed[frame=off,offset=0pt,]
\xdownarrow{x}{y}
\hspace[big]
\xdownarrow{1}{3}
\hspace[big]
\xdownarrow{2}{1}
\hspace[big]
\xdownarrow{3}{-1}
\hspace[big]
\xdownarrow{4}{-3}
\hspace[big]
\xdownarrow{5}{-5}
\stopframed
\stopplacefigure

\startitemize[a]

\item \im{y = 2x + 2}
\item \im{y = -2x + 2}
\item \im{y = 4x}
\item \im{y = -2x + 5}

\stopitemize
\stopitemize

%% stop MWR

How can I achieve this more elegantly with better spacing and the arrow
pointing to the number instead (-) for negative numbers?


Regards,
Jethro
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to