Dear All, I only very recently updated from ConTeXt ver: 2005.01.31 to ConTeXt ver: 2009.08.19 17:10 MKII Previously, using env-assign.tex as described in a 2006 PracTeX article worked fine. With the new version the drop shadow box is not rendered. This is the version of env-assign.tex I use: \startenvironment env-assign %D This is the environment file to prepare homework assignments in \CONTEXT. %D See accompanying Prac\TEX\ article for an introduction on how to use it. %D I use US letter paper and resonable margins. \setuppapersize[letter][letter] \setuplayout[ width=middle, height=middle, location=middle, topspace=1in, bottomspace=1in, backspace=1in, cutspace=1in, leftmargin=0in, rightmargin=0in, leftmargindistance=0in, rightmargindistance=0in, header=0.5in, footer=0.5in, headerdistace=0in, footerdistance=0in ] \setupwhitespace [small] \setupblank [medium] %\startMPenvironment[global] %\definetypeface % [MyFace] [rm] [serif] [palatino] [default] [encoding=ec] %\definetypeface % [MyFace] [tt] [mono] [modern] [default] [encoding=ec,rscale=1.1] %\definetypeface % [MyFace] [mm] [math] [euler] [euler] [encoding=ec,rscale=1.03] %\usetypescript[adobekb][\defaultencoding] %\setupbodyfont [MyFace, 11pt] %\stopMPenvironment \definefont [BigFontOne] [RegularSlanted sa 2.5] \definefont [BigFontTwo] [Regular sa 1.5] \setupcolors [state=start] \definecolor [colorone] [r=0.625,g=0,b=0] %dark red \definecolor [colortwo] [b=0.625,g=0,r=0] %dark blue \startuniqueMPgraphic{shadow} fill OverlayBox shifted (3pt,-3pt) withcolor .8white ; fill OverlayBox withcolor white ; draw OverlayBox withcolor blue ; setbounds currentpicture to OverlayBox ; \stopuniqueMPgraphic \defineoverlay [shadow] [\uniqueMPgraphic{shadow}] \def\assignmenttitle#1#2% {\framed[ width=broad, frame=off, align=right, foregroundcolor=colortwo, % I want a shadow around the title frame background=shadow] {#2\\{\colorone\BigFontTwo\Assigncourse}}} \setuphead[title] [ style=\BigFontOne, command=\assignmenttitle, before={\resetnumber[PROBLEM]\setuppagenumber[number=1]}, after={\blank[big] \bgroup \colortwo Assigned on: \expanded{\date[\Assignassigned]} \hfill Due on: \expanded{\date[\Assigndue]} \egroup\blank} ] \setupheadertexts [title] %D say \quotation{Solutions} while generating solutions \startmode[solution] \setupheadertexts [Solutions] [] \stopmode \setupfootertexts [pagenumber] \setupfootertexts [Assigned: \expanded{\date[\Assignassigned]}] [Due: \expanded{\date[\Assigndue]}] \definetext [title] [footer] [pagenumber] \setuphead [title] [header=high,footer=] \setuplabeltext [problem=Problem,solution=Solution ] \setuplabeltext [point=point,points=points] \def\assignment[#1] {\getrawparameters [Assign] [title=, course=, assigned=, due=, #1]% \title{\Assigntitle} } \defineenumeration [PROBLEM] [ text={\labeltext{problem}}, location=hanging, headstyle=\sc, headcolor=colorone, before={\resetnumber[formula]\page[desirable]}, after=\blank, ] \def\startproblem% {\dosingleempty\dostartproblem} \def\dostartproblem[#1]% {\startPROBLEM[#1]\dosinglegroupempty\dodostartproblem} \def\dodostartproblem#1% {\iffirstargument % Check if #1 = 1, use point, else use points \bgroup \colortwo (#1 \dopoints{#1}) \egroup \fi} \def\dopoints#1% {\doifelse{#1}{1}{\labeltext{point}}{\labeltext{points}}} \def\stopproblem% {\stopPROBLEM} \setupheader [text] [color=colortwo] \setupfooter [text] [color=colortwo] \setupitemize [each] [left=(,right=),stopper=,color=colorone] \setupitemize [1] [intro] \setupitemize [joinedup,packed] %D Use characters (a,b,\unknown) at the first level and roman numberals (i, ii, %D \unknown) at the second level. \setupitemize [1] [a] \setupitemize [2] [r] %D \macros{startsolution} %D In the default mode, the solution evironment should gobble its contents. %D I copy the definition of \tex{starthiding} to {\em hide} the solutions. \definebuffer [solution] \setupbuffer [solution] [local=yes] %D In solution mode, I redefine solution environment as an %D enumeration without a number. There are probably better ways to define this %D environment, but why reinvent the wheel? \startmode[solution] \defineenumeration [solution] [ text=\labeltext{solution}, number=no, headstyle=bold, headcolor=colortwo, location=serried, width=fit, before=\startsolutionbackground, after=\stopsolutionbackground ] %D The \filename{exam.cls} class in \LATEX\ allows you to put a frame around %D the solution and the frame breaks across pages. I wanted to put a frame %D around the solution, but something more informal than a rectangular frame. %D \CONTEXT's manual gave hints on getting different kinds of frames, and I %D finally settled for a randomized framed. The frame should %D break around pages, so I used \tex{textbackground}. \definetextbackground [solutionbackground] [ mp=background:random, location=paragraph, rulethickness=1pt, framecolor=colorone, width=local, leftoffset=1em, rightoffset=1em, before={\testpage[3]\blank[2*big]}, after={\blank[2*big]} ] %D The background in \tex{textbackground} is drawn using a useMPgraphic %D defined set by \mono{mp=}. I define a useMPgraphic \mono{background:random} %D to get the frame that I wanted. The code looks a bit complicated, because %D \tex{texbackground} is supposed to work in a multi||column documents. % A randomized frame \startuseMPgraphic{background:random} path p; for i = 1 upto nofmultipars : p = (multipars[i] topenlarged 10pt bottomenlarged 10pt) randomized 4pt ; fill p withcolor lightgray ; draw p withcolor \MPvar{linecolor} withpen pencircle scaled \MPvar{linewidth}; endfor; \stopuseMPgraphic %D An earlier attempt that draws a frame which is squeezed in the center. To %D use this change mp=background:random to mp=backgrond:squeezed in %D \definetextbackground above. \startuseMPgraphic{background:squeezed} path p; for i = 1 upto nofmultipars : p = multipars[i] topenlarged 10pt bottomenlarged 10pt squeezed 5pt randomized 1pt ; fill p withcolor lightgray ; draw p withcolor \MPvar{linecolor} withpen pencircle scaled \MPvar{linewidth}; endfor; \stopuseMPgraphic %D By default, the textbackground extends till the page boundary. This does %D not look good if a page break occurs when there is not enough material to %D fit in the page. So, we want to limit textbackground till the typeset %D material. This has not been interfaced yet, so I use a low level \TEX\ %D command. \chardef\kindofpagetextareas\plusone \stopmode %D I also wanted an English rule at the end of each assignment. \CONTEXT\ %D already defines an English rule. I load \filename{meta-txt.tex} to use it. \useMPlibrary [txt] %D I want the English rule to match the color scheme of the entire document. \setupMPvariables [EnglishRule] [color=colortwo, width=0.5\textwidth] %D I redefined \tex{stopcomponent} to add the rule at the end of the file. \let\normalstopcomponent\stopcomponent \def\stopcomponent% {\dosomebreak\nobreak \framedtext[frame=off,strut=no,align=middle,width=\textwidth] {\EnglishRule} \normalstopcomponent} \stopenvironment Any hints as to why this should not work anymore? Thanks and best regards, Marko
On Fri, 24 Sep 2010, Marko Schütz Schmuck wrote:
Dear All,
I only very recently updated from
ConTeXt ver: 2005.01.31
to
ConTeXt ver: 2009.08.19 17:10 MKII
Previously, using env-assign.tex as described in a 2006 PracTeX article worked fine. With the new version the drop shadow box is not rendered.
Do you have write18 enabled (It is disabled by default on most distributions). See http://wiki.contextgarden.net/write18 If so, you either need to enable write18 or use \runMPgraphicsfalse on the top of your file. Aditya
Dear Aditya, At Fri, 24 Sep 2010 11:21:01 -0400 (EDT), Aditya Mahajan wrote:
On Fri, 24 Sep 2010, Marko Schütz Schmuck wrote:
Dear All,
I only very recently updated from
ConTeXt ver: 2005.01.31
to
ConTeXt ver: 2009.08.19 17:10 MKII
Previously, using env-assign.tex as described in a 2006 PracTeX article worked fine. With the new version the drop shadow box is not rendered.
Do you have write18 enabled (It is disabled by default on most distributions). See http://wiki.contextgarden.net/write18
the setting was shell_escape = p and mpost was listed in the permissible commands. I changed it to shell_escape = 1 and rebuilt formats. This did not fix my issue.
If so, you either need to enable write18 or use \runMPgraphicsfalse on the top of your file.
This solved it. Thanks. Marko
On Mon, 27 Sep 2010, Marko Schütz Schmuck wrote:
Dear Aditya,
At Fri, 24 Sep 2010 11:21:01 -0400 (EDT), Aditya Mahajan wrote:
On Fri, 24 Sep 2010, Marko Schütz Schmuck wrote:
Dear All,
I only very recently updated from
ConTeXt ver: 2005.01.31
to
ConTeXt ver: 2009.08.19 17:10 MKII
Previously, using env-assign.tex as described in a 2006 PracTeX article worked fine. With the new version the drop shadow box is not rendered.
Do you have write18 enabled (It is disabled by default on most distributions). See http://wiki.contextgarden.net/write18
the setting was
shell_escape = p
and mpost was listed in the permissible commands. I changed it to
shell_escape = 1
That should be t (tee) rather than 1 (one) shell_escape = t
and rebuilt formats. This did not fix my issue.
There is no need to rebuild the formats. Aditya
At Mon, 27 Sep 2010 14:27:36 -0400 (EDT), Aditya Mahajan wrote:
On Mon, 27 Sep 2010, Marko Schütz Schmuck wrote:
Dear Aditya,
At Fri, 24 Sep 2010 11:21:01 -0400 (EDT), Aditya Mahajan wrote:
On Fri, 24 Sep 2010, Marko Schütz Schmuck wrote:
Dear All,
I only very recently updated from
ConTeXt ver: 2005.01.31
to
ConTeXt ver: 2009.08.19 17:10 MKII
Previously, using env-assign.tex as described in a 2006 PracTeX article worked fine. With the new version the drop shadow box is not rendered.
Do you have write18 enabled (It is disabled by default on most distributions). See http://wiki.contextgarden.net/write18
the setting was
shell_escape = p
and mpost was listed in the permissible commands. I changed it to
shell_escape = 1
That should be t (tee) rather than 1 (one)
shell_escape = t
I tried both (btw. the comment just before the option calls for 1), but without the desired result.
and rebuilt formats. This did not fix my issue.
There is no need to rebuild the formats.
OK, thanks. Would you have any other idea, what the issue might be? Best regards, Marko
On Tue, 28 Sep 2010, Marko Schütz Schmuck wrote:
At Mon, 27 Sep 2010 14:27:36 -0400 (EDT), Aditya Mahajan wrote:
Do you have write18 enabled (It is disabled by default on most distributions). See http://wiki.contextgarden.net/write18
the setting was
shell_escape = p
and mpost was listed in the permissible commands. I changed it to
shell_escape = 1
That should be t (tee) rather than 1 (one)
shell_escape = t
I tried both (btw. the comment just before the option calls for 1), but without the desired result.
and rebuilt formats. This did not fix my issue.
There is no need to rebuild the formats.
OK, thanks.
Would you have any other idea, what the issue might be?
No. What distribution are you using? Are you editing the correct texmf.cnf file, the one that is returned by kpsewhich texmf.cnf? Aditya
participants (2)
-
Aditya Mahajan
-
Marko Schütz Schmuck