From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/22119 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: sonya.mamurin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Newsgroups: gmane.text.pandoc Subject: Re: How to get a page break (/f) from Markdown -> docx? Date: Fri, 15 Feb 2019 10:17:27 -0800 (PST) Message-ID: References: <65081506-a54b-4aff-96a0-d8e1cb6accc2@googlegroups.com> <2085f4cb-d713-4975-a739-9ad775cd37c4@googlegroups.com> <20150420171718.GB49983@localhost.hsd1.ca.comcast.net> <86515234-38b7-4fa5-8d21-0c94fe3cf9f6@googlegroups.com> <253add6a-b873-4a1c-ad97-3dadf4c7ed1f@googlegroups.com> <20150422154425.GC52517@localhost.hsd1.ca.comcast.net> <2f0fdd14-9f3e-4aa7-9d9c-756cc82f3a5d@googlegroups.com> <6ecc8d08-7c6d-4e76-8b35-004176e6af4b@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_490_98710569.1550254647891" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="137778"; mail-complaints-to="usenet@blaine.gmane.org" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDIMPNGY3YLRBOMETTRQKGQEYP4V5CQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Feb 15 19:17:31 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-qt1-f187.google.com ([209.85.160.187]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1gui3G-000Zgj-W3 for gtp-pandoc-discuss@m.gmane.org; Fri, 15 Feb 2019 19:17:31 +0100 Original-Received: by mail-qt1-f187.google.com with SMTP id q3sf9773983qtq.15 for ; Fri, 15 Feb 2019 10:17:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=4OeIR56EERQX4FbYaYdg/df67jTPxv/gl2JFI7CsD44=; b=GRJnPhOJNxROrTsJy1e5J7RmYhadqd91cBQmP6CslN4pj1k5AJT+JqOXe8goEcOIP1 mzIr9JiNJNkZhFedxLI4BAIHoPJVBaPYvFK1Pb1OpscEL1m/J0bmrUcPyTj08ot429lZ wj4SSKNd5tSfXwnUvf/uRN5QG9bKqDO+fAZQI/iSPQmisSpILt0yBdzF/a2eZJHhkyY6 LZP1j9ChGir/3DGt/c4VHfohRjrwYHFtYo7JcwO8+yqRcLJFS+HTH0AC6lJr2L9AJ/Oh OSY/XxZCzHcgnrVPYLYtakegdc3IVkcTDi5siDE8Mj+vwzVvlsKcLWpRIhKKpPAX87pz xrvw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=4OeIR56EERQX4FbYaYdg/df67jTPxv/gl2JFI7CsD44=; b=KvdOMFIEFKccZeEIU09Ge7qHShudu92CvSDtHBkxgfcgOOYqh35EmHD7VVQ+otG8r7 QswPoJB+QQSLwId0nCodLRr54JGC2F7P6rQdsCSOh7vkJumY48EjovnR+bd8J7KPN/2m Rf3KvrtZLJSvpnFAjv1dD8qfrurExX3nHFMtd4+Mn3YsnMvj/8hZZdl65YqI6/Mk/097 MtboWRxUJe5SQs3NnE/Zj8l+erTg0SFoPu2dFlUAsws+d0y6VZsEyeZaMNOv5Qbbk0Us AzfgdKKgyBasmiybGfbVMnl0rIrl7wh9hgcYQ/DlFKP6IAgJQ7PYwqFDzvvwsv+Fc3Lb qwag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=4OeIR56EERQX4FbYaYdg/df67jTPxv/gl2JFI7CsD44=; b=PNL6E63bfJzPKB7NSoasN3HyfjpKD3Z/v+ew0R9W5FgZjGKG2qrbyVsDbC85s5LLm/ FFAPGBrAOxcPX03heIbXH6o8/tO1zzSMrjWt0a3XMxYY11GxJnYX4GSKmfaEU5GHGgJo XXpu0qA0qX+TMmT86LXaI5QdjajGhZDqFCFVckXojrH9zSzHBFStJ69C9H1nCHpuwv3n Pv39RKXHUMfYx7Z9EWCP0YkR/potB8BeqPSOR7BVxCtlTaMw8Eb4X+yktV7io4Q5llbx ZrL54TNNxrJODjnJbeYrGy9oSU8UO76H5LbGAe0BdmPd5WzhIcm81JSQlvh1PukQXt/A SjWw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AHQUAuZ7kCtasol7qB0lWXwcuwRzpgNhGynNXKCfUmNsJ/8XRhIsTaLP EXpAw9YoSFhObhMhfBoH9hg= X-Google-Smtp-Source: AHgI3IYgiKGMXmK3ymSK/GIJ5Gct+eTdSTZCxdxdROtMhhsL/okdlKWwiC27AkJjUtHJKl5m6wTJFw== X-Received: by 2002:ac8:f28:: with SMTP id e37mr96569qtk.0.1550254649514; Fri, 15 Feb 2019 10:17:29 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:ae9:ec05:: with SMTP id h5ls3321803qkg.2.gmail; Fri, 15 Feb 2019 10:17:28 -0800 (PST) X-Received: by 2002:a37:9547:: with SMTP id x68mr96373qkd.2.1550254648726; Fri, 15 Feb 2019 10:17:28 -0800 (PST) In-Reply-To: X-Original-Sender: sonya.mamurin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:22119 Archived-At: ------=_Part_490_98710569.1550254647891 Content-Type: multipart/alternative; boundary="----=_Part_491_319534660.1550254647892" ------=_Part_491_319534660.1550254647892 Content-Type: text/plain; charset="UTF-8" Hello again. If I try to insert RawInline instead I get an extra space instead of an extra \n.. I solved it using a bash script: #! /bin/env bash INPUT=$1 REGEX='ParagraphBreakType="NextFrame"' for i in $(seq $(grep -c "$REGEX" $INPUT)) do LINENUMBER=$(sed -n "/$REGEX/=" "$INPUT" | sed -n "${i}p") PRE=$((LINENUMBER - 1)) SUC=$((LINENUMBER + 1)) sed -i "${PRE}d; ${SUC}d" $INPUT done It finds lines with the framebreak and removes the line before and after that line. If someone knows a better way please let me know :). Best, A On Monday, 21 January 2019 22:07:28 UTC+1, sonya....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > Hi! > > I've been trying to get frame breaks to work from markdown to ICML. I > first tried to insert the XML directly into the markdown, but the problem I > have is that I get a
after the inserted raw XML, so the frame begins > with a blank line. I tried to use your script (with NextColumn changed to > NextFrame, it works but gives the same
after the inserted XML. > > Does anyone have any suggestions how to get around that? I have tried to > not have empty lines before and after the \\FRAMEBREAK but then the text > isn't replaced with XML. > > Best, > A > > On Tuesday, 13 June 2017 13:03:24 UTC+2, endymion...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: >> >> Dear fellows, >> I just wanted to thank you for the code I found on this discussion and >> for every contribution. Unfortunately I have absolutely zero knowledge of >> Haskell, but with a minimal edit to your code, I managed to make a little >> filter to enable forwarding a custom page break command from Markdown to >> ICML. >> I needed this very much for my master's thesis. I am very grateful for >> your sharing your knowledge. The code I used is this. >> >> #!/usr/bin/env runhaskell >> -- icmlpagebreaks.hs >> >> import Text.Pandoc.JSON >> import Text.Pandoc >> import Text.Pandoc.Walk (walk) >> >> pgBrkIcml :: String >> pgBrkIcml = " > AppliedCharacterStyle=\"CharacterStyle/$ID/[No character style]\" >> ParagraphBreakType=\"NextColumn\">
" >> >> pgBrkBlock :: Block >> pgBrkBlock = RawBlock (Format "icml") pgBrkIcml >> >> insertPgBrks :: Block -> Block >> insertPgBrks (Para [Str "\\PAGEBREAK"]) = pgBrkBlock >> insertPgBrks blk = blk >> >> main = toJSONFilter insertPgBrks >> >> At the moment, it looks like it's working. I hope it is correct. Thank >> you again, cheers >> >> David >> > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/d560de22-bbac-40e0-ae25-75f02627175d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_491_319534660.1550254647892 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello again.

If I try to insert RawInli= ne instead I get an extra space instead of an extra \n..

I solved it using a bash script:
#! /bin/e= nv bash

INPUT=3D$1
REGEX= =3D'ParagraphBreakType=3D"NextFrame"'

for i in $(seq $(grep -c "$REGEX" $INPUT))
do
=C2=A0 =C2=A0 LINENUMBER=3D$(sed -n "/$REGEX/=3D" "$I= NPUT" | sed -n "${i}p")
=C2=A0 =C2=A0 PRE=3D$((LIN= ENUMBER - 1))
=C2=A0 =C2=A0 SUC=3D$((LINENUMBER + 1))
= =C2=A0 =C2=A0 sed -i "${PRE}d; ${SUC}d" $INPUT
done

It finds lines with the framebreak and removes the line = before and after that line.

If someone knows a bet= ter way please let me know :).

