From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/11917 Path: news.gmane.org!not-for-mail From: Tim Lin Newsgroups: gmane.text.pandoc Subject: Add a newline after a LineBreak to writers? Date: Tue, 3 Feb 2015 17:46:49 -0800 (PST) Message-ID: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_3974_1217473384.1423014409505" X-Trace: ger.gmane.org 1423014412 16781 80.91.229.3 (4 Feb 2015 01:46:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Feb 2015 01:46:52 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCY3ZEFMVAOBBCXUYWTAKGQESXIEGQY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Feb 04 02:46:52 2015 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-ie0-f187.google.com ([209.85.223.187]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YIp3L-0006BA-Vf for gtp-pandoc-discuss@m.gmane.org; Wed, 04 Feb 2015 02:46:52 +0100 Original-Received: by mail-ie0-f187.google.com with SMTP id rl12sf40100879iec.4 for ; Tue, 03 Feb 2015 17:46:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=date:from:to:message-id:subject:mime-version:content-type :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe; bh=mq6HgfoLwTcU32pWGcLxdHHWewY2ljuNLLRrTGyypiA=; b=hX+YJoF28GgwKUuAfjtMiJh4nyIrBPuWKQQQuz97IQ2SHivNvpJS39yaJZLsDTJjdY a1OJ2VqkxKnyOOH5HYlL91q6AWCV+yeaZhvbmKPNwZYWudfq4g4OWP5mUSCphSTgbI4a Z4eDIsauU6bA0M0qxijIKYjThZhJNtH4aANB9xVg7+4lMjSfAiWwD08uAxEOIK9w40PK JkOz1MgLi5fPDBLaJFEYfVyyBPpHgbeEighz8MUMWUuamur7u9VdAYumTRavqOWLiipq dL3ZqT8+I3YEMpbAslgsSIsfyhP+cu1slKTh1JE7iXs1LrfpIFGdFQxmcVJDoI9b33Zx sCqQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:subject:mime-version:content-type :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe; bh=mq6HgfoLwTcU32pWGcLxdHHWewY2ljuNLLRrTGyypiA=; b=sh36npTh/UTApWTcMqoN000ORZNKFec7S9c1vDxf2wtSnvCRxIzMFeJBTHIBW1ABfA 49xLZWLbfXdegX+e7dS7nz9291IfYKyNElCRowdxIXmmmFKik/D2L359v2UTWd3uoK8+ sEW3a25qtEctqyay5ZzwPZy+KwyRXCGo5I/3jocbWcDatliOhDg6bqsT0oPS4rgk87W/ hqYPGWXMuvHHQOPCyb6cjZAdDGcdhlwW3BCAOiBnMrUXqn18Xg2pzVWUdw7LQ8rK+JEo eYdNTZbLo9Y/dhdYpXOCPCxJdauMD4jwMPfW9kQ3avAgNBYrMMMxHjE4PLPs/P+eLSp+ lwlg== X-Received: by 10.50.50.142 with SMTP id c14mr309115igo.13.1423014411282; Tue, 03 Feb 2015 17:46:51 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.107.167.3 with SMTP id q3ls2271568ioe.16.gmail; Tue, 03 Feb 2015 17:46:50 -0800 (PST) X-Received: by 10.51.15.133 with SMTP id fo5mr309704igd.3.1423014410813; Tue, 03 Feb 2015 17:46:50 -0800 (PST) X-Original-Sender: timtylin-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:11917 Archived-At: ------=_Part_3974_1217473384.1423014409505 Content-Type: multipart/alternative; boundary="----=_Part_3975_850976272.1423014409505" ------=_Part_3975_850976272.1423014409505 Content-Type: text/plain; charset=UTF-8 I'm using the line-block construct extensively fro writing pseudocode. It usually works great, but boy does the rendered output look ugly. Here's an example of what one of my typical algorithms can end up looking in LaTeX: \texttt{\ 1.}~\textbf{Inputs}:~variables~$A, b$\\\texttt{\ 2.}~\textbf{Output}:~$\phi$~~~~~~~~~~~~~~~~\texttt{//this\ is\ a\ comment}\texttt{\ 3.}~Choose~an~initial~guess~$\phi$~to~the~solution\\\texttt{\ 4.}~~\textbf{repeat}~until~convergence\\\texttt{\ 5.}~~~~\textbf{for}~$i$~\textbf{from}~1~\textbf{until}~$n$~\textbf{do}\\\texttt{\ 6.}~~~~~~~~$\sigma \leftarrow 0$\\\texttt{\ 7.}~~~~~~~~\textbf{for}~$j$~\textbf{from}~1~\textbf{until}~$n$~\textbf{do}\\\texttt{\ 8.}~~~~~~~~~~~~\textbf{if}~$j \ne i$~\textbf{then}\\\texttt{\ 9.}~~~~~~~~~~~~~~~$\sigma \leftarrow \sigma + a_{ij} \phi_j$\\\texttt{10.}~~~~~~~~~~~~\textbf{end~if}\\\texttt{11.}~~~~~~~~\textbf{end}~($j$-loop)\\\texttt{12.}~~~~~~~~$\phi_i \leftarrow \frac 1 {a_{ii}} (b_i - \sigma)$\\\texttt{13.}~~~~\textbf{end}~($i$-loop)\\\texttt{14.}~~~~check~if~convergence~is~reached\\\texttt{15.}~\textbf{end}~(repeat) It's serviceable, but really hard to play with for a human. The HTML writer doesn't far much better. I realize that line-block are a special case where the usage of LineBreak can easily get out of control. I wonder if it's better to add a newline after each LineBreak inline element. I'm really just targeting line-blocks, but as they don't have their own block-level type the only alternative is to change LineBreak behavior. The above example would then look like this: \texttt{\ 1.}~\textbf{Inputs}:~variables~$A, b$\\ \texttt{\ 2.}~\textbf{Output}:~$\phi$~~~~~~~~~~~~~~~~\texttt{//this\ is\ a\ comment} \texttt{\ 3.}~Choose~an~initial~guess~$\phi$~to~the~solution\\ \texttt{\ 4.}~~\textbf{repeat}~until~convergence\\ \texttt{\ 5.}~~~~\textbf{for}~$i$~\textbf{from}~1~\textbf{until}~$n$~\textbf{do}\\ \texttt{\ 6.}~~~~~~~~$\sigma \leftarrow 0$\\ \texttt{\ 7.}~~~~~~~~\textbf{for}~$j$~\textbf{from}~1~\textbf{until}~$n$~\textbf{do}\\ \texttt{\ 8.}~~~~~~~~~~~~\textbf{if}~$j \ne i$~\textbf{then}\\ \texttt{\ 9.}~~~~~~~~~~~~~~~$\sigma \leftarrow \sigma + a_{ij} \phi_j$\\ \texttt{10.}~~~~~~~~~~~~\textbf{end~if}\\ \texttt{11.}~~~~~~~~\textbf{end}~($j$-loop)\\ \texttt{12.}~~~~~~~~$\phi_i \leftarrow \frac 1 {a_{ii}} (b_i - \sigma)$\\ \texttt{13.}~~~~\textbf{end}~($i$-loop)\\ \texttt{14.}~~~~check~if~convergence~is~reached\\\texttt{15.}~\textbf{end}~(repeat) I can't really think of any negative ramification off the top of my head. I'd appreciate any help thinking about whether this would break anything. -- 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/b25e52ed-107c-4f32-a128-b9b68c149ce4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_3975_850976272.1423014409505 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I'm using the line-block construct extensively fro writing= pseudocode. It usually works great, but boy does the rendered output look = ugly. Here's an example of what one of my typical algorithms can end up loo= king in LaTeX:

