ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Converting from LaTeX for PDF accessibility tagging?
@ 2020-06-28 11:43 Alasdair McAndrew
  2020-06-28 16:26 ` Aditya Mahajan
  0 siblings, 1 reply; 4+ messages in thread
From: Alasdair McAndrew @ 2020-06-28 11:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1511 bytes --]

Hello,

I tried ConTeXt a few years ago, then gave up on it because of its
wordiness and verbosity.  The 2006 article on creating AMSTeX output in
ConTeXt at https://www.ntg.nl/maps/34/06.pdf shows exactly what I mean: the
LaTeX commands are small and neat; the ConTeXt commands are not.

However, I need now to use ConTeXt for accessibility tagging, so I'm
prepared to give it another try.  And this means converting some LaTeX
documents into ConTeXt.  Is there a better way than using pandoc?  I ran a
LaTeX document through pandoc, but the result is certainly not fully
"ConTeXt compliant", and generates errors instead of compiling.

I can get easily lost on the ConTeXt site: the documentation is there in
plenty, but seems hard to search.  The main problem for me is mathematics
and alignment: not just for equations, but for matrices and arrays.  What
I'd love - if it exists - is a document showing how to rewrite LaTeX into
ConTeXt.  Something like the above document, which is now 14 years old.

I also notice that much of the contextgarden wiki is outdated.  For
example, on the use of ConTeXt in MikTeX, we read "As of end of June 2011
MikTeX is still (or again) non-functional."  I'm aware that all of this is
the work of dedicated and unpaid volunteers, so this is not a complaint!
Just an observation.

Anyway, as I say, my main issues are converting LaTeX into ConTeXt. and
dealing with mathematics.  Any pointers would be gratefully received!

Thanks,
Alasdair
-- 
https://numbersandshapes.net

[-- Attachment #1.2: Type: text/html, Size: 2406 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Converting from LaTeX for PDF accessibility tagging?
  2020-06-28 11:43 Converting from LaTeX for PDF accessibility tagging? Alasdair McAndrew
@ 2020-06-28 16:26 ` Aditya Mahajan
  2020-06-29  0:32   ` Alasdair McAndrew
  0 siblings, 1 reply; 4+ messages in thread
From: Aditya Mahajan @ 2020-06-28 16:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, 28 Jun 2020, Alasdair McAndrew wrote:

> I tried ConTeXt a few years ago, then gave up on it because of its
> wordiness and verbosity.  The 2006 article on creating AMSTeX output in
> ConTeXt at https://www.ntg.nl/maps/34/06.pdf shows exactly what I mean: the
> LaTeX commands are small and neat; the ConTeXt commands are not.

As explained in the last paragraph, there are pre-built shortcuts for the main alignments and you can define your own to match amsmath style, if you wish.

If you are worried about typing, look into tab completion for your editor of choice. For example, in vim, I can do `for<Tab>` which expands to `\startformula ... \stopformula` and `fora<Tab>` expands to `\startformula \startalign ... \stopalign \stopformula`.

> However, I need now to use ConTeXt for accessibility tagging, so I'm
> prepared to give it another try.  And this means converting some LaTeX
> documents into ConTeXt.  Is there a better way than using pandoc?  I ran a
> LaTeX document through pandoc, but the result is certainly not fully
> "ConTeXt compliant", and generates errors instead of compiling.

AFAIK, pandoc is not aware of context math. When I convert latex to context, I find it simpler to do it some hand written regex which translate commands according to my writing style.

> I can get easily lost on the ConTeXt site: the documentation is there in
> plenty, but seems hard to search.  The main problem for me is mathematics
> and alignment: not just for equations, but for matrices and arrays.  What
> I'd love - if it exists - is a document showing how to rewrite LaTeX into
> ConTeXt.  Something like the above document, which is now 14 years old.

The user-interface is still the same.

> Anyway, as I say, my main issues are converting LaTeX into ConTeXt. and
> dealing with mathematics.  Any pointers would be gratefully received!

Can you post an example of LaTeX math that you are having difficulty in converting? It is hard to answer this in the abstract.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Converting from LaTeX for PDF accessibility tagging?
  2020-06-28 16:26 ` Aditya Mahajan
@ 2020-06-29  0:32   ` Alasdair McAndrew
  2020-06-29  1:29     ` Aditya Mahajan
  0 siblings, 1 reply; 4+ messages in thread
