From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/18246 Path: news.gmane.org!.POSTED!not-for-mail From: "'SBJ' via pandoc-discuss" Newsgroups: gmane.text.pandoc Subject: Markdown to LaTeX: unwanted newlines around LaTeX environment Date: Tue, 3 Oct 2017 09:51:14 -0700 (PDT) Message-ID: <8729b9a5-1aff-4d3a-a17f-06d8a63beefa@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_12203_1498318440.1507049474998" X-Trace: blaine.gmane.org 1507049479 27171 195.159.176.226 (3 Oct 2017 16:51:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 3 Oct 2017 16:51:19 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCU3V4G7WUNRBA4AZ7HAKGQEIPBPREY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Oct 03 18:51:12 2017 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-ua0-f185.google.com ([209.85.217.185]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzQPV-0006AL-Ap for gtp-pandoc-discuss@m.gmane.org; Tue, 03 Oct 2017 18:51:09 +0200 Original-Received: by mail-ua0-f185.google.com with SMTP id n94sf5286298uan.5 for ; Tue, 03 Oct 2017 09:51:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=date:from:to:message-id:subject:mime-version:x-original-sender :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=hHie2sm3Whd/N0ieXAB2CELxZgv8eLfE9SSXN+E1jM8=; b=Ta+Q65y32VsIPGpMylBmcWSxysJPKOfsxVPYkb8r6ihhc4QknUhjni71QF2P9MyZSh vbVJiQfsh2pPA6ZVO58Vz++xzwzyKOgKfLhrrmbsTvMdSuAl33G7qfWbwY3A7cB+41Pr DOcZlSriYF82K40wEaN12s/lcWPnOMNGipME8gwxq/gmMYnB53YkiIbW61upmXB+7p8n GKZMgoprSuub7XwbhqIdKh0Hz1WhZo2cw/THgW2DQM3kUc2LqZ6czAtapPWN6ZZRgImU pz+96RPtPj+5vw1rOT39XzfN9pFgsuPlIF4LiOoFBf/8U02UXUY3cCY9KGUkwOgKlXk1 CSyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:message-id: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=hHie2sm3Whd/N0ieXAB2CELxZgv8eLfE9SSXN+E1jM8=; b=sW0eOwWFsQrt/H+JxAvF2jBAEvwBtN43c6Js/c3hY9eq57BkoWZnMwC+hfHvvq04vL JwoYeKqwwnoJYPu49HL01fPuYrR40ZovTwxa497LTMPbAcLILWMER8IBbuFTUmjX8lbi /rweNj6W5FDkqbH4fwSK4mFpPu3TKrn4HhBbdalM3zGqF9dlU3SG+8g1ny0tfB+ylE0M bLfMe1+jiWewEoA59aUxkSzrdN0NF8bOR1UdGiqJ+9liwmG3vfdgDPGU47EMtaWx12f7 fAurgc94Z/e7Z/NLT8tftysc+XbBhbxcq3+4+4LFkm0WSOT/+MP6/3V7EutbGQjmy2Dd 6TEw== X-Gm-Message-State: AMCzsaVjaj7Ywqc9uCUGaR1P2IquAYiHwgrcvV23GSJhCD7VDdWKTkGb leQofm3NIkcU7KCddUL2uNg= X-Google-Smtp-Source: AOwi7QCiY7MQmMCDeL49msOScmGJ5O2PpjyTolUENyUbNDvAipIRM4AfBO+2h7M44CNtKRGURnemlQ== X-Received: by 10.157.29.231 with SMTP id w36mr182005otw.26.1507049476798; Tue, 03 Oct 2017 09:51:16 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.202.61.67 with SMTP id k64ls3601334oia.22.gmail; Tue, 03 Oct 2017 09:51:15 -0700 (PDT) X-Received: by 10.157.19.45 with SMTP id f42mr182622ote.22.1507049475567; Tue, 03 Oct 2017 09:51:15 -0700 (PDT) X-Original-Sender: s.bergjohansen-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org X-Original-From: SBJ 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:18246 Archived-At: ------=_Part_12203_1498318440.1507049474998 Content-Type: multipart/alternative; boundary="----=_Part_12204_1917783902.1507049474998" ------=_Part_12204_1917783902.1507049474998 Content-Type: text/plain; charset="UTF-8" It appears that the Markdown reader, as a rule, treats any unknown environment as block-level content (rather than inline). While this seems to be the desired behaviour, it has side effects when the output format is (newline-sensitive) LaTeX. This was previously reported here: - https://github.com/jgm/pandoc/issues/3309#issuecomment-284679731 - https://groups.google.com/forum/#!searchin/pandoc-discuss/latex$20environment|sort:relevance/pandoc-discuss/P3fV_0jw9-U/DUpSrWYxaAkJ This affects users wanting to create LaTeX documents in a convenient fashion by first writing a Markdown file containing occasional LaTeX environments, then converting to LaTeX and feeding the resulting LaTeX into a pdflatex workflow. The extra newlines produced in this process affect the LaTeX parsing, leading to unwanted (and inconsistent) vertical space in the final document (see simple example below). Is there a way to make Pandoc omit the newlines? $ cat test.md Testing environment \begin{equation} i^2=-1 \end{equation} for whitespace. $ pandoc -f markdown -t latex -o test.tex test.md $ cat test.tex Testing environment \begin{equation} i^2=-1 \end{equation} for whitespace. $ pandoc --version pandoc 1.19.2.4 Compiled with pandoc-types 1.17.0.5, texmath 0.9.4.2, skylighting 0.1.1.5 [...] -- 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/8729b9a5-1aff-4d3a-a17f-06d8a63beefa%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_12204_1917783902.1507049474998 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
It appears that the Markdown reader, as a rule, treats any= unknown environment as block-level content (rather than inline). While thi= s seems to be the desired behaviour, it has side effects when the output fo= rmat is (newline-sensitive) LaTeX. This was previously reported here:
  • https://github.com/jgm/pandoc/issues/3309#issuecomment-284679731
  • https://groups.google.com/forum/#!searchin/pandoc-discuss/latex$20envi= ronment|sort:relevance/pandoc-discuss/P3fV_0jw9-U/DUpSrWYxaAkJ
  • = This affects users wanting to create LaTeX documents in a convenient f= ashion by first writing a Markdown file containing occasional LaTeX environ= ments, then converting to LaTeX and feeding the resulting LaTeX into a pdfl= atex workflow. The extra newlines produced in this process affect the LaTeX= parsing, leading to unwanted (and inconsistent) vertical space in the fina= l document (see simple example below).

    Is there a way to make Pandoc= omit the newlines?

    $ cat test.md
    Testing environment
    \begin{equation}
    =C2=A0 =C2=A0 i^2=3D-1
    \end{equa= tion}
    for
    whitespace.
    $ pandoc
    -f markdown -t latex -o test.tex test= .md
    $ c= at test
    .tex
    Testing<= span style=3D"color: #000;" class=3D"styled-by-prettify"> environment
    \= begin{
    equation}
    =C2=A0 =C2=A0 i
    ^2=3D-1
    \end{equation}

    for whitespace.
    $ pandoc
    --version
    pandoc
    1.19.2.4
    Compiled= with pandoc<= span style=3D"color: #660;" class=3D"styled-by-prettify">-types 1.17.0.5, texmath 0.9.4.= 2,<= span style=3D"color: #000;" class=3D"styled-by-prettify"> skylighting 0.1.
    1.5
    [...]
    <= /code>

    --
    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/8729b9a5-1aff-4d3a-a17f-06d8a63beefa%40googlegroups.co= m.
    For more options, visit http= s://groups.google.com/d/optout.
    ------=_Part_12204_1917783902.1507049474998-- ------=_Part_12203_1498318440.1507049474998--