From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/29050 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.text.pandoc Subject: AW: No indent after horizontal rule Date: Wed, 18 Aug 2021 07:12:30 +0000 Message-ID: <23250a1cbd394d0487439d89bf180814@unibe.ch> References: <9953168b-aa53-4c75-b18b-612ddd8a3ddfn@googlegroups.com> <945bf0d5-b826-4446-a086-0b1120824e80n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_23250a1cbd394d0487439d89bf180814unibech_" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11631"; mail-complaints-to="usenet@ciao.gmane.io" To: Original-X-From: pandoc-discuss+bncBCZ27W53TUFBBZHF6KEAMGQEIDNKHMA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Aug 18 09:12:41 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wm1-f61.google.com ([209.85.128.61]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mGFkd-0002nf-8X for gtp-pandoc-discuss@m.gmane-mx.org; Wed, 18 Aug 2021 09:12:39 +0200 Original-Received: by mail-wm1-f61.google.com with SMTP id c2-20020a7bc8420000b0290238db573ab7sf1902361wml.5 for ; Wed, 18 Aug 2021 00:12:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1629270758; cv=pass; d=google.com; s=arc-20160816; b=FwpsBn8fjwuFjX3OPrXpb+n8wosNIjT/K9lLwbioXyo2fWmYXSJGhiTyNJRTSJf8Xn 990kadxTA1EF6jVCV+qSH1Ah6d8MMG7MWooKMqUBBv9Y5rTZFa2NH6OD9BruKaBjk7k9 Z+aVb4kk4WcHzpA3djq/tiZqY0c09/JUSHHomhNbVJIESCCL66w+6x6n2rUG5Tgfy5wS 5nDPAGhWjKQnDfF6tQ6ClqOKm1oIjxhBnMbXv6DaZNA8wgHvmFriDRNz/MPYr7iamid0 lY1YRikvBUQ//tsA/0z4/hcOYffI/r9+Uqg7Rj8nqlNzZueWY3qhHrMvAvWt0Rahbb4J KsTQ== 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:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:from:sender :dkim-signature; bh=MzY2feZr/JDG0Oo4UYDVSHDLn1XuCQBYypdUZ4riXHk=; b=s2mM+a6kKUGWDTwm8yMG/AdDJkjM1Ge8Sx8eRGHRACEKmLlfUVeW1+Ja8SRiiL3zlU baXKPaTz1mSJ/+GO6n4YwkKAbQRlCEIUGMfEA5qzlu9wLSbpxovkGq8d0nFvPty3Y7Vh 5Esxrasww9XZxyHGdsp2MG++bvgCaxJoCNKKUZZHsCHwzo6YzmxpaFoYGnA5Cqp6q9SI WqqIMGa3vkDOQK5X//W54OPJzJvIkUsy0nfUNVI2uCc2aqC5s+4EpUBJmxvfhbDcFLy5 ljwFjZrrNPaqZCDdtXROjFZdLVpp10M/kWJB8Ncj4/t3w6vqlrPIeAinmmd5BFh7/KAH rBwg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of denis.maier-NSENcxR/0n0@public.gmane.org designates 130.92.0.82 as permitted sender) smtp.mailfrom=denis.maier-NSENcxR/0n0@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=unibe.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:subject:thread-topic:thread-index:date:message-id :references:in-reply-to:accept-language:content-language :mime-version: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=MzY2feZr/JDG0Oo4UYDVSHDLn1XuCQBYypdUZ4riXHk=; b=Jp3H8PX/o3AIiVtrXPtU5tmTIxOzZwww29+BTfP77DKD+/ZvmziTPX4AhwwHCbsvKZ jDDkxkmMoGFCMjU5Tqh2idbybcy8JfC2nFUVQFAKdkV0nLbNlfqsROz8cV82FEtaB/Qc lacsbu81nN9FXHLmQ0IIGj4JDYhqIP+TkGrrLT6iqp6HA8N+Z+7XHGkx4BBbGsAczaO7 42qMxELYHhTq1PirHakPBpgqHWLnXLjBzYu/fC8+fO1iU22g5z/YXrOAZntZCJmGDP44 CHkp7132fVmyzS5w4zgpCnMCJrrHoEt6fgjLeqLQHy1ER99vMrBicJ+lb7q2NBMEksft wbtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:subject:thread-topic:thread-index :date:message-id:references:in-reply-to:accept-language :content-language:mime-version: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=MzY2feZr/JDG0Oo4UYDVSHDLn1XuCQBYypdUZ4riXHk=; b=S7JvWQbK+DKb59uRCNtAT+i08o/batFKwG53wrjeWZZ+cEUBW7Sl6RDLTbzfA3Vku0 BVp7zdlpTO9xZBDFUksA2hq8Rihyqzlzgl3oa7gdJcQUz61AJ9v4VKlbPxlaqHYau3As X8eHKWSWeKY7/Q5rGeo9+FXtr3b/rV1BTrLX26dLyZUBJuHTTbrfL7kaQP+g9vnMO5o7 YqyHAiBLVCDE8clkvgGoi1iINd0Z1GD6PNthCh9NwQ4Ej2PcVGzfcRfUb0sXS2kh+Djf 2qFZaZsvCUQr+cMbwlpZlbCLwI0Ftg6 Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM530rruCH8egjgdCFOJhWGyeBnSFWZzcMwluwGH9pA0zFWZSHaOMj jFJAbNcHYeZmcOYyv3nau3M= X-Google-Smtp-Source: ABdhPJzK1eE3OCUa5JRaoE5p+j97TASxwzJ3OJ7Wzkz/olkGFd71x4XPy0uzswgeUekzzedPcCJUgA== X-Received: by 2002:a5d:6186:: with SMTP id j6mr8920663wru.115.1629270758330; Wed, 18 Aug 2021 00:12:38 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:600c:1994:: with SMTP id t20ls2101446wmq.2.canary-gmail; Wed, 18 Aug 2021 00:12:35 -0700 (PDT) X-Received: by 2002:a05:600c:22d2:: with SMTP id 18mr6903907wmg.117.1629270755654; Wed, 18 Aug 2021 00:12:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629270755; cv=none; d=google.com; s=arc-20160816; b=NG3t0CxQ/VnkkQJldTQknJQY0+S0TCdWmpqab2ZAnhnGY+IbHD32741+LN4frS10MO 1DPXe9rifdPd0rURC/ZIxnw4RuKHZHMP1N01j5t0/Gn4MW82XfjHUNHj7lkRRbyG+C57 f3r732tEXl74VCU0xo8j+gr2+r+s9Zg/rrEJW2O+qHjcnMsS1ds3A5tVae5wdDUBhkpd yCt7wc4WyTSm15e+HvM7+4LtKPoSSLAD2NbVT7mY3WRmIFZJ8EZ+DsUm4ix8OwkSuLVp J+dGq3wVHNXykPqPFs6rw5C2aM0Al+Gq85kf9+sENTE8tDIEhmcXSeD/2/8mPu7wfrdV PD+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:subject:to :from; bh=WGKvK/7I0+I+Q1q7UFUs2p8yML5tG6ynFDDNAdme/jM=; b=orXXwGg7tHbw6vX82tJTFNeY1pwet5GYN6sEFCiy/JvSn0Yx0/2u84kev06YOAQe5X 6c7PicizQuC/oKnIQqrsVe/e/N2eKtmdaTpBaVa6gr6DlbB66NO6jCw6QFkK6Vqinm5F 8J0zUpZN3tEa5c3hqaBVKhlkKYb/pmf5QeydHFohAoNXLOkAPeoKmyTfd+LtpYaCH8DY fsB+6Myv81JGrsKkOzn1kOe/pBuhBlCukMe53kNN3DN74uQvjak6GOGmdk7fm1rKZdFg kxLsF2vTmcE4TKfWxaFFwsGcwHWafQ670sB8UDO8lJrW0zrEQvUmrtYvq1yk2vnmgeaO kx0w== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of denis.maier-NSENcxR/0n0@public.gmane.org designates 130.92.0.82 as permitted sender) smtp.mailfrom=denis.maier-NSENcxR/0n0@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=unibe.ch Original-Received: from mailhub-lb1.unibe.ch (mailhub-lb1.unibe.ch. [130.92.0.82]) by gmr-mx.google.com with ESMTPS id a1si247259wrp.1.2021.08.18.00.12.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 00:12:35 -0700 (PDT) Received-SPF: pass (google.com: domain of denis.maier-NSENcxR/0n0@public.gmane.org designates 130.92.0.82 as permitted sender) client-ip=130.92.0.82; X-Virus-Scanned: By University of Bern - MGW Original-Received: from mail.campus.unibe.ch (aai-edge-04.campus.unibe.ch [130.92.13.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailhub-lb1.unibe.ch (Postfix) with ESMTPS id D18E7500115 for ; Wed, 18 Aug 2021 09:12:30 +0200 (CEST) Thread-Topic: No indent after horizontal rule Thread-Index: AQHXkr8WZu2wiXXT3kiqv6VEeWbF9qt4MMqAgACqNhA= In-Reply-To: <945bf0d5-b826-4446-a086-0b1120824e80n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Accept-Language: de-CH, en-US Content-Language: de-DE x-originating-ip: [130.92.13.161] X-Original-Sender: denis.maier-NSENcxR/0n0@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of denis.maier-NSENcxR/0n0@public.gmane.org designates 130.92.0.82 as permitted sender) smtp.mailfrom=denis.maier-NSENcxR/0n0@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=unibe.ch 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.io gmane.text.pandoc:29050 Archived-At: --_000_23250a1cbd394d0487439d89bf180814unibech_ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Just a quick note: there=E2=80=99s also the the noindentafter package: http= s://www.ctan.org/pkg/noindentafter Might be an idea to look into how this package implements this. Best Denis Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Im A= uftrag von Ian Barnes Gesendet: Mittwoch, 18. August 2021 01:02 An: pandoc-discuss Betreff: Re: No indent after horizontal rule Thanks for the response. Yes, I agree that's simpler and I tried something = like that first too, but it failed on my first attempt. TeX just ignores th= e \noindent, because there's a blank line between it and the following para= graph in the generated TeX file. But I went back to it just now and it work= s if you add something like this \makeatletter \def\gobblepar{\@ifnextchar\par\@gobble\relax} \makeatother to your template or header-includes and then stick a \gobblepar after the \= noindent. I'm a little concerned about what this does if the block after th= e hrule isn't a paragraph. Seems to result in extra vertical space. But th= at seems kind-of a perverse thing for a document author to do. Interesting, thanks, that was fun... On Monday, 16 August 2021 at 6:52:21 pm UTC+2 John MacFarlane wrote: The most straightforward approach would probably just be fixhrule :: Block -> Block fixhrule HorizontalRule =3D RawBlock (Format "latex") "\\begin{center}\\rule{0.5\\linewidth}{0.5pt}\\en= d{center}\\noindent" fixhrule x =3D x Ian Barnes writes: > It's not quite the same situation as the various discussions about not > wanting indents after blockquotes, but similar enough that perhaps my > solution is interesting for others. > > I'm converting Markdown to PDF via LaTeX, with indent:true, and I'm using > horizontal rules as scene or section breaks. I found the indent on the > first paragraph after such a break ugly and wanted to do an automatic > \noindent after every horizontal rule. This turned out to be pretty easy > with a Haskell filter. > > As it's the first time I've written anything in Haskell, I thought I'd po= st > it here for feedback. Seems to me like maybe there's a more concise way t= o > do the same thing. > > Also this could obviously be adapted to actually remove the horizontal > rules and replace them with the Pandoc internal representation of a > vertical skip or blank line (whatever that is). > > import Data.Text > import Text.Pandoc.JSON > > main :: IO () > main =3D toJSONFilter noIndentAfterHorizontalRule > > noIndentAfterHorizontalRule :: Pandoc -> Pandoc > noIndentAfterHorizontalRule doc =3D > let Pandoc meta blocks =3D doc > in Pandoc meta (mapAfterHorizontalRule noIndentifyPara blocks) > > mapAfterHorizontalRule :: (Block -> Block) -> [Block] -> [Block] > mapAfterHorizontalRule f (HorizontalRule : block : blocks) =3D > HorizontalRule : f block : mapAfterHorizontalRule f blocks > mapAfterHorizontalRule f (block : blocks) =3D block : mapAfterHorizontalR= ule > f blocks > mapAfterHorizontalRule f [] =3D [] > > noIndentifyPara :: Block -> Block > noIndentifyPara (Para xs) =3D > Para (RawInline (Format (Data.Text.pack "tex")) (Data.Text.pack > "\\noindent ") : xs) > noIndentifyPara x =3D x > > -- > 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit https://groups.google.com/d/msgi= d/pandoc-discuss/9953168b-aa53-4c75-b18b-612ddd8a3ddfn%40googlegroups.com. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org. To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/945bf0d5-b826-4446-a086-0b1120824e80n%40googlegroups.com. --=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/23250a1cbd394d0487439d89bf180814%40unibe.ch. --_000_23250a1cbd394d0487439d89bf180814unibech_ Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Just a qu= ick note: there=E2=80=99s also the the noindentafter package: https://www.ctan.org/pkg= /noindentafter

&nbs= p;

Might be an idea to look into how this package implements this.<= /o:p>

 

Best=

Denis

&nbs= p;

Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von Ian Barnes
Gesendet: Mittwoch, 18. August 2021 01:02
An: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Betreff: Re: No indent after horizontal rule

 

Thanks for the response. Yes, I agree that's simpler= and I tried something like that first too, but it failed on my first attem= pt. TeX just ignores the \noindent, becau= se there's a blank line between it and the following paragraph in the gener= ated TeX file. But I went back to it just now and it works if you add somet= hing like this

 

= \makeatletter

= \def\gobblepar{\@ifnextchar\par\@gobble\relax}

= \makeatother

 

to your template or header-includes and then stick a= \gobblepar after the \noindent. I'm a little concerned about what this does if the b= lock after the hrule isn't a paragraph. Seems to result in extra vertical s= pace.  But that seems kind-of a perverse thing for a document author to do.

 

Interesting, thanks, that was fun...

On Monday, 16 August 2021 at 6:52:21 pm UTC+2 Jo= hn MacFarlane wrote:


The most straightforward approach would probably just be

fixhrule :: Block -> Block
fixhrule HorizontalRule =3D
RawBlock (Format "latex") "\\begin{cen= ter}\\rule{0.5\\linewidth}{0.5pt}\\end{center}\\noindent"
fixhrule x =3D x


Ian Barnes <ianbar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> = writes:

> It's not quite the same situation as the various discussions about not=
> wanting indents after blockquotes, but similar enough that perhaps my =
> solution is interesting for others.
>
> I'm converting Markdown to PDF via LaTeX, with indent:true, and I'm us= ing
> horizontal rules as scene or section breaks. I found the indent on the=
> first paragraph after such a break ugly and wanted to do an automatic =
> \noindent after every horizontal rule. This turned out to be pretty ea= sy
> with a Haskell filter.
>
> As it's the first time I've written anything in Haskell, I thought I'd= post
> it here for feedback. Seems to me like maybe there's a more concise wa= y to
> do the same thing.
>
> Also this could obviously be adapted to actually remove the horizontal=
> rules and replace them with the Pandoc internal representation of a > vertical skip or blank line (whatever that is).
>
> import Data.Text
> import Text.Pandoc.JSON
>
> main :: IO ()
> main =3D toJSONFilter noIndentAfterHorizontalRule
>
> noIndentAfterHorizontalRule :: Pandoc -> Pandoc
> noIndentAfterHorizontalRule doc =3D
> let Pandoc meta blocks =3D doc
> in Pandoc meta (mapAfterHorizontalRule noIndentifyPara blocks)
>
> mapAfterHorizontalRule :: (Block -> Block) -> [Block] -> [Blo= ck]
> mapAfterHorizontalRule f (HorizontalRule : block : blocks) =3D
> HorizontalRule : f block : mapAfterHorizontalRule f blocks
> mapAfterHorizontalRule f (block : blocks) =3D block : mapAfterHorizont= alRule
> f blocks
> mapAfterHorizontalRule f [] =3D []
>
> noIndentifyPara :: Block -> Block
> noIndentifyPara (Para xs) =3D
> Para (RawInline (Format (Data.Text.pack "tex")) (Data.Text.p= ack
> "\\noindent ") : xs)
> noIndentifyPara x =3D x
>
> --
> You received this message because you are subscribed to the Google Gro= ups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send= an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/9953168b-aa53-4c75-b18b-61= 2ddd8a3ddfn%40googlegroups.com.

--
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-d= iscuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/945bf0d5-b826-4446-a086-0b= 1120824e80n%40googlegroups.com.

--
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://groups.google.com/d/msgid/pandoc= -discuss/23250a1cbd394d0487439d89bf180814%40unibe.ch.
--_000_23250a1cbd394d0487439d89bf180814unibech_--