From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/23386 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: BPJ Newsgroups: gmane.text.pandoc Subject: Re: concatenating md have a page-break between in resulting docx? Date: Thu, 5 Sep 2019 22:43:37 +0200 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000000dc9c0591d461bb" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="218335"; mail-complaints-to="usenet@blaine.gmane.org" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCWMVYEK54FRBBXHYXVQKGQE76OYXQQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Sep 05 22:43:53 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-ot1-f63.google.com ([209.85.210.63]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1i5ybg-000uc0-RO for gtp-pandoc-discuss@m.gmane.org; Thu, 05 Sep 2019 22:43:53 +0200 Original-Received: by mail-ot1-f63.google.com with SMTP id d20sf1957619otp.17 for ; Thu, 05 Sep 2019 13:43:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1567716231; cv=pass; d=google.com; s=arc-20160816; b=qkB+XA03LI/75mXPRQb65Jnfy6NDeU068Sp1XhLGd/IQ1lU/Lf5AXdfXobtNAvoPKj T4Kjk4nLfKENK+CdtM9EaYPqWqM3asWfwUTbSCZLe7Lhuo3aNd3YnHY+WrqB+rPB0RwD KYfldwkDFoUbzpNUEILrUkB73eyDKCr0c0LeglVFmFi3N5WgoH4t+ILXX1RJJHUMBGOn n/ZUn1dFganAez2a64ag2z0/ytHJNskbXO2xI2mG4sISrYb6dMT9bMaFLgPFr60AfJfm YEs812NF0hpSc0nUZEkdkxP3EM3wIhG1lgtdzOhN0fDoOFPGSuzb+qfwne2RSCI1R3kF YeIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date :from:in-reply-to:references:mime-version:sender:dkim-signature :dkim-signature; bh=1NbH5UkdaB4L8y6EELsc2NsA6q7kEZwSkY+4YAU3ZTw=; b=0FDX7mtkN8LOexBQX4ps36V+zQ+lBzXAlJhy49lS0oyFWmJriPAMQZBPSt/1oPy0Z0 +vY5SjuuJ2sF3rwvSoqvaDSBhN//wl/PYqb4gntaO2ZO8KoY/jkheqx+ghBvJJKyYRfv SunUICqVyC/qj48eQNLvXxpScijlgBiwc+xFcFKL/V9dTwZVz2i33GsDRzu0wcHauRm0 KiHmMHbOWUU5eNTjPm7HPN1Rag8RMcXWWoR6jZncH3/axzoJZwP3/UjiBFWiv9sR85l1 1Dy9obURRbfPRDNRc1fr9l+qVgzCL2N+xzrKtoPQRJdRWamx+gtvaTU9T9+GNVaImnAi Ve8g== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r68jB9B+; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::331 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:references:in-reply-to:from:date:message-id :subject:to:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=1NbH5UkdaB4L8y6EELsc2NsA6q7kEZwSkY+4YAU3ZTw=; b=F9ySANO1SoaugQSlWu61iub6k4Hqpkg2D6lKj7qIg7y+zxKdSVAs27O0Z7hyRSEE2e pUR6WTy2KaLUB7bpTfp3h/2MzVLH3VtowP8u+7ef+cXKMKAY93NPuQJRC7WUA3PHlfO1 LsZvwHPO2dWYonlckCSg7mTwqAK4CSZsdO/5QoA3i0Qt9LuHu2kyqMXLg5re/PNWtLka CoUESp9NTAyhyjYIYwjeCr69/s51qqkNc97FxoAoonPGw4vsUP1Qweb1lUELhDQecLqg OAvqVQC+NtnLOGzmI0xQJ4I4PbZ0xjsCyWwohtsZNPoItp4+B6G1IyCzXF0j+5my6EaW qisA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=1NbH5UkdaB4L8y6EELsc2NsA6q7kEZwSkY+4YAU3ZTw=; b=Y6KocRBbUTvMfwo1cZRK0yJ1OTTbH41RKDnOU97Zj5JWnOPlfwfHN/V7GlZnKsPEJl 2Y6Z79KvUnR6C0dIhOYRRmZQl2VXorBN4635CWyYe2//4mSXqLQ0HpJg/ri7NceElUy1 n0YggpdVwMTVZOaoUf40YpJWMFRD6gh/wcjWU7RoE/xrHWy1znpLv2RD47BjPicMeIZ7 eRcvnlb8U017de/8IRMCAAlXZYCV0Yr4+e6LqTaZ35mhVkkuDEq9j1rjKnLAIyBwsyt/ mXmRrwETz2+kdZkE95kOLV1WcgzAVS7vUMjb9iZLvPf384dA1i6A6YdcICETm2poVwN5 8nYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:references:in-reply-to:from :date:message-id:subject:to:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=1NbH5UkdaB4L8y6EELsc2NsA6q7kEZwSkY+4YAU3ZTw=; b=CmrqJW1SCjYr9qH7dMCqeCJ4oXiwhK7sgLabYiTZPq0DCVFqZYqFRUmvKE3KSQQDS/ C6IhB2aW6wjkrloRjxs1NOE/usSGOmqUG8VQ9myT4onkCzJogK1DrmfCLnjFXKpJFxI3 ouSJHM+PrCghv/C2gEgocr3g2yW6aHa6zrZPpmnm+Ci/PNEaZoTt8sYsvsdqS+7r5RZ6 3BXJAl86We36aQFa+L7pGRkrAm9aUWVQDMh0LNhLd+3kve+S9TxUPglVocf0qRHq3W5A WbTejQQ50eLy//jO9+Uh30r8VPzg1qNsGgbmp2Lda9S0THs+xbujmZUPDS+G4ITCGgI7 ZvYg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAXwgdxn+BmkIRXynX4BDEAtITefz+ZwxTL0Rh6LJ0vnGUj8NxhH JOURZmyQJi/kEZfYrCwOaxk= X-Google-Smtp-Source: APXvYqyA4MDl3L9kjTekSYt1C4cO4wQvRODvX6WmYjRMRGbkCuMr9wI9Ftza69TvB3G2LTp856kR4A== X-Received: by 2002:aca:cf51:: with SMTP id f78mr4153153oig.10.1567716231487; Thu, 05 Sep 2019 13:43:51 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:d09:: with SMTP id 9ls638043oin.9.gmail; Thu, 05 Sep 2019 13:43:50 -0700 (PDT) X-Received: by 2002:aca:b246:: with SMTP id b67mr2930733oif.177.1567716230519; Thu, 05 Sep 2019 13:43:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567716230; cv=none; d=google.com; s=arc-20160816; b=n/hnbOIWbjmc7VL5+xgvXjmwh0yQTw3h0wl0IjplwqiYVeAUuraz3Eu2IBXatrfXSE /ZtcNgymmlyoQQ3HjBK1sZkJJHNoun9mLmEf/w5ETz4l9aMTY71gdAG1RPLOSA08SBju t2MmC1pmf8rDO1EKvYv44MgQgUSr+Ezp3EQwHUPrQdyDLZ5PJ63vGPmALlxRFn6J+Xbk D4/UZBlNRB3LdE+Y7jeY08HOA/AzaAg/UrIHS524wm6/XHB4bjrj2NQByer8+F2D8uSZ zqTAvSuCpTD2KbrzqjxLLS7lEQD555Z3nqveRXbzraTK/TSjaXEj2Q+YPjdPl/Hy00hb 2QTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=X0caR3QVg8DdcqRRn/N4QGkL3t058WgKp8Zi8rrjmfw=; b=VvPM7ImeCJIg6ZEA3Pp+m49WIKvEdoTPnnvCgtlMHArrf2syynfuoQ8ZlsZOsI+rxh QBPg/LbkNKBt6opQf2ntvx92J+lZyFw6HB4QQrC6mZyiDfecIXWst63nAh4Y3wZyHb3T fZxe6FTnCpZxN67TP/xghsAG2lteUxibSxocWyRnTHzkVlEq5D3i2pl1CRPk92RBkPQF /JPFtQnUd+X10PAiLGqcw1OAyA7T58xtRLUHI/5lXX9Y9WW382B2BQk/YeheyofTuHI4 OKvNnQOHYPwrgjS4cOO5qb6f7WkCgH+12vlz2htV+ACs0W1fk2cPFOQlFCmIHgfbCKDc 5O2w== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r68jB9B+; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::331 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com. [2607:f8b0:4864:20::331]) by gmr-mx.google.com with ESMTPS id l83si136456oif.3.2019.09.05.13.43.50 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Sep 2019 13:43:50 -0700 (PDT) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::331 as permitted sender) client-ip=2607:f8b0:4864:20::331; Original-Received: by mail-ot1-x331.google.com with SMTP id s28so3635350otd.4 for ; Thu, 05 Sep 2019 13:43:50 -0700 (PDT) X-Received: by 2002:a05:6830:144c:: with SMTP id w12mr4557110otp.110.1567716230092; Thu, 05 Sep 2019 13:43:50 -0700 (PDT) In-Reply-To: X-Original-Sender: melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r68jB9B+; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::331 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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:23386 Archived-At: --00000000000000dc9c0591d461bb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable You could create a file which contains only the page break code and use some shell script or Makefile trickery to insert it between the other input file arguments. You could also use a shell script (untested!) echo "" > concat.md for arg in "$@" do if [ ${arg: -3} =3D=3D ".md" ] then cat $arg break.md >> concat.md fi done pandoc concat.md -o output.docx rm concat.md Den tors 5 sep. 2019 21:55BPJ skrev: > https://github.com/pandoc/lua-filters/tree/master/pagebreak > > Den tors 5 sep. 2019 19:25Joseph Reagle skrev: > >> >> On 9/2/19 12:03 PM, Joseph Reagle wrote: >> > There might be some hacks I can resort to in [1], but does anyone >> > have a simple solution for ensuring there's a page break between the >> > two sources in the docx file? >> >> I could do this in the shell/script, but I assume there's no inbuilt way >> to append a file like page-break.md to *each* of the input files, rather >> than the output file? >> >> >> =E2=95=B0=E2=94=80=E2=9E=A4 cat page-break.md >> ```{=3Dopenxml} >> >> ``` >> >> ``` >> =E2=95=AD=E2=94=80reagle@hom ~/joseph/2019/09 >> =E2=95=B0=E2=94=80=E2=9E=A4 pandoc -f markdown+raw_attribute --toc -A p= age-break.md -i >> 1-chap.md 2-chap.md >> ``` >> >> -- >> You received this message because you are subscribed to the Google Group= s >> "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send a= n >> email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/pandoc-discuss/db6ee278-4ed8-6e81-e42e= -5c155c412795%40reagle.org >> . >> > --=20 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 e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/CADAJKhCuGvDDSueCMNS%2BE6EW2cboz5LVQBSjPR7KmRo0Lic5bQ%40mail= .gmail.com. --00000000000000dc9c0591d461bb Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
You could create a file which contains only the page brea= k code and use some shell script or Makefile trickery to insert it between = the other input file arguments. You could also use a shell script (untested= !)