\texttt{\ 1.}~\textbf{Inputs}:~variables~$= A, b$\\\texttt{\ 2.}~\textbf{Output}:~$\phi$~~~~~~~~~~~~~~~~\texttt{//this\= is\ a\ comment}= \texttt{\ 3.}~Choose~an~initial~guess~$\phi$~to~the~solution\\\texttt{\ 4.}= ~~\textbf{repeat}~until~convergence\\\texttt{\ 5.}~~~~\textbf{for}~$i$~\tex= tbf{from}~1~\textbf{until}~$n$~\textbf{do}\\\texttt{\ 6.}~~~~~~~~$\sigma \l= eftarrow 0$\\\texttt{\ 7.}~~~~~~~~\textbf{for}~$j$~\textbf{from}~1~\textbf{= until}~$n$~\textbf{do}\\\texttt{\ 8.}~~~~~~~~~~~~\textbf{if}~$j \ne i$~\tex= tbf{then}\\\texttt{\ 9.}~~~~~~~~~~~~~~~$\sigma \leftarrow \sigma + a_{ij} \= phi_j$\\\texttt{10.}~~~~~~~~~~~~\textbf{end~if}\\\texttt{11.}~~~~~~~~\textb= f{end}~($j$-loop)\\\texttt{12.}~~~~~~~~$\phi_i \leftarrow \frac 1 {a_{ii}} = (b_i - \sigma)$\\\texttt{13.}~~~~\textbf{end}~($i$-loop)\\\texttt{14.}~~~~c= heck~if~convergence~is~reached\\\texttt{15.}~\textbf{end}~(repeat)

It's serviceable, but really hard to play with f= or a human. The HTML writer doesn't far much better. I realize that line-bl= ock are a special case where the usage of LineBreak can easily get out of c= ontrol.

I wonder if it's better to add a newline a= fter each LineBreak inline element. I'm really just targeting line-blo= cks, but as they don't have their own block-level type the only alternative= is to change LineBreak behavior. The above example would then look like th= is:

\texttt{\ 1.}~\textbf{Inputs}:~variables~$A, b$= \\
\texttt{\ 2.}~\textbf{Output}:~$\phi$~~~~~~~~~~~~~~~~\texttt{//this\ = is\ a\ comment}
\texttt{\ 3.}~Choose~an~= initial~guess~$\phi$~to~the~solution\\
\texttt{\ 4.}~~\textbf{repeat}~un= til~convergence\\
\texttt{\ 5.}~~~~\textbf{for}~$i$~\textbf{from}~1~\tex= tbf{until}~$n$~\textbf{do}\\
\texttt{\ 6.}~~~~~~~~$\sigma \leftarrow 0$\= \
\texttt{\ 7.}~~~~~~~~\textbf{for}~$j$~\textbf{from}~1~\textbf{until}~$= n$~\textbf{do}\\
\texttt{\ 8.}~~~~~~~~~~~~\textbf{if}~$j \ne i$~\textbf{= then}\\
\texttt{\ 9.}~~~~~~~~~~~~~~~$\sigma \leftarrow \sigma + a_{ij} \= phi_j$\\
\texttt{10.}~~~~~~~~~~~~\textbf{end~if}\\
\texttt{11.}~~~~~~= ~~\textbf{end}~($j$-loop)\\
\texttt{12.}~~~~~~~~$\phi_i \leftarrow \frac= 1 {a_{ii}} (b_i - \sigma)$\\
\texttt{13.}~~~~\textbf{end}~($i$-loop)\\<= br>\texttt{14.}~~~~check~if~convergence~is~reached\\\texttt{15.}~\textbf{en= d}~(repeat)

I can't really think of any negativ= e ramification off the top of my head. I'd appreciate any help thinking abo= ut whether this would break anything.

--
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/b25e52ed-107c-4f32-a128-b9b68c149ce4%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_3975_850976272.1423014409505-- ------=_Part_3974_1217473384.1423014409505--