Re: [NTG-context] Setting table of contents depth by number rather than by list
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
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
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
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
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
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
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
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
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
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
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
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
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
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 ___