From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/21476 Path: news.gmane.org!.POSTED!not-for-mail From: BP Jonsson Newsgroups: gmane.text.pandoc Subject: Re: Lua filter to add \medskip Date: Tue, 13 Nov 2018 22:51:41 +0100 Message-ID: References: <1542144045.2173.3.camel@seamplex.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000004d62d0057a92d3a6" X-Trace: blaine.gmane.org 1542145788 5017 195.159.176.226 (13 Nov 2018 21:49:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 13 Nov 2018 21:49:48 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDIY76M674FRB6MOVXPQKGQEQPDKJ3I-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Nov 13 22:49:44 2018 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-qk1-f183.google.com ([209.85.222.183]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gMgZ5-0001DL-PU for gtp-pandoc-discuss@m.gmane.org; Tue, 13 Nov 2018 22:49:44 +0100 Original-Received: by mail-qk1-f183.google.com with SMTP id z68sf9079935qkb.14 for ; Tue, 13 Nov 2018 13:51:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1542145914; cv=pass; d=google.com; s=arc-20160816; b=cyaVBoS8NRzK+/AUy6iNr6NVF81Jq6PYUU3d2H7CUuRT2XehkpF5rEIsyCfNlTk2fT v8mdbt0OEnhTu08UXxDYgMUivnocJ2rfnNOQuTTQ4U4yp1ao8pZK8WLGRprR37LS3o4Q DSmbxA3p/x/U+0vQc7YBg4TpaC9YO/QaChZOXZPKoh2rJS/2co6ivCI8jPhD6StRqhuc Mmrux8z3JrFgSYoaw9HlDXl6wPaZpCsEmVX9Vv4UsyjYBUV62OKs13zVQI1OyzzfeJ6h C4EfnYXNi3/RDrJsMy4HKPuyGiKt5UjuiVTMV2uFHv1gZg4WY5bGUqlqpxmHodXy3xaB IiNQ== 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=CC6Z7jPI65WwS1/cbEmyivNJPMjBGjyi825YIMz+cYU=; b=B8t5DQDGamtfnkS3SK5+ZOMm1eqSchMKC7H13ZSooR7W0fbj4MGepQGhvPNOQts9Op NTu8yUEeK/bdes7vjhCxhRunis2dC6TYLzuH8F4MPlbHzdTsIsZ1oIYYoWzW3OGxJrzv JeJ40lx8+Uw38qAwwMao2+GSXK4PpRw4+pwiW7Y6obYrdowvkJRt4qMucYISqwV3Zkf+ Bq0T4Q8/ekivsIzJC2aCjJpvFZi+54P1REAeKSav6zeC98TOaL0hs9YfyCZ4bxZWDcqH XOELTbeH5/WXUq41Prxub3g1NdT5SwzPpZPJ0xES2aG2dqN0R8lLks0OlDYbEoCm6U85 LZ8w== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="P6bmz5/K"; spf=pass (google.com: domain of bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::433 as permitted sender) smtp.mailfrom=bpjonsson-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=CC6Z7jPI65WwS1/cbEmyivNJPMjBGjyi825YIMz+cYU=; b=lxKlxfcaS8T4BlIbPqMer3t+KhsRmBNsZkxgfBpVNfOtb5/sbAESoaR22sjobSsHsN tC5mg2ERp4gZa0ks3r83jkeug/TDaCMjRqs4W63Pt9BpFh4Ib/FoxECunlxi+FxivNUE Sh8NqdF2ycB3OBfOu3JJnvZhtXO5Jlw3iRMGaP29SPNb9/T8cj7/rKFZqu6zcQoV4eT3 kwc4EDhWLEKVhEIhsPBRAowAU7BD6Rt+/1dw/T8DC8OfBR1U8sfQAjkoUxvPQpZM2yJV pNDYXJowA4O1ZeNoSXYcBDXOr4K+ZVo+lZ2zMgYyyko6cg0JbZN6Miu4O1sNupqYY4lD 8Wag== 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=CC6Z7jPI65WwS1/cbEmyivNJPMjBGjyi825YIMz+cYU=; b=Jrs1lSR7RYcVLm2B0gVMA/p80DkvVpsxQi3fHgQzlm20NGfUmGFKV6bxfoHvNS3Q0O w2uubjcO304rfrjS9h37ASFw5n+ryRekn2E8HFMLJzsADxboPiXciWDOsCNgZEXQUgh9 2Jb47tl/jm6o06/HbJvEV8MmsYibKpBITEr4iRQ5PHCU50DBLsz+U+Gg+E6IzdU27Ymg dAPiIAiNs50ftW/D+rzyjAtt1gqsBJPOhOn92mJkG8DxJy0Z6k8iluOEWC9ORJM6TMfU XzwL6SsENGkfpxvCayaQ0EsUbTJTzZfvUO99Gbgmlv5vIsVS1NOn2G+ymFs4U3/xYx9X yIaw== 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=CC6Z7jPI65WwS1/cbEmyivNJPMjBGjyi825YIMz+cYU=; b=ml3esdSSnPme8/rZKMv5gO4yUxLx7aBduWjDJKgFiz7ouge+Vx3dX7Eb7+i+4/jUn3 eNqZe0v/zIoyqkDKF9j3X/GfbwWId6La+iFcavgTHh77tEYsK46TXA/vE4dtIqoB/eTz L+RxE66X+Qo5OqtWKNLf48oycpICqy+RKlVXZYTC0M5kRh+0v/I0H3ceTQhC2v0+oKsO 7IUF+qY191T3nLvy7yXEVTUjigjINwRdnBL03NqtEEaQf6oK76116TI0V5ctPqkTNyXE BHO6Ff6tQjVm6tPWVyxPOjhcle7rCGCCfrm9iDAIYy/E04zjpr/vMZOVhLeZlO16RYvl 4mTA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AGRZ1gI65eYQfR3Q9pWot++LPYPaEwGJGyIAkzDTcu4DlF5U7Bce+O1W fNIoI7X2m4sX6YlAhHj3pJc= X-Google-Smtp-Source: AJdET5fC+lJsYoQAd+KeLnILuE5qL7UO7Rm1qlmxGunp4EvNCYMWB27l0lwvlBQRbTQrOJbLDoh/ow== X-Received: by 2002:a0c:cd87:: with SMTP id v7mr97115qvm.6.1542145914316; Tue, 13 Nov 2018 13:51:54 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aed:3aa3:: with SMTP id o32ls774320qte.8.gmail; Tue, 13 Nov 2018 13:51:53 -0800 (PST) X-Received: by 2002:ac8:8e6:: with SMTP id y35mr4873101qth.30.1542145913622; Tue, 13 Nov 2018 13:51:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542145913; cv=none; d=google.com; s=arc-20160816; b=rdmdPMGOzsPQKmaMa1BXHJumbB2kOfLB18jfL+/0ey5DkkUkb7PXdhux171y/82pja CaTRqCjlM2yvdlGpIc64UEwN04SUsng/p9BY0WF5lNbouIFfMKHLyOAyhITm78XOlxxC +naJq7qg/bJPuXaSmtn/c5NrKw7wDkx7KztVkrL+2AhrpGQm7LeEwGI8RrMReUBzbrRf GJAER+eCvKH9In/tUqLsAgTjbevHqcx4pjpv6srnbYOE0PYNfSbgdXnZPfxmId0aXG3L EqV1YyxYR51eXdKPEXDevhpZnSBHe7/f6hFtpzN29TlXuDUzRAnZtPhV7h7nI8nUcS7x bLEw== 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=6k2p//J97G5nspxNqLY6c+lqo8qIR2ba/eBUSzTGbX4=; b=NobtNTdW7NdTcxNuGucAe2J8UQAwGL06Q3vO4HqpJ9ABJPZiKCaD4GmwY9EMPp1cdC Wpx7/qUPqEPk0DwmV3WNET80ioqdbedl63EQTNhhwju81fupHUBEgReTU23sAoF3yxNm vApQKg5G8fR4A9Dc/khTGqzRxGOpwqueVzm1A0zmmzkfCe8IwU7o3+f9H6cuHRtqbwMB kenxQ8qfYZ67SbjIGdMeid23QKOg1RiqqA7p1BEfWzVO0bB4MLas5HVc9zNzW9UTjah0 EmJURdCOGpJw64xhVEVUTsDczQhCQTcGj6YcUgGRQOFcFUAPYwpvWRTLEy7qVM7fHfMQ mHtg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="P6bmz5/K"; spf=pass (google.com: domain of bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::433 as permitted sender) smtp.mailfrom=bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com. [2607:f8b0:4864:20::433]) by gmr-mx.google.com with ESMTPS id q15-v6si851317qtl.2.2018.11.13.13.51.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 13:51:53 -0800 (PST) Received-SPF: pass (google.com: domain of bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::433 as permitted sender) client-ip=2607:f8b0:4864:20::433; Original-Received: by mail-pf1-x433.google.com with SMTP id s9-v6so6731200pfm.13 for ; Tue, 13 Nov 2018 13:51:53 -0800 (PST) X-Received: by 2002:a63:d70e:: with SMTP id d14mr6362391pgg.159.1542145912429; Tue, 13 Nov 2018 13:51:52 -0800 (PST) In-Reply-To: <1542144045.2173.3.camel-24em0bpozeFWk0Htik3J/w@public.gmane.org> X-Original-Sender: bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="P6bmz5/K"; spf=pass (google.com: domain of bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::433 as permitted sender) smtp.mailfrom=bpjonsson-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-Spam-Checked-In-Group: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:21476 Archived-At: --0000000000004d62d0057a92d3a6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Pandoc doesn't preserve any info about the number of blank lines in the input, i.e. two newlines, three newlines or more are equivalent and just register as a paragraph/other block break. I suppose you know that you simply can type `\medskip` in a paragraph on its own? It will be passed through unchanged to LaTeX output and ignored in other ourput formats. If you want similar behavior in HTML output you can have a filter intercept RawBlock elements with format `latex` and text `\medakip` and insert e.g. a span with suitable CSS styling. I do something similar with `\newpage` even in DOCX output. If you don't like the raw LaTeX but don't otherwise use horizontal rules you could put a horizontal rule where you want a medskip and use a filter to replace HorizontalRule elements with latex RawBlock elements with content `\medakip` for LaTeX output, or to remove them in HTML output. tis 13 nov. 2018 kl. 22:20 skrev Jeremy Theler : > Hello all > > Is there anyone out there who can tell me how to write a Lua filter such > that if two markdown paragraphs are separated by two (three) blank lines = in > the input then a LaTeX \medskip (\bigskip) command is inserted into the > output? > > Thanks > -- > jeremy theler > www.seamplex.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 > 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/1542144045.2173.3.camel%= 40seamplex.com > > . > For more options, visit https://groups.google.com/d/optout. > --=20 ------------------------------ SavedURI :Show URLShow URLSavedURI : SavedURI :Hide URLHide URLSavedURI : https://mail.google.com/_/scs/mail-static/_/js/k=3Dgmail.main.sv.G3GZFwvcni= Q.O/m=3Dm_i,t,it/am=3DfUAcTAoZawdGHAZ2YD-g9N_f7LL4CX7WlSgHQKgABHaCv9kToPiBD= 8qOMw/rt=3Dh/d=3D1/rs=3DAItRSTO5CF1YB_frDRXLXTeUsQ1zItcBvwhttps://mail.goog= le.com/_/scs/mail-static/_/js/k=3Dgmail.main.sv.G3GZFwvcniQ.O/m=3Dm_i,t,it/= am=3DfUAcTAoZawdGHAZ2YD-g9N_f7LL4CX7WlSgHQKgABHaCv9kToPiBD8qOMw/rt=3Dh/d=3D= 1/rs=3DAItRSTO5CF1YB_frDRXLXTeUsQ1zItcBvw ------------------------------ --=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 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/CAFC_yuRxziHqR%3DK0ed5tCZ3FszLxV9k1JwTEgjNnOfOL_ZAPMg%40mail= .gmail.com. For more options, visit https://groups.google.com/d/optout. --0000000000004d62d0057a92d3a6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Pandoc doesn't preserve any info about the numbe= r of blank lines in the input, i.e. two newlines, three newlines or more ar= e equivalent and just register as a paragraph/other block break.

