Re: [NTG-context] Weird error

2014-09-10 Thread Aditya Mahajan

On Wed, 10 Sep 2014, Wolfgang Schuster wrote:



Am 10.09.2014 um 18:37 schrieb Aditya Mahajan :


Hi,

There was a question on TeX.SX about an error message
http://tex.stackexchange.com/questions/200474/setuppagenumberinglocation-causes-problem-in-context

The following MWE shows the same error

\setupfootertexts[\namedheadnumber{chapter}]
\setuppagenumbering[location=,alternative=doublesided]

\starttext

\completecontent

\chapter{Creating device driver}

\section{How to create the}

Chapter text

\stoptext

which gives

lua error   > error on line 8 in file /tmp/test.tex:

...uild/src/tex/texmf-context/tex/context/base/strc-doc.lua:904: attempt to 
index field 'numbers' (a nil value)
stack traceback:
   ...uild/src/tex/texmf-context/tex/context/base/strc-doc.lua:904: in 
function 'getsectionnumber'
   [\directlua]:1: in main chunk

The error is weird because it only appears when all parts of the minimal 
example are present. If I comment either or `location=,` or 
`alternative=doublesided` or `\completecontent` or `\section{...}`, the error 
goes away!

Any thoughts?



The error arises only when there is no aux file. A alternative to 
\namedheadnumber{XXX} is \getmarking[XXXnumber].

   \setupfootertexts[{\getmarking[chapternumber]}]


Thanks!

Aditya
___
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
___


Re: [NTG-context] Weird error

2014-09-10 Thread Wolfgang Schuster

Am 10.09.2014 um 18:37 schrieb Aditya Mahajan :

> Hi,
> 
> There was a question on TeX.SX about an error message
> http://tex.stackexchange.com/questions/200474/setuppagenumberinglocation-causes-problem-in-context
> 
> The following MWE shows the same error
> 
> \setupfootertexts[\namedheadnumber{chapter}]
> \setuppagenumbering[location=,alternative=doublesided]
> 
> \starttext
> 
> \completecontent
> 
> \chapter{Creating device driver}
> 
> \section{How to create the}
> 
> Chapter text
> 
> \stoptext
> 
> which gives
> 
> lua error   > error on line 8 in file /tmp/test.tex:
> 
> ...uild/src/tex/texmf-context/tex/context/base/strc-doc.lua:904: attempt to 
> index field 'numbers' (a nil value)
> stack traceback:
>...uild/src/tex/texmf-context/tex/context/base/strc-doc.lua:904: in 
> function 'getsectionnumber'
>[\directlua]:1: in main chunk
> 
> The error is weird because it only appears when all parts of the minimal 
> example are present. If I comment either or `location=,` or 
> `alternative=doublesided` or `\completecontent` or `\section{...}`, the error 
> goes away!
> 
> Any thoughts?


The error arises only when there is no aux file. A alternative to 
\namedheadnumber{XXX} is \getmarking[XXXnumber].

\setupfootertexts[{\getmarking[chapternumber]}]

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
___


[NTG-context] Weird error

2014-09-10 Thread Aditya Mahajan

Hi,

There was a question on TeX.SX about an error message
http://tex.stackexchange.com/questions/200474/setuppagenumberinglocation-causes-problem-in-context

The following MWE shows the same error

\setupfootertexts[\namedheadnumber{chapter}]
\setuppagenumbering[location=,alternative=doublesided]

\starttext

\completecontent

\chapter{Creating device driver}

\section{How to create the}

Chapter text

\stoptext

which gives

lua error   > error on line 8 in file /tmp/test.tex:

...uild/src/tex/texmf-context/tex/context/base/strc-doc.lua:904: attempt 
to index field 'numbers' (a nil value)

stack traceback:
...uild/src/tex/texmf-context/tex/context/base/strc-doc.lua:904: 
in function 'getsectionnumber'

[\directlua]:1: in main chunk

The error is weird because it only appears when all parts of the minimal 
example are present. If I comment either or `location=,` or 
`alternative=doublesided` or `\completecontent` or `\section{...}`, the 
error goes away!


Any thoughts?

Aditya
___
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
___


Re: [NTG-context] Is there a convenient way to annotate equations?

2014-09-10 Thread Wolfgang Schuster

Am 09.09.2014 um 18:44 schrieb seasoul :

> Is there an already-exsting or easy way to add annotations to equations, just 
> something like 
> 
> annotation1.png

You can use the \underbrace and \overbrace commands.

\starttext

\startformula
\underbrace{f(n)}_{\text{Output}} = \underbrace{\overbrace{n}^{\text{Input}} + 
3}_{\text{Rule for Function}}
\stopformula

\stoptext

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
___