custom command \myframedsection does not always work. Bug?
Hi All, Please see the working example below. I have defined a command called \myframedsection. It works the first two times I use it, but not the third time. I think it has something to do with using \startitemize...\stopitemize before the command is used the third time. But I am not sure. Can someone please tell me why it is not working, and how I can change my definition so that it works? Is this a bug? Minimal Example: \setuppapersize[letter][letter] \setupwhitespace[medium] \setuplayout[height=middle,width=middle,topspace=0.5in,header=1cm,backspace=1.25in] \setupcolors[state=start] \setupcolor[xwi] \setupinteraction[state=start] % Changing the location of the page numbers so that they appear in the footer. \setuppagenumbering[location=footer] \setupnarrower[left=2ex] \setupitemize[margin=0.5cm] \setupitemize[a] \setupitemize[stopper=)] %%% Defining \mysection and \myframedsection %%% \definehead[mysection][section] \setuphead[mysection][color=blue*:3] \def\myframedsection#1{\bgroup\vskip 0.5in \framed[background=color, backgroundcolor=gray:10] {\mysection{#1}}% \egroup} \starttext \myframedsection{Confidence Intervals from the normal and $t$-distributions} {\bf Here myframedsection commmand works.} \subsection{Confidence Interval for Mean} \subsection{Confidence Interval for Proportion} \subsection{Confidence Interval for Linear Transformation} %%%% SECTION %%%% \myframedsection{Classical Hypothesis Testing} %%%% SECTION %%%% {\bf Here myframedsection commmand works.} \startitemize \item some item here \item some item here \stopitemize %%%% SECTION %%%% \myframedsection{Problems with Statistical Significance} %%%% SECTION %%%% {\bf where is the section title??????} Researchers often compare results based on statistical significance. There are two pitfalls in doing so: \startitemize \item Statistical significance does not mean practical significance. A result that is statistically significant may be practically insignificant. \item If one result is statistically significant and other is not, it does not necessarily mean that the difference in the two results is statistically significant. For example, suppose there are two independent studies, one with an effect estimate of 25 and standard error of 10. Another with an effect estimate of 10 and standard error of 10. The former is statistically significant at 1\% significance level. The latter is not significant at 1\%. From this one may be tempted to conclude that there is a large/significant difference between the results in two studies. However, this is not true. The estimate of difference in the effects is 15 with standard error of $ \sqrt{10^{2} + 10^{2}} = 14 $. This is not even close to being statistically significant at 1\% level. \stopitemize \stoptext
Am 30.10.2011 um 16:00 schrieb Curiouslearn:
Hi All,
Please see the working example below. I have defined a command called \myframedsection. It works the first two times I use it, but not the third time. I think it has something to do with using \startitemize...\stopitemize before the command is used the third time. But I am not sure. Can someone please tell me why it is not working, and how I can change my definition so that it works? Is this a bug?
\definehead[mysection][section] \setuphead[mysection][color=blue*:3]
\def\myframedsection#1{\bgroup\vskip 0.5in \framed[background=color, backgroundcolor=gray:10] {\mysection{#1}}% \egroup}
No wonder you get unexpected results with this definition, better solutions are \definehead[myframedsection][section] \setuphead [myframedsection] [before={\blank[0.5in]\startframedtext[background=color,backgroundcolor=gray:10]}, after={\stopframedtext\blank[0.25in]}, color=blue*:3] and \define[2]\MyframedsectionCommand {\framed [background=color,backgroundcolor=gray:10,align=flushleft] {\hbox to 2cm{#1}\vtop{\hsize=\dimexpr\hsize-2cm\relax#2}}} \definehead[myframedsection][section] \setuphead [myframedsection] [before={\blank[0.5in]}, command=\MyframedsectionCommand, style=blue*:3] Wolfgang
Hi Wolfgang,
Thanks very much. Your command worked great.
Regards,
Bharat
On Sun, Oct 30, 2011 at 1:42 PM, Wolfgang Schuster
Am 30.10.2011 um 16:00 schrieb Curiouslearn:
Hi All,
Please see the working example below. I have defined a command called \myframedsection. It works the first two times I use it, but not the third time. I think it has something to do with using \startitemize...\stopitemize before the command is used the third time. But I am not sure. Can someone please tell me why it is not working, and how I can change my definition so that it works? Is this a bug?
\definehead[mysection][section] \setuphead[mysection][color=blue*:3]
\def\myframedsection#1{\bgroup\vskip 0.5in \framed[background=color, backgroundcolor=gray:10] {\mysection{#1}}% \egroup}
No wonder you get unexpected results with this definition, better solutions are
\definehead[myframedsection][section]
\setuphead [myframedsection] [before={\blank[0.5in]\startframedtext[background=color,backgroundcolor=gray:10]}, after={\stopframedtext\blank[0.25in]}, color=blue*:3]
and
\define[2]\MyframedsectionCommand {\framed [background=color,backgroundcolor=gray:10,align=flushleft] {\hbox to 2cm{#1}\vtop{\hsize=\dimexpr\hsize-2cm\relax#2}}}
\definehead[myframedsection][section]
\setuphead [myframedsection] [before={\blank[0.5in]}, command=\MyframedsectionCommand, style=blue*:3]
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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
participants (2)
-
Curiouslearn
-
Wolfgang Schuster