echo &quo= t;" > concat.md

= for arg in "$@"
do
= =C2=A0 =C2=A0 if [ ${arg: -3} =3D=3D ".md" ]
=C2=A0 =C2=A0 then
=C2=A0 =C2=A0 =C2=A0 cat $arg = break.md >> concat.md
=C2=A0 =C2=A0 fi
done

pan= doc concat.md -o output.docx

rm concat.md

Den tors 5 sep. 2019 21:55BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev:

<= div class=3D"gmail_quote">
Den tors 5 = sep. 2019 19:25Joseph Reagle <joseph.2011-T1oY19WcHSwdnm+yROfE0A@public.gmane.org> skrev:<= br>

On 9/2/19 12:03 PM, Joseph Reagle wrote:
> There might be some hacks I can resort to in [1], but does anyone
> have a simple solution for ensuring there's a page break between t= he
> two sources in the docx file?

I could do this in the shell/script, but I assume there's no inbuilt wa= y to append a file like page-break.md to *each* of the input files, rather = than the output file?


=E2=95=B0=E2=94=80=E2=9E=A4=C2=A0 cat page-break.md
```{=3Dopenxml}
<w:p> <w:r> <w:br w:type=3D"page"/> </w:r>= ; </w:p>
```

```
=E2=95=AD=E2=94=80reagle@hom ~/joseph/2019/09
=E2=95=B0=E2=94=80=E2=9E=A4=C2=A0 pandoc -f markdown+raw_attribute --toc -A= page-break.md -i
1-chap.md 2-chap.md
```

--
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 pandoc-discuss+unsubscribe@go= oglegroups.com.
To view this discussion on the web visit https://groups= .google.com/d/msgid/pandoc-discuss/db6ee278-4ed8-6e81-e42e-5c155c412795%40r= eagle.org.

--
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 view this discussion on the web visit https://group= s.google.com/d/msgid/pandoc-discuss/CADAJKhCuGvDDSueCMNS%2BE6EW2cboz5LVQBSj= PR7KmRo0Lic5bQ%40mail.gmail.com.
--00000000000000dc9c0591d461bb--