Re: [NTG-context] Can I just put a footnote without marking in the main text?

2022-05-18 Thread Ross via ntg-context
I found a way to wrap everything before \startdocument, so I think this
looks like a template more or less:

In case anyone is interested, here's the MWE:

\definenote[address]
\setupnote[address][rule=off,location=text]


\setupnotation[footnote][numberconversion=numerals]

\definenote[putjustmark]
\setupnote[putjustmark][location=none]
\setupnotation[putjustmark][numberconversion=set 2]


\definenote[putjustnote][footnote]
\setupnote[putjustnote][textcommand=\gobbleoneargument]
\setupnotation[putjustnote][numberconversion=set 2]

\newif\ifnoteintitle
\newtoks\titlefootnotes

\titlefootnotes\emptytoks


\def\thanks#1{\noteintitletrue\putjustmark{#1}\doglobal\appendtoks
\putjustnote{#1} \to \titlefootnotes}
\def\email#1{\noteintitletrue\putjustmark{#1}\doglobal\appendtoks
\putjustnote{#1} \to \titlefootnotes}

\def\unskipfunnylines{\ifnoteintitle\endgraf\kern-2\lineheight\fi}


\definenamespace
   [addr]
   [type=module,
name=address,
command=yes,
setup=list,
parent=addr,
  ]

\define[1]\useaddress
{\setnotetext[address][#1]{\namedaddressparameter{#1}{name}}}



\setupaddress[style=italic]
\defineaddress[fst][name={Name of Institute or Affiliation, City, Country}]
\defineaddress[snd][name={Name of Secondary Institute or Affiliation, City,
Country}]
\defineaddress[thd][name={Name of Third Institute or Affiliation, City,
Country}]

\processcommacommand[fst,snd,thd]\useaddress



\startsetups [document:start]
The Title\dorecurse{10}{\expanded{\thanks{Work supported by fund
\recurselevel.}}}
\endgraf

Me\dorecurse{10}{\expanded{\email{\tt my.name@mailbox.\recurselevel.com
}}\high{,}}\note[address][fst]\high{,}\note[address][snd]\high{,}\note[address][thd]
\endgraf

\placenotes[address]

\blank[medium]
  \startcolumns\hyphenpenalty1000

  \the\titlefootnotes\relax

  \setcounter[footnote][0]

  \unskipfunnylines

\stopsetups

\startsetups [document:stop]
  \stopcolumns
\stopsetups



\startdocument


test\footnote{test}

\input knuth

\input knuth

\input knuth

\input knuth

\stopdocument



On Wed, May 18, 2022 at 10:02 PM Ross  wrote:

> After some visualisations, I found that my token \titlefootnotes will
> ALWAYS generate two lines if there is/are any non-zero number of footnotes
> there. Interesting. So I need a \newif that each time a \thanks or \email
> is invoked, it'll set to true and I'll unskip the 2\lineheight afterwards.
>
> I still don't know why this \kern macro won't have any effect if it's
> inside a token or a \startsetup.
>
> On Wed, May 18, 2022 at 4:56 PM Ross  wrote:
>
>> Hi Massi,
>>
>> You are a champion!
>>
>> On Wed, May 18, 2022 at 4:41 PM mf  wrote:
>>
>>> I hope I got the point now:
>>>
>>> ...
>>> \startcolumns
>>>
>>> \the\titlefootnotes
>>>
>>> \kern-\rawcountervalue[address]\lineheight % dirty trick
>>>
>>> test\footnote{test}
>>>
>>> \input knuth
>>>
>>> \stopcolumns
>>> ...
>>>
>>> Massi
>>>
>>> Il 18/05/22 10:07, Ross ha scritto:
>>> > Dear Massi,
>>> >
>>> > Thanks for your solution. But the thing may be related to the
>>> > \appendtoks macro. It doesn't work to put just \setnotetext there.
>>> > \note works fine, so that's the reason I need the "full functional
>>> macro".
>>> >
>>> > Maybe I didn't get the point, so if it's not too much to ask, could
>>> you
>>> > do it on my MWE?
>>> >
>>> > PS: sorry I have to use another email account because my institute
>>> > mailbox took forever to get the message before my government (China)
>>> > finishes auditing it.
>>> >
>>> > Best wishes,
>>> > Zhichu
>>> >
>>> > On Wed, May 18, 2022 at 3:36 PM mf via ntg-context >> > > wrote:
>>> >
>>> > Is this what you mean?
>>> >
>>> > \starttext
>>> > Hello\footnotetext{Footnote without mark}.
>>> > \stoptext
>>> >
>>> > Kind regards,
>>> > Massi
>>> >
>>> > Il 18/05/22 07:55, Zhichu Chen via ntg-context ha scritto:
>>> >  > Hi everybody,
>>> >  >
>>> >  >
>>> >  > After some attempts to put footnotes in a mixed 1&2 columns
>>> > layout, I
>>> >  > decide to put marks in the one-column environment and flush them
>>> > when
>>> >  > entering the two-column environment.
>>> >  >
>>> >  >
>>> >  > The code is ugly but the result is acceptable. Except that the
>>> > invisible
>>> >  > footnote marks do generate something in the main text, so
>>> there's a
>>> >  > blank line for each footnote.
>>> >  >
>>> >  >
>>> >  > Here's an MWE:
>>> >  >
>>> >  >
>>> >  > =
>>> >  >
>>> >  > \definenote[address]
>>> >  > \setupnote[address][rule=off,location=text]
>>> >  >
>>> >  >
>>> >  >
>>> >  > \definenote[putjustmark]
>>> >  > \setupnote[putjustmark][location=none]
>>> >  > \setupnotation[putjustmark][numberconversion=set 2]
>>> >  >
>>> >  >
>>> >  > \definenote[putjustnote]%[footnote] % if footnotes need to be
>>> > grouped,
>>> >  > uncomment 

Re: [NTG-context] Can I just put a footnote without marking in the main text?

2022-05-18 Thread Ross via ntg-context
After some visualisations, I found that my token \titlefootnotes will
ALWAYS generate two lines if there is/are any non-zero number of footnotes
there. Interesting. So I need a \newif that each time a \thanks or \email
is invoked, it'll set to true and I'll unskip the 2\lineheight afterwards.

I still don't know why this \kern macro won't have any effect if it's
inside a token or a \startsetup.

On Wed, May 18, 2022 at 4:56 PM Ross  wrote:

> Hi Massi,
>
> You are a champion!
>
> On Wed, May 18, 2022 at 4:41 PM mf  wrote:
>
>> I hope I got the point now:
>>
>> ...
>> \startcolumns
>>
>> \the\titlefootnotes
>>
>> \kern-\rawcountervalue[address]\lineheight % dirty trick
>>
>> test\footnote{test}
>>
>> \input knuth
>>
>> \stopcolumns
>> ...
>>
>> Massi
>>
>> Il 18/05/22 10:07, Ross ha scritto:
>> > Dear Massi,
>> >
>> > Thanks for your solution. But the thing may be related to the
>> > \appendtoks macro. It doesn't work to put just \setnotetext there.
>> > \note works fine, so that's the reason I need the "full functional
>> macro".
>> >
>> > Maybe I didn't get the point, so if it's not too much to ask, could you
>> > do it on my MWE?
>> >
>> > PS: sorry I have to use another email account because my institute
>> > mailbox took forever to get the message before my government (China)
>> > finishes auditing it.
>> >
>> > Best wishes,
>> > Zhichu
>> >
>> > On Wed, May 18, 2022 at 3:36 PM mf via ntg-context > > > wrote:
>> >
>> > Is this what you mean?
>> >
>> > \starttext
>> > Hello\footnotetext{Footnote without mark}.
>> > \stoptext
>> >
>> > Kind regards,
>> > Massi
>> >
>> > Il 18/05/22 07:55, Zhichu Chen via ntg-context ha scritto:
>> >  > Hi everybody,
>> >  >
>> >  >
>> >  > After some attempts to put footnotes in a mixed 1&2 columns
>> > layout, I
>> >  > decide to put marks in the one-column environment and flush them
>> > when
>> >  > entering the two-column environment.
>> >  >
>> >  >
>> >  > The code is ugly but the result is acceptable. Except that the
>> > invisible
>> >  > footnote marks do generate something in the main text, so
>> there's a
>> >  > blank line for each footnote.
>> >  >
>> >  >
>> >  > Here's an MWE:
>> >  >
>> >  >
>> >  > =
>> >  >
>> >  > \definenote[address]
>> >  > \setupnote[address][rule=off,location=text]
>> >  >
>> >  >
>> >  >
>> >  > \definenote[putjustmark]
>> >  > \setupnote[putjustmark][location=none]
>> >  > \setupnotation[putjustmark][numberconversion=set 2]
>> >  >
>> >  >
>> >  > \definenote[putjustnote]%[footnote] % if footnotes need to be
>> > grouped,
>> >  > uncomment the second argument and the line after
>> \the\titlefootnotes
>> >  > \setupnote[putjustnote][textcommand=\gobbleoneargument]
>> >  > \setupnotation[putjustnote][numberconversion=set 2]
>> >  >
>> >  >
>> >  > \newtoks\titlefootnotes
>> >  >
>> >  >
>> >  > \def\thanks#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to
>> >  > \titlefootnotes}
>> >  > \def\email#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to
>> >  > \titlefootnotes}
>> >  >
>> >  >
>> >  > \appendtoks
>> >  >\setcounter[footnote][0] % this looks stupid because it has no
>> > effect
>> >  >%\setupnotation[footnote][numberconversion=numerals]
>> >  > \to \titlefootnotes
>> >  >
>> >  > \definenamespace
>> >  > [addr]
>> >  > [type=module,
>> >  >  name=address,
>> >  >  command=yes,
>> >  >  setup=list,
>> >  >  parent=addr,
>> >  >]
>> >  >
>> >  > \define[1]\useaddress
>> >  >
>> {\setnotetext[address][#1]{\namedaddressparameter{#1}{name}}}
>> >  >
>> >  >
>> >  > \starttext
>> >  >
>> >  >
>> >  >
>> >  > \defineaddress[fst][name={Name of Institute or Affiliation, City,
>> > Country}]
>> >  > \defineaddress[snd][name={Name of Secondary Institute or
>> > Affiliation,
>> >  > City, Country}]
>> >  >
>> >  > \processcommacommand[fst,snd]\useaddress
>> >  >
>> >  >
>> >  > The Title\thanks{Work supported by somebody.}
>> >  >
>> >  >
>> > Me\email{myemail@some.where
>> }\high{,}\note[address][fst]\high{,}\note[address][snd]
>> >
>> >  >
>> >  >
>> >  >
>> >  > \placenotes[address]
>> >  >
>> >  > \blank[medium]
>> >  >
>> >  > \startcolumns
>> >  >
>> >  >
>> >  > \the\titlefootnotes
>> >  >
>> >  > %\setcounter[footnote][0] % why it's necessary to set the counter
>> >  > outside the token if I define [putjustnote] as [footnote]?
>> >  >
>> >  >
>> >  > test\footnote{test}
>> >  >
>> >  > \input knuth
>> >  >
>> >  >
>> >  >
>> >  > \stopcolumns
>> >  >
>> >  > 

Re: [NTG-context] Can I just put a footnote without marking in the main text?

2022-05-18 Thread Ross via ntg-context
Hi Massi,

You are a champion!

On Wed, May 18, 2022 at 4:41 PM mf  wrote:

> I hope I got the point now:
>
> ...
> \startcolumns
>
> \the\titlefootnotes
>
> \kern-\rawcountervalue[address]\lineheight % dirty trick
>
> test\footnote{test}
>
> \input knuth
>
> \stopcolumns
> ...
>
> Massi
>
> Il 18/05/22 10:07, Ross ha scritto:
> > Dear Massi,
> >
> > Thanks for your solution. But the thing may be related to the
> > \appendtoks macro. It doesn't work to put just \setnotetext there.
> > \note works fine, so that's the reason I need the "full functional
> macro".
> >
> > Maybe I didn't get the point, so if it's not too much to ask, could you
> > do it on my MWE?
> >
> > PS: sorry I have to use another email account because my institute
> > mailbox took forever to get the message before my government (China)
> > finishes auditing it.
> >
> > Best wishes,
> > Zhichu
> >
> > On Wed, May 18, 2022 at 3:36 PM mf via ntg-context  > > wrote:
> >
> > Is this what you mean?
> >
> > \starttext
> > Hello\footnotetext{Footnote without mark}.
> > \stoptext
> >
> > Kind regards,
> > Massi
> >
> > Il 18/05/22 07:55, Zhichu Chen via ntg-context ha scritto:
> >  > Hi everybody,
> >  >
> >  >
> >  > After some attempts to put footnotes in a mixed 1&2 columns
> > layout, I
> >  > decide to put marks in the one-column environment and flush them
> > when
> >  > entering the two-column environment.
> >  >
> >  >
> >  > The code is ugly but the result is acceptable. Except that the
> > invisible
> >  > footnote marks do generate something in the main text, so there's
> a
> >  > blank line for each footnote.
> >  >
> >  >
> >  > Here's an MWE:
> >  >
> >  >
> >  > =
> >  >
> >  > \definenote[address]
> >  > \setupnote[address][rule=off,location=text]
> >  >
> >  >
> >  >
> >  > \definenote[putjustmark]
> >  > \setupnote[putjustmark][location=none]
> >  > \setupnotation[putjustmark][numberconversion=set 2]
> >  >
> >  >
> >  > \definenote[putjustnote]%[footnote] % if footnotes need to be
> > grouped,
> >  > uncomment the second argument and the line after
> \the\titlefootnotes
> >  > \setupnote[putjustnote][textcommand=\gobbleoneargument]
> >  > \setupnotation[putjustnote][numberconversion=set 2]
> >  >
> >  >
> >  > \newtoks\titlefootnotes
> >  >
> >  >
> >  > \def\thanks#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to
> >  > \titlefootnotes}
> >  > \def\email#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to
> >  > \titlefootnotes}
> >  >
> >  >
> >  > \appendtoks
> >  >\setcounter[footnote][0] % this looks stupid because it has no
> > effect
> >  >%\setupnotation[footnote][numberconversion=numerals]
> >  > \to \titlefootnotes
> >  >
> >  > \definenamespace
> >  > [addr]
> >  > [type=module,
> >  >  name=address,
> >  >  command=yes,
> >  >  setup=list,
> >  >  parent=addr,
> >  >]
> >  >
> >  > \define[1]\useaddress
> >  >  {\setnotetext[address][#1]{\namedaddressparameter{#1}{name}}}
> >  >
> >  >
> >  > \starttext
> >  >
> >  >
> >  >
> >  > \defineaddress[fst][name={Name of Institute or Affiliation, City,
> > Country}]
> >  > \defineaddress[snd][name={Name of Secondary Institute or
> > Affiliation,
> >  > City, Country}]
> >  >
> >  > \processcommacommand[fst,snd]\useaddress
> >  >
> >  >
> >  > The Title\thanks{Work supported by somebody.}
> >  >
> >  >
> > Me\email{myemail@some.where
> }\high{,}\note[address][fst]\high{,}\note[address][snd]
> >
> >  >
> >  >
> >  >
> >  > \placenotes[address]
> >  >
> >  > \blank[medium]
> >  >
> >  > \startcolumns
> >  >
> >  >
> >  > \the\titlefootnotes
> >  >
> >  > %\setcounter[footnote][0] % why it's necessary to set the counter
> >  > outside the token if I define [putjustnote] as [footnote]?
> >  >
> >  >
> >  > test\footnote{test}
> >  >
> >  > \input knuth
> >  >
> >  >
> >  >
> >  > \stopcolumns
> >  >
> >  > \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  /
> > 

Re: [NTG-context] Can I just put a footnote without marking in the main text?

2022-05-18 Thread Ross via ntg-context
Dear Massi,

Thanks for your solution. But the thing may be related to the \appendtoks
macro. It doesn't work to put just \setnotetext there.
\note works fine, so that's the reason I need the "full functional macro".

Maybe I didn't get the point, so if it's not too much to ask, could you do
it on my MWE?

PS: sorry I have to use another email account because my institute mailbox
took forever to get the message before my government (China) finishes
auditing it.

Best wishes,
Zhichu

On Wed, May 18, 2022 at 3:36 PM mf via ntg-context 
wrote:

> Is this what you mean?
>
> \starttext
> Hello\footnotetext{Footnote without mark}.
> \stoptext
>
> Kind regards,
> Massi
>
> Il 18/05/22 07:55, Zhichu Chen via ntg-context ha scritto:
> > Hi everybody,
> >
> >
> > After some attempts to put footnotes in a mixed 1&2 columns layout, I
> > decide to put marks in the one-column environment and flush them when
> > entering the two-column environment.
> >
> >
> > The code is ugly but the result is acceptable. Except that the invisible
> > footnote marks do generate something in the main text, so there's a
> > blank line for each footnote.
> >
> >
> > Here's an MWE:
> >
> >
> > =
> >
> > \definenote[address]
> > \setupnote[address][rule=off,location=text]
> >
> >
> >
> > \definenote[putjustmark]
> > \setupnote[putjustmark][location=none]
> > \setupnotation[putjustmark][numberconversion=set 2]
> >
> >
> > \definenote[putjustnote]%[footnote] % if footnotes need to be grouped,
> > uncomment the second argument and the line after \the\titlefootnotes
> > \setupnote[putjustnote][textcommand=\gobbleoneargument]
> > \setupnotation[putjustnote][numberconversion=set 2]
> >
> >
> > \newtoks\titlefootnotes
> >
> >
> > \def\thanks#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to
> > \titlefootnotes}
> > \def\email#1{\putjustmark{#1}\appendtoks \putjustnote{#1} \to
> > \titlefootnotes}
> >
> >
> > \appendtoks
> >\setcounter[footnote][0] % this looks stupid because it has no effect
> >%\setupnotation[footnote][numberconversion=numerals]
> > \to \titlefootnotes
> >
> > \definenamespace
> > [addr]
> > [type=module,
> >  name=address,
> >  command=yes,
> >  setup=list,
> >  parent=addr,
> >]
> >
> > \define[1]\useaddress
> >  {\setnotetext[address][#1]{\namedaddressparameter{#1}{name}}}
> >
> >
> > \starttext
> >
> >
> >
> > \defineaddress[fst][name={Name of Institute or Affiliation, City,
> Country}]
> > \defineaddress[snd][name={Name of Secondary Institute or Affiliation,
> > City, Country}]
> >
> > \processcommacommand[fst,snd]\useaddress
> >
> >
> > The Title\thanks{Work supported by somebody.}
> >
> > Me\email{myemail@some.where}\high{,}\note[address][fst]\high{,}\note[address][snd]
>
> >
> >
> >
> > \placenotes[address]
> >
> > \blank[medium]
> >
> > \startcolumns
> >
> >
> > \the\titlefootnotes
> >
> > %\setcounter[footnote][0] % why it's necessary to set the counter
> > outside the token if I define [putjustnote] as [footnote]?
> >
> >
> > test\footnote{test}
> >
> > \input knuth
> >
> >
> >
> > \stopcolumns
> >
> > \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://context.aanhet.net
> > archive  : https://bitbucket.org/phg/context-mirror/commits/
> > 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>


-- 
Best Regards
Chen
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Setting table of contents depth by number rather than by list

2021-12-24 Thread Jason Ross via ntg-context

On 12/24/21 1:48 PM, Denis Maier via ntg-context wrote:

Anyway, I agree that a solution via hierarchy levels would be nice.


That's what I'm hoping to achieve. I'm not familiar enough with 
low-level ConTeXt to do something like this but it seems like it ought 
to be possible.



You don't do that. If you provide default a default sectionlevel 
scheme, you'll know what toc:2 means.
If a user uses a different scheme provided via 
#+Context_Section_Levels you can use that to adjust the meaning of 
toc:2. But if a user uses the default setting toc:2 should be fine. 
Does that make sense?


I understand. The issue I see is that this introduces a coupling between 
section structure and table of contents that could be confusing for 
users, and also makes the interface more complicated by adding another 
keyword.


I am trying to take advantage of the flexibility of ConTeXt for most of 
the configuration, because a user is more likely to be familiar with 
ConTeXt than with my specific elisp module.



Jason
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Setting table of contents depth by number rather than by list

2021-12-24 Thread Jason Ross via ntg-context



On 12/24/21 1:29 PM, Denis Maier wrote:


I probably wasn't clear. You will support toc:2.
This:
#+Context_Section_Levels: '(chapter section subsection)
will translate into a definesectionlevels command and inform your 
exporter about the used sectionlevels. Once the used commands are known 
it should be possible to map toc:2 to a combinedlist definition.


I can't require the user to use more document keywords to get the same 
functionality they already have with the other exporters by default.


I am really specifically looking for a way _in ConTeXt_ to create a 
table of contents with depth `n` regardless of the sectioning used.


Jason
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Setting table of contents depth by number rather than by list

2021-12-24 Thread Jason Ross via ntg-context



On 12/24/21 1:20 PM, Denis Maier via ntg-context wrote:



I see.

Next try: add a new option

"#+Context_Section_Levels:

Thus will take an alist. Now you'll know about the user defined 
structure levels and the toc option can be translated to the 
corresponding setting. (Here again, you can if course define 
reasonable defaults.)


Actually,  you don't need an alist. A simple quotes list should be enough:

#+Context_Section_Levels: '(chapter section subsection)


Denis



That isn't going to work. The interface needs to be the same as for the 
other exporters for TOC control. I need to support "toc:2".


Jason
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Setting table of contents depth by number rather than by list

2021-12-24 Thread Jason Ross via ntg-context



On 12/24/21 9:49 AM, Denis Maier via ntg-context wrote:

For the six = for the toc...
Denis Maier via ntg-context  hat am 24.12.2021 
18:42 geschrieben:



Can't you just define a default structurelevel scheme and a default 
combined list for the six. If a user redefines the structure level 
scheme, they will just redefine the combined list as well. Would that 
work?


Denis


The way the user specifies TOC depth in Org is e.g. "#+OPTIONS: toc:2". 
All exporters support that method.


Jason
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Setting table of contents depth by number rather than by list

2021-12-24 Thread Jason Ross via ntg-context

Dear list,

Is it possible to set the maximum table of contents depth to a number 
rather than providing an explicit list of section names?



Background:

I am developing an exporter for Org mode. In Org, users can specify the 
number of levels they want in the table of contents with a number. I 
currently do this by having the sectioning commands be known to the 
exporter so I can generate a command like

\setupcombinedlist
  [content]
  [list={section,subsection}]
for n=2.

I'm considering using  \start/stopsectionlevel for sectioning commands 
instead. That way, users could add \definesectionlevels to the document 
preamble to use whatever sectioning scheme they wanted. However, this 
would mean that the exporter wouldn't know what sectioning commands to 
use the TOC setup.



Thanks,

Jason
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] SVG not rendering correctly with LMTX and conversion=mp

2021-10-18 Thread Jason Ross via ntg-context



On 10/18/21 8:38 AM, Luis Montgomery wrote:
> Check that your Inkscape is working properly.
>
> That proble NOT appear  on my machine...
>
> Best,
>
> L. Montgomery

(Sorry Luis, I forgot to cc mailing list)
Per https://wiki.contextgarden.net/Command/externalfigure,
in LMTX the conversion is done natively when "conversion=mp" is set.
Inkscape is not used for the conversion.
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] SVG not rendering correctly with LMTX and conversion=mp

2021-10-18 Thread Jason Ross via ntg-context

The following MWE fails to render the text in the attached SVG properly:


\starttext
\externalfigure[test.svg][conversion=mp]
\stoptext


The axis labels, tick labels, and title are all incorrect. This file was
generated with Matplotlib.
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Memo module not working with lmtx

2021-10-15 Thread Jason Ross via ntg-context
I made a mistake with the MWE for the mailing list, however, corrected 
MWE gives same error:


\usemodule[memo]

\setupmemo[
name={Jason Ross},
opening={People of Earth},
closing={Thanks for all the Fish,},
signature={The Dolphins}]
\starttext
\startmemo
  We are writing to let you know that we are all leaving
\stopmemo
\stoptext



tex error   > tex error on line 197 in file 
/home/jason/.local/context/tex/texmf-modules/tex/context/third/letter/base/s-cor-02.mkvi: 
Undefined control sequence \???memosectionrenderings



\???memosectionrenderings
\v!head :\v!memo
 \syst_setups_start_tex_two
#1#2#+\stopsetups ->\endgroup \dodoglobal \instance \defcsname 
\??setup #1:#2

\endcsname #1{#3}

\stopsetups

187 \stopsetups
188
189 \startsetups[\???memosectionrenderings\v!head:\v!memo]
190   \def\\{\correspondencesectionparameter\c!separator}
191   \startpacked
192 
\doifsomething{\correspondenceparameter\c!fromname}{\memotext\c!fromname 
\correspondenceparameter\c!fromname \par}
193   \doifsomething{\correspondenceparameter\c!date 
}{\memotext\c!date \correspondenceparameter\c!date \par}
194   \doifsomething{\correspondenceparameter\c!toname 
}{\memotext\c!toname   \correspondenceparameter\c!toname   \par}
195   \doifsomething{\correspondenceparameter\c!subject 
}{\memotext\c!subject  \correspondenceparameter\c!subject  \par}

196   \stoppacked
197 >>  \stopsetups
198
199 \unexpanded\def\correspondence_memo_head_table#element%
200   {\doifsomething{\correspondenceparameter#element}
201  {\NC % label
202 \def\currentcorrespondencestyle{\v!memo:#element}%
203 
\usecorrespondencestylestyleandcolor\c!titlestyle\c!titlecolor

204 \memotext#element
205   \EQ % text
206 \def\currentcorrespondencestyle{\v!memo:#element}%
207 \usecorrespondencestylestyleandcolor\c!textstyle\c!textcolor
The control sequence at the end of the top line of your error message 
was never

\def'ed. You can just continue as I'll forget about whatever was undefined.
mtx-context | fatal error: return code: 256
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Memo module not working with lmtx

2021-10-15 Thread Jason Ross via ntg-context

Hello,

The Letter module seems to also include a module for memos.
The following MWE fails with version 2021.10.10 23:43:

\usemodule[memo]

\setupmemo[
opening={People of Earth},
closing={Thanks for all the Fish,},
signature={The Dolphins}]
\startmemo
\startletter
  We are writing to let you know that we are all leaving
\stopmemo
\stoptext



The following error is thrown by ConTeXt:

tex error   > tex error on line 197 in file 
/home/jason/.local/context/tex/texmf-modules/tex/context/third/letter/base/s-cor-02.mkvi: 
Undefined control sequence \???memosectionrenderings



\???memosectionrenderings
\v!head :\v!memo
 \syst_setups_start_tex_two
#1#2#+\stopsetups ->\endgroup \dodoglobal \instance \defcsname 
\??setup #1:#2

\endcsname #1{#3}

\stopsetups

187 \stopsetups
188
189 \startsetups[\???memosectionrenderings\v!head:\v!memo]
190   \def\\{\correspondencesectionparameter\c!separator}
191   \startpacked
192 
\doifsomething{\correspondenceparameter\c!fromname}{\memotext\c!fromname 
\correspondenceparameter\c!fromname \par}
193   \doifsomething{\correspondenceparameter\c!date 
}{\memotext\c!date \correspondenceparameter\c!date \par}
194   \doifsomething{\correspondenceparameter\c!toname 
}{\memotext\c!toname   \correspondenceparameter\c!toname   \par}
195   \doifsomething{\correspondenceparameter\c!subject 
}{\memotext\c!subject  \correspondenceparameter\c!subject  \par}

196   \stoppacked
197 >>  \stopsetups
198
199 \unexpanded\def\correspondence_memo_head_table#element%
200   {\doifsomething{\correspondenceparameter#element}
201  {\NC % label
202 \def\currentcorrespondencestyle{\v!memo:#element}%
203 
\usecorrespondencestylestyleandcolor\c!titlestyle\c!titlecolor

204 \memotext#element
205   \EQ % text
206 \def\currentcorrespondencestyle{\v!memo:#element}%
207 \usecorrespondencestylestyleandcolor\c!textstyle\c!textcolor
The control sequence at the end of the top line of your error message 
was never

\def'ed. You can just continue as I'll forget about whatever was undefined.
mtx-context | fatal error: return code: 256
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Converting LaTeX math to ConTeXt

2021-10-14 Thread Jason Ross via ntg-context



On 10/12/21 8:31 PM, Aditya Mahajan wrote:


This is an issue with ConTeXt, but most of these issues are minor are easy to 
fix. Just send minimal examples showing the incorrect rendering.

Aditya




An example is attached.
MathML generated with

pandoc -f latex -t html --mathml sample-math.tex \
| xmlstarlet ed -d "//*[local-name()='annotation']" \
| xmlstarlet sel -t -c "/p/*" \
| xmlstarlet ed -m "//*[local-name()='semantics']/*" \
"//*[local-name()='math']" \
| xmlstarlet ed -d "//*[local-name()='semantics']"
\usemodule[mathml]
\starttext
\startplaceformula
  \startformula
\xmlprocessdata{}{
  
  http://www.w3.org/1998/Math/MathML; display="block">

  
[

  

  
R

  1
  x

  

  
  

  
R

  1
  y

  

  
  

  
F

  2
  x

  

  
  

  
F

  2
  y

  

  
  

  
R

  3
  x

  

  
  

  
R

  3
  y

  

  
  

  
R

  4
  x

  

  
  

  
R

  4
  y

  

  

]
  
  =
  
[

  

  

  
A
1
  
  
E
1
  


  L
  1

  


  0


  
  

  
A
1
  
  
E
1
  


  L
  1

  


  0


  0


  0


  0


  0

  
  

  0


  0


  0


  0


  0


  0


  0


  0

  
  

  
  

  
A
1
  
  
E
1
  


  L
  1

  


  0


  

  
A
1
  
  
E
1
  


  L
 

Re: [NTG-context] Converting LaTeX math to ConTeXt

2021-10-12 Thread Jason Ross via ntg-context



On 10/11/21 4:02 PM, Aditya Mahajan wrote:

You can use pandoc to parse latex and convert it to mathml:

Processing this in context (see attached files), gives a partially working 
solution. It doesn't look okay, but should be easily fixable.

Do note that this is almost same as compiling latex output to PDF because 
editing presentation mathml by hand is no fun.


Hmm. Looks like converting to MathML isn't going to work just yet.
Is this an issue with ConTeXt? The MathML seems to render correctly in
LibreOffice but gets mangled when exporting to ConTeXt.

I'll explore some of the alternatives you suggested. A simple parser
will be fine for now. Thank you the help.

Best Regards,

Jason
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Converting LaTeX math to ConTeXt

2021-10-10 Thread Jason Ross via ntg-context

On 10/10/21 3:23 AM, Hans Hagen wrote:


what do you mean with 'quite different'

Hans


Hi Hans,

My current stumbling block is dealing with the `align` environment.
I replace `\begin{align}/\end{align}` with
`\startmathalignment/\stopmathalignment`, and replace all `&` characters
with `\NC` and `\\` with `\NR`, which is simple enough.
However, the two commands work differently - `align` doesn't care
how many columns you have, but `mathalignment` does. This makes dealing
with aligned equations containing matrices hard - you can't just count
how many `&`s you see before you get to a `\\`, because you might be
inside of a matrix in which case they don't count.

Also, `mathalignment` and `matrix` want a leading `\NC` to start each
column, while LaTeX `align` and `matrix` just want `&` as a column
separator.

These are just a couple examples, but in general it's not enough to do
naive string substitution in LaTeX and get valid ConTeXt back, and my
patchwork solutions are starting to smell.

Thanks,

Jason
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Converting LaTeX math to ConTeXt

2021-10-09 Thread Jason Ross via ntg-context

Hello,

I'm trying to provide more support for LaTeX math for an Org Mode
exporter for ConTeXt. LaTeX is the de facto standard for mathematics in
Org Mode. However, the syntax is quite different between LaTeX and
ConTeXt. I have a few ideas, but none that I'm happy about.

1. Export LaTeX to MathML then import that into ConTeXt. I don't know
   how to get this to work. latexmlmath only returns the first row of
   `align` environments (for me anyway). Also, this would require users
   to install another program.
2. Typeset equations with LaTeX as standalone pages and then include
   them as images. This will typeset everything with LaTeX defaults.
   Also, either equation alignment or equation numbering will break.
3. Hack every math environment I can think of to accept LaTeX syntax
   (see https://wiki.contextgarden.net/LaTeX_Math_in_ConTeXt). Lots
   of work, lots of problems as described in the article. End-users
   could add their own hacks to the template preamble for cases I
   don't get to.
4. Manually parse and convert every LaTeX math environment to ConTeXt
   before exporting. Basically a non-starter.

I'm wondering what's the best way to go about this. Surely others have
run into the same problem?

Thanks,

Jason
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] ConTeXt exporter for Org Mode

2021-08-10 Thread Jason Ross via ntg-context
Hello,

I have developed a ConTeXt exporter for Org Mode. It is available at
https://github.com/Jason-S-Ross/ox-context

The exporter provides custom environments for each Org Mode entity
in an effort to make customization easier, in contrast to the Pandoc
exporter which uses built-in environments for document elements.

I appreciate any feedback.

Thanks,
Jason
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___