I suppose you know that you simply= can type `\medskip` in a paragraph on its own? It will be passed through u= nchanged to LaTeX output and ignored in other ourput formats. If you want s= imilar behavior in HTML output you can have a filter intercept RawBlock ele= ments with format `latex` and text `\medakip` and insert e.g. a span with s= uitable CSS styling. I do something similar with `\newpage` even in DOCX ou= tput.

If you don't l= ike the raw LaTeX but don't otherwise use horizontal rules you could pu= t a horizontal rule where you want a medskip and use a filter to replace Ho= rizontalRule elements with latex RawBlock elements with content `\medakip` = for LaTeX output, or to remove them in HTML output.

tis 13 nov. 2018 kl. 22:20 skrev Jeremy Theler= <jeremy-24em0bpozeFWk0Htik3J/w@public.gmane.org>:
Hello all

Is there anyone out there who can tell me how to write a Lua filter= such that if two markdown paragraphs are separated by two (three) blank li= nes in the input then a LaTeX \medskip (\bigskip) command is inserted into = the output?

Thanks
--
jeremy t= heler

--
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-/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.c= om/d/msgid/pandoc-discuss/1542144045.2173.3.camel%40seamplex.com.
For more options, visit https://groups.google.com/d/optout.
--

--
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://group= s.google.com/d/msgid/pandoc-discuss/CAFC_yuRxziHqR%3DK0ed5tCZ3FszLxV9k1JwTE= gjNnOfOL_ZAPMg%40mail.gmail.com.
For more options, visit http= s://groups.google.com/d/optout.
--0000000000004d62d0057a92d3a6--