Best,
A
On Monday, 21 January 2019 22:07:28 UTC+1, sonya....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote= :
Hi!

=
I've been trying to get frame breaks to work from markdown t= o ICML. I first tried to insert the XML directly into the markdown, but the= problem I have is that I get a <Br /> after the inserted raw XML, so= the frame begins with a blank line. I tried to use your script (with NextC= olumn changed to NextFrame, it works but gives the same <Br /> after = the inserted XML.

Does anyone have any suggestions= how to get around that? I have tried to not have empty lines before and af= ter the \\FRAMEBREAK but then the text isn't replaced with XML.

Best,
A

On Tuesday, 13 June 2017 13:03:2= 4 UTC+2, endymion...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
Dear fellows,
I just wanted to thank you for= the code I found on this discussion and for every contribution. Unfortunat= ely I have absolutely zero knowledge of Haskell, but with a minimal edit to= your code, I managed to make a little filter to enable forwarding a custom= page break command from Markdown to ICML.
I needed this very much for = my master's thesis. I am very grateful for your sharing your knowledge.= The code I used is this.

#!/usr/bin/env runhaskell
-- icmlpagebreaks.hs

imp= ort Tex= t.Pando= c.JSON<= br>import Text= .Pandoc=
import Text.Pandoc.Walk = (walk)

= pgBrkIcml
:: String
pgBrkIcml
=3D " <CharacterStyl= eRange AppliedCharacterStyle=3D\"CharacterStyle/$ID/[No character= style]\" ParagraphBreakType=3D\"NextColumn\"><Br= /></CharacterStyleRange> "

pgBrkBlock
:: Block
pgBrkBlock
=3D RawBlock (Format "icml"= ) pgBrkIcml

insertPgBrks
<= span style=3D"color:#660">::
Block
-> Block
insertPgBrks=
(Para<= /span> [Str "\\PAGEBREAK"]) =3D pgBrkBlock
insertPgBrks blk =3D blk
main
=3D toJSONFilter insertPgBrks

At the = moment, it looks like it's working. I hope it is correct. Thank you aga= in, cheers

David

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/= msgid/pandoc-discuss/d560de22-bbac-40e0-ae25-75f02627175d%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_491_319534660.1550254647892-- ------=_Part_490_98710569.1550254647891--