* custom command \myframedsection does not always work. Bug?
@ 2011-10-30 15:00 Curiouslearn
2011-10-30 17:42 ` Wolfgang Schuster
0 siblings, 1 reply; 3+ messages in thread
From: Curiouslearn @ 2011-10-30 15:00 UTC (permalink / raw)
To: mailing list for ConTeXt users
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
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: custom command \myframedsection does not always work. Bug?
2011-10-30 15:00 custom command \myframedsection does not always work. Bug? Curiouslearn
@ 2011-10-30 17:42 ` Wolfgang Schuster
2011-10-30 21:08 ` Curiouslearn
0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2011-10-30 17:42 UTC (permalink / raw)
To: mailing list for ConTeXt users
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: custom command \myframedsection does not always work. Bug?
2011-10-30 17:42 ` Wolfgang Schuster
@ 2011-10-30 21:08 ` Curiouslearn
0 siblings, 0 replies; 3+ messages in thread
From: Curiouslearn @ 2011-10-30 21:08 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi Wolfgang,
Thanks very much. Your command worked great.
Regards,
Bharat
On Sun, Oct 30, 2011 at 1:42 PM, Wolfgang Schuster
<schuster.wolfgang@googlemail.com> wrote:
>
> 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
> ___________________________________________________________________________________
>
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-30 21:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-30 15:00 custom command \myframedsection does not always work. Bug? Curiouslearn
2011-10-30 17:42 ` Wolfgang Schuster
2011-10-30 21:08 ` Curiouslearn
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).