From: Alasdair McAndrew @ 2020-06-29  0:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3242 bytes --]

Thank you very much - I think the problem was with a LaTeX "align"
environment which pandoc translated into a setting which  ConTeXt didn't
recognize.  These equations were monsters, so I'll try with simpler
equations to give you an idea.  But in fact what you say makes perfect
sense, and I'll go back and read through the mathematics document again,
and more closely this time!

(For matrices and arrays I still prefer the neat LaTeX implementation, but
maybe that's simply my general unfamiliarity with ConTeXt.)  Thanks again!

Alasdair

On Mon, Jun 29, 2020 at 2:27 AM Aditya Mahajan <adityam@umich.edu> wrote:

> On Sun, 28 Jun 2020, Alasdair McAndrew wrote:
>
> > I tried ConTeXt a few years ago, then gave up on it because of its
> > wordiness and verbosity.  The 2006 article on creating AMSTeX output in
> > ConTeXt at https://www.ntg.nl/maps/34/06.pdf shows exactly what I mean:
> the
> > LaTeX commands are small and neat; the ConTeXt commands are not.
>
> As explained in the last paragraph, there are pre-built shortcuts for the
> main alignments and you can define your own to match amsmath style, if you
> wish.
>
> If you are worried about typing, look into tab completion for your editor
> of choice. For example, in vim, I can do `for<Tab>` which expands to
> `\startformula ... \stopformula` and `fora<Tab>` expands to `\startformula
> \startalign ... \stopalign \stopformula`.
>
> > However, I need now to use ConTeXt for accessibility tagging, so I'm
> > prepared to give it another try.  And this means converting some LaTeX
> > documents into ConTeXt.  Is there a better way than using pandoc?  I ran
> a
> > LaTeX document through pandoc, but the result is certainly not fully
> > "ConTeXt compliant", and generates errors instead of compiling.
>
> AFAIK, pandoc is not aware of context math. When I convert latex to
> context, I find it simpler to do it some hand written regex which translate
> commands according to my writing style.
>
> > I can get easily lost on the ConTeXt site: the documentation is there in
> > plenty, but seems hard to search.  The main problem for me is mathematics
> > and alignment: not just for equations, but for matrices and arrays.  What
> > I'd love - if it exists - is a document showing how to rewrite LaTeX into
> > ConTeXt.  Something like the above document, which is now 14 years old.
>
> The user-interface is still the same.
>
> > Anyway, as I say, my main issues are converting LaTeX into ConTeXt. and
> > dealing with mathematics.  Any pointers would be gratefully received!
>
> Can you post an example of LaTeX math that you are having difficulty in
> converting? It is hard to answer this in the abstract.
>
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
>
> ___________________________________________________________________________________
>


-- 
https://numbersandshapes.net

[-- Attachment #1.2: Type: text/html, Size: 4494 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Converting from LaTeX for PDF accessibility tagging?
  2020-06-29  0:32   ` Alasdair McAndrew
@ 2020-06-29  1:29     ` Aditya Mahajan
  0 siblings, 0 replies; 4+ messages in thread
From: Aditya Mahajan @ 2020-06-29  1:29 UTC (permalink / raw)
  To: jmailing list for ConTeXt users

On Mon, 29 Jun 2020, Alasdair McAndrew wrote:

> (For matrices and arrays I still prefer the neat LaTeX implementation, but
> maybe that's simply my general unfamiliarity with ConTeXt.)  Thanks again!

Matrices can also be entered using MATLAB syntax (you need to specify a `simplecommand` for mathmatrix:

\definemathmatrix[bmatrix][matrix:brackets][simplecommand=BMATRIX]

\starttext

Default style:

\startformula
   \startbmatrix
     \NC 1 \NC 2 \NC 3 \NR
     \NC 4 \NC 5 \NC 6 \NR
     \NC 7 \NC 8 \NC 9 \NR
   \stopbmatrix
\stopformula

Compact style:

\startformula
   \BMATRIX{1, 2, 3; 4, 5, 6; 7, 8, 9}
\stopformula

\stoptext

I'd say this is more compact (and natural) than amsmath :-)

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-29  1:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-28 11:43 Converting from LaTeX for PDF accessibility tagging? Alasdair McAndrew
2020-06-28 16:26 ` Aditya Mahajan
2020-06-29  0:32   ` Alasdair McAndrew
2020-06-29  1:29     ` Aditya Mahajan

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).