public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Uwe Brauer <oub-YB6e1s5WF/He5aOfsHch1g@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re:
Date: Thu, 24 Aug 2017 16:26:01 +0000	[thread overview]
Message-ID: <87378h53vq.fsf@mat.ucm.es> (raw)
In-Reply-To: <20170823205425.GE56323@protagoras.berkeley.edu>

>>> "John" == John MACFARLANE <jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> writes:

   > +++ Uwe Brauer [Aug 23 17 16:13 ]:
   >> I wouldn't mind to download and compile the dev version of pandoc.
   >> But how am I supposed to do it with that version?

   > With dev pandoc,

   > pandoc -t native -f latex
   > \label{hi}
   > [Para [Span ("hi",[],[("label","hi")]) [Str "[hi]"]]]

   > So your filter could pattern match on a Span with
   > label attribute:

   > go (Math _ _) = Str "FORMULA"
   > go (Span (_,_,[("label",_)]) _) = Str "LABEL"
   > go x = x

I just found out that I have a compiled version from march this year.

,----
| pandoc 1.19.2.1
| Compiled with pandoc-types 1.17.0.4, texmath 0.9, skylighting 0.1.1.4
| Default user data directory: /home/oub/.pandoc
| Copyright (C) 2006-2016 John MacFarlane
| Web:  http://pandoc.org
| This is free software; see the source for copying conditions.
| There is no warranty, not even for merchantability or fitness
| for a particular purpose.
`----

So I hoped this is recent enough.
I now considered the following stripmath.hs file
,----
| import Text.Pandoc.JSON
|     
| main = toJSONFilter stripmath
|     where stripmath (Math _ _) = Str "FORMULA"
|           stripmath x = x
| go (Math _ _) = Str "FORMULA"
| go (Span (_,_,[("label",_)]) _) = Str "LABEL"
| go x = x
`----
then I did
ghc --make stripmath.hs

And after compilation

/home/oub/.local/bin/pandoc eulerpoisson.tex -t json | /home/oub/scripts/Strip2/stripmath | pandoc -f json -t plain -o euler-grammar.tex

But I obtainedstripmath: Error in $: expected product (:*:), encountered Object
pandoc: Error in $: not enough input

Sorry for this elementary question.

Uwe Brauer 


  reply	other threads:[~2017-08-24 16:26 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 14:26 latex to html or plain text without any latex construct Uwe Brauer
     [not found] ` <87r2w5xaie.fsf-YB6e1s5WF/He5aOfsHch1g@public.gmane.org>
2017-08-21 21:00   ` John MACFARLANE
2017-08-22 12:20     ` Uwe Brauer
     [not found]       ` <871so3yet8.fsf-YB6e1s5WF/He5aOfsHch1g@public.gmane.org>
2017-08-22 17:50         ` John MACFARLANE
2017-08-22 20:16           ` Uwe Brauer
     [not found]             ` <878tibz7c2.fsf-YB6e1s5WF/He5aOfsHch1g@public.gmane.org>
2017-08-23  0:09               ` John MacFarlane
2017-08-23 12:22                 ` [SOLVED, almost] (was: latex to html or plain text without any latex construct) Uwe Brauer
     [not found]                   ` <87k21uwk14.fsf_-_-YB6e1s5WF/He5aOfsHch1g@public.gmane.org>
2017-08-23 14:15                     ` John MacFarlane
2017-08-23 16:13                       ` Uwe Brauer
     [not found]                         ` <8760dew9da.fsf-YB6e1s5WF/He5aOfsHch1g@public.gmane.org>
2017-08-23 20:54                           ` Re: John MACFARLANE
2017-08-24 16:26                             ` Uwe Brauer [this message]
     [not found]                               ` <87378h53vq.fsf-YB6e1s5WF/He5aOfsHch1g@public.gmane.org>
2017-08-24 16:43                                 ` Re: John MACFARLANE
2017-08-24 17:30                                   ` Re: Uwe Brauer
     [not found]                                     ` <87y3q850vx.fsf-YB6e1s5WF/He5aOfsHch1g@public.gmane.org>
2017-08-24 17:56                                       ` Re: John MACFARLANE
2017-08-24 16:44                                 ` Re: John MACFARLANE
2017-08-24 17:32                                   ` Re: Uwe Brauer
2017-08-23 14:15                     ` (was: latex to html or plain text without any latex construct) John MacFarlane
2017-08-23 16:13                       ` Uwe Brauer
2018-01-31 13:43 pandoc 2.1.1 64 bit Ubuntu: Could not find module `Text.Pandoc.JSON' Uwe Brauer
2018-01-31 16:30 ` [installed from source] (was: pandoc 2.1.1 64 bit Ubuntu: Could not find module `Text.Pandoc.JSON') Uwe Brauer
2018-01-31 17:54   ` John MacFarlane
2018-01-31 19:03     ` Uwe Brauer
2018-02-08 11:34 Ubuntu 16.04 pandoc installation via cabal fails Uwe Brauer
2018-02-08 21:15 ` John MACFARLANE
2018-02-10 10:58   ` [compiled filter does not work anymore] (was: Ubuntu 16.04 pandoc installation via cabal fails) Uwe Brauer
2018-02-12  6:02     ` John MacFarlane
2018-02-13 11:07       ` Uwe Brauer
     [not found]         ` <873725jggo.fsf-YB6e1s5WF/He5aOfsHch1g@public.gmane.org>
2018-02-13 17:12           ` Re: John MacFarlane
2018-02-13 17:46             ` Re: Uwe Brauer
2018-02-15  8:53             ` [Bug/Error in latex reader, but syntax ok] (was: ) Uwe Brauer
2018-02-15 18:02               ` John MacFarlane
2018-02-17 17:59                 ` Uwe Brauer
2018-02-13 18:32           ` Re: Jesse Rosenthal
     [not found]             ` <c5aa96f9-40a0-6ebc-c376-6d1d7b695921@mat.ucm.es>
     [not found]               ` <c5aa96f9-40a0-6ebc-c376-6d1d7b695921-YB6e1s5WF/He5aOfsHch1g@public.gmane.org>
2018-02-13 19:00                 ` Re: Jesse Rosenthal
2018-02-13 21:48                   ` Re: Uwe Brauer
2018-02-13 21:43             ` Re: Uwe Brauer
2019-04-25  1:09 (unknown) lcy1980.ly
     [not found] ` <5cc108ce.1c69fb81.7cd5a.f1b5-ATjtLOhZ0NVl57MIdRCFDg@public.gmane.org>
2019-04-25  1:27   ` Xing GUO
2019-04-25  7:02   ` Re: Joost Kremers
2021-06-08 20:31 (unknown) T. Kurt Bond
     [not found] ` <CAN1EhV_aNcHtsaajksgMqk3+nu0spmWMkvkCSh78PyBGLng=vQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2021-06-09 15:24   ` John MacFarlane

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87378h53vq.fsf@mat.ucm.es \
    --to=oub-yb6e1s5wf/he5aofshch1g@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).