From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Davis Subject: Forcing line breaks in src (monospace) examples Date: Sun, 14 Jun 2015 10:44:59 -0400 Message-ID: <557D936B.3050501@pfdstudio.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------040207000008050606080003" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z499k-0008GN-S2 for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 10:45:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z499h-00026o-MY for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 10:45:04 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:43848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z499h-000269-CN for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 10:45:01 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3FA9F20CD0 for ; Sun, 14 Jun 2015 10:45:00 -0400 (EDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------040207000008050606080003 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit I'm writing a document which includes several example commands, which I've wrapped in #+BEGIN_SRC/#+END_SRC. In LaTeX/PDF export, these come out in Courier, as I hoped, but they run off the right edge of the page. For example: #+BEGIN_SRC curl curl -v -X GET -H "Authorization:...\", \"access_token\": \"..." "http://blah.blah.blah.com/v1/REST_API_STUFF/..." #+END_SRC Years ago, someone on a TeX mailing list offered some code to force line breaking in \tt{...} code, with a \triangleright at the right margin to show the line overflowed. I think this was all it took: % Define obj {\catcode`\_=13\gdef_{{\tt\char`\_}% \discretionary{\rlap{$\triangleright$}}{\llap{$\triangleright$}}{}}} \def\obj{\bgroup\catcode`\_=13\hyphenpenalty=10000\relax\sf\sc\endobj} \def\endobj#1{#1\egroup} However, I'm not enough of a TeX wiz to know how to make this work with org-mode, or even if I can. I tried replacing the above with: #+BEGIN_LaTeX curl -v -X GET -H "Authorization:...\", \"access_token\": \"..." "http://blah.blah.blah.com/v1/REST_API_STUFF/..." #+END_LaTeX But (apart from the need to quote the backslashes, etc.), this didn't seem to do what I wanted. Any suggestions on how to force line breaks? Thank you! -pd --------------040207000008050606080003 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit I'm writing a document which includes several example commands, which I've wrapped in #+BEGIN_SRC/#+END_SRC.

In LaTeX/PDF export, these come out in Courier, as I hoped, but they run off the right edge of the page. For example:

#+BEGIN_SRC curl
curl -v -X GET -H "Authorization:...\",   \"access_token\": \"..." "http://blah.blah.blah.com/v1/REST_API_STUFF/..."
#+END_SRC

Years ago, someone on a TeX mailing list offered some code to force line breaking in \tt{...} code, with a \triangleright at the right margin to show the line overflowed. I think this was all it took:

% Define obj
{\catcode`\_=13\gdef_{{\tt\char`\_}%
\discretionary{\rlap{$\triangleright$}}{\llap{$\triangleright$}}{}}}
\def\obj{\bgroup\catcode`\_=13\hyphenpenalty=10000\relax\sf\sc\endobj}
\def\endobj#1{#1\egroup}

However, I'm not enough of a TeX wiz to know how to make this work with org-mode, or even if I can. I tried replacing the above with:

#+BEGIN_LaTeX
curl -v -X GET -H "Authorization:...\",   \"access_token\": \"..." "http://blah.blah.blah.com/v1/REST_API_STUFF/..."
#+END_LaTeX

But (apart from the need to quote the backslashes, etc.), this didn't seem to do what I wanted.

Any suggestions on how to force line breaks?

Thank you!
-pd

--------------040207000008050606080003-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Davis Subject: Re: Forcing line breaks in src (monospace) examples Date: Sun, 14 Jun 2015 10:51:59 -0400 Message-ID: <557D950F.7030009@pfdstudio.com> References: <557D936B.3050501@pfdstudio.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z49GW-0001v9-LX for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 10:52:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z49GT-0006K7-Cd for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 10:52:04 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:60298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z49GT-0006Id-8J for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 10:52:01 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 498C020304 for ; Sun, 14 Jun 2015 10:52:00 -0400 (EDT) In-Reply-To: <557D936B.3050501@pfdstudio.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org On 6/14/15 10:44 AM, Peter Davis wrote: > #+BEGIN_LaTeX > curl -v -X GET -H "Authorization:...\", \"access_token\": \"..." > "http://blah.blah.blah.com/v1/REST_API_STUFF/..." > #+END_LaTeX Sorry, that should be: #+BEGIN_LaTeX \tt{curl -v -X GET -H "Authorization:...\", \"access_token\": \"..." "http://blah.blah.blah.com/v1/REST_API_STUFF/..."} #+END_LaTeX From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Klein Subject: Re: Forcing line breaks in src (monospace) examples Date: Sun, 14 Jun 2015 17:36:37 +0200 Message-ID: <20150614173637.7633a81e@zotac> References: <557D936B.3050501@pfdstudio.com> <557D950F.7030009@pfdstudio.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z49xj-0005a0-Dq for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 11:36:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z49xf-0001LO-Ri for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 11:36:43 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:50748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z49xf-0001LF-IQ for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 11:36:39 -0400 In-Reply-To: <557D950F.7030009@pfdstudio.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Peter Davis Cc: emacs-orgmode@gnu.org Hi, On Sun, 14 Jun 2015 10:51:59 -0400 Peter Davis wrote: > > > On 6/14/15 10:44 AM, Peter Davis wrote: > > #+BEGIN_LaTeX > > curl -v -X GET -H "Authorization:...\", \"access_token\": \"..." > > "http://blah.blah.blah.com/v1/REST_API_STUFF/..." > > #+END_LaTeX > Sorry, that should be: > > > #+BEGIN_LaTeX > \tt{curl -v -X GET -H "Authorization:...\", \"access_token\": > \"..." "http://blah.blah.blah.com/v1/REST_API_STUFF/..."} > #+END_LaTeX > > This will do the job: #+LaTeX_HEADER: \usepackage{xcolor} #+LaTeX_HEADER: \lstset{ #+LaTeX_HEADER: basicstyle=\ttfamily, #+LaTeX_HEADER: breaklines=true, #+LaTeX_HEADER: prebreak=\mbox{\ensuremath{\triangleright}}, #+LaTeX_HEADER: columns=fullflexible, #+LaTeX_HEADER: keepspaces=true #+LaTeX_HEADER: } #+begin_src sh curl -v -X GET -H "Authorization:...", "access_token": "..." "http://blah.blah.blah.com/v1/REST_API_STUFF/..." #+end_src Note I use a `sh' source block, not `curl' and not a LaTeX block. So you'll also be able to publish to HTML and someone using the document can copy and past the command to her/his command line. The `prebreak' setting for some reasons needs some kind of box or the LaTeX process croaks. Also nice, I got this from tex.stackexchange.com/questions/116534/lstlisting-line-wrapping is this postbreak setting for lstlistings (needs the xcolor package above): postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}, Best regards Robert From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Davis Subject: Re: Forcing line breaks in src (monospace) examples Date: Sun, 14 Jun 2015 11:53:22 -0400 Message-ID: <6sw6c7616qnv65.fsf@dhcp-10-82-66-30.hmco.com> References: <557D936B.3050501@pfdstudio.com> <557D950F.7030009@pfdstudio.com> <20150614173637.7633a81e@zotac> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4ADx-0007LW-46 for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 11:53:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4ADs-0007Vc-Ix for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 11:53:29 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:56425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4ADs-0007Uw-Ba for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 11:53:24 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id A58E520367 for ; Sun, 14 Jun 2015 11:53:23 -0400 (EDT) In-Reply-To: <20150614173637.7633a81e@zotac> (Robert Klein's message of "Sun, 14 Jun 2015 17:36:37 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Robert Klein writes: > Hi, > > On Sun, 14 Jun 2015 10:51:59 -0400 > Peter Davis wrote: > >> >> >> On 6/14/15 10:44 AM, Peter Davis wrote: >> > #+BEGIN_LaTeX >> > curl -v -X GET -H "Authorization:...\", \"access_token\": \"..." >> > "http://blah.blah.blah.com/v1/REST_API_STUFF/..." >> > #+END_LaTeX >> Sorry, that should be: >> >> >> #+BEGIN_LaTeX >> \tt{curl -v -X GET -H "Authorization:...\", \"access_token\": >> \"..." "http://blah.blah.blah.com/v1/REST_API_STUFF/..."} >> #+END_LaTeX >> >> > > > This will do the job: > > #+LaTeX_HEADER: \usepackage{xcolor} > #+LaTeX_HEADER: \lstset{ > #+LaTeX_HEADER: basicstyle=\ttfamily, > #+LaTeX_HEADER: breaklines=true, > #+LaTeX_HEADER: prebreak=\mbox{\ensuremath{\triangleright}}, > #+LaTeX_HEADER: columns=fullflexible, > #+LaTeX_HEADER: keepspaces=true > #+LaTeX_HEADER: } > > > #+begin_src sh > curl -v -X GET -H "Authorization:...", "access_token": "..." > "http://blah.blah.blah.com/v1/REST_API_STUFF/..." > #+end_src > > > Note I use a `sh' source block, not `curl' and not a LaTeX block. So > you'll also be able to publish to HTML and someone using the document > can copy and past the command to her/his command line. > > The `prebreak' setting for some reasons needs some kind of box or the > LaTeX process croaks. > > Also nice, I got this from > tex.stackexchange.com/questions/116534/lstlisting-line-wrapping is > this postbreak setting for lstlistings (needs the xcolor package above): > > postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}, > Thanks, Robert. This looks very promising, but it doesn't seem to work for me. Here's my sample document: ------ cut here ------ #+LaTeX_HEADER: \usepackage{xcolor} #+LaTeX_HEADER: \lstset{ #+LaTeX_HEADER: basicstyle=\ttfamily, #+LaTeX_HEADER: breaklines=true, #+LaTeX_HEADER: prebreak=\mbox{\ensuremath{\triangleright}}, #+LaTeX_HEADER: postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}, #+LaTeX_HEADER: columns=fullflexible, #+LaTeX_HEADER: keepspaces=true #+LaTeX_HEADER: } #+LaTeX_CLASS_OPTIONS: [article,letterpaper,times,12pt,listings-bw,microtype] #+author: Peter Davis #+title: Hello, Test Document #+BEGIN_SRC sh curl -v -X GET -H "Authorization:...\", \"access_token\": \"..." "http://blah.blah.blah.com/v1/blahblahblah/..." #+END_SRC ------ cut here ------ Thank you! -pd From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Klein Subject: Re: Forcing line breaks in src (monospace) examples Date: Sun, 14 Jun 2015 18:11:00 +0200 Message-ID: <20150614181100.11ec3d7a@zotac> References: <557D936B.3050501@pfdstudio.com> <557D950F.7030009@pfdstudio.com> <20150614173637.7633a81e@zotac> <6sw6c7616qnv65.fsf@dhcp-10-82-66-30.hmco.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4AV0-0003c2-Fn for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 12:11:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4AUx-0006qp-8v for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 12:11:06 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:55237) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4AUw-0006ql-PG for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 12:11:03 -0400 In-Reply-To: <6sw6c7616qnv65.fsf@dhcp-10-82-66-30.hmco.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Peter Davis Cc: emacs-orgmode@gnu.org Hi Peter, sorry, I have (add-to-list 'org-latex-packages-alist '("" "listingsutf8")) in my .emacs (utf8 version of listings so I can use umlauts). You can also simply put #+LaTeX_HEADER: \usepackage{listings} to the top of the file. (PS: you won't need the xcolor package unless you want your triangle e.g. in red...) Best regards Robert On Sun, 14 Jun 2015 11:53:22 -0400 Peter Davis wrote: > Robert Klein writes: > > > Hi, > > > > On Sun, 14 Jun 2015 10:51:59 -0400 > > Peter Davis wrote: > > > >> > >> > >> On 6/14/15 10:44 AM, Peter Davis wrote: > >> > #+BEGIN_LaTeX > >> > curl -v -X GET -H "Authorization:...\", \"access_token\": > >> > \"..." "http://blah.blah.blah.com/v1/REST_API_STUFF/..." > >> > #+END_LaTeX > >> Sorry, that should be: > >> > >> > >> #+BEGIN_LaTeX > >> \tt{curl -v -X GET -H "Authorization:...\", \"access_token\": > >> \"..." "http://blah.blah.blah.com/v1/REST_API_STUFF/..."} > >> #+END_LaTeX > >> > >> > > > > > > This will do the job: > > > > #+LaTeX_HEADER: \usepackage{xcolor} > > #+LaTeX_HEADER: \lstset{ > > #+LaTeX_HEADER: basicstyle=\ttfamily, > > #+LaTeX_HEADER: breaklines=true, > > #+LaTeX_HEADER: prebreak=\mbox{\ensuremath{\triangleright}}, > > #+LaTeX_HEADER: columns=fullflexible, > > #+LaTeX_HEADER: keepspaces=true > > #+LaTeX_HEADER: } > > > > > > #+begin_src sh > > curl -v -X GET -H "Authorization:...", "access_token": "..." > > "http://blah.blah.blah.com/v1/REST_API_STUFF/..." > > #+end_src > > > > > > Note I use a `sh' source block, not `curl' and not a LaTeX block. > > So you'll also be able to publish to HTML and someone using the > > document can copy and past the command to her/his command line. > > > > The `prebreak' setting for some reasons needs some kind of box or > > the LaTeX process croaks. > > > > Also nice, I got this from > > tex.stackexchange.com/questions/116534/lstlisting-line-wrapping is > > this postbreak setting for lstlistings (needs the xcolor package > > above): > > > > postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}, > > > > Thanks, Robert. This looks very promising, but it doesn't seem to work > for me. Here's my sample document: > > ------ cut here ------ > #+LaTeX_HEADER: \usepackage{xcolor} > #+LaTeX_HEADER: \lstset{ > #+LaTeX_HEADER: basicstyle=\ttfamily, > #+LaTeX_HEADER: breaklines=true, > #+LaTeX_HEADER: prebreak=\mbox{\ensuremath{\triangleright}}, > #+LaTeX_HEADER: > postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}, > #+LaTeX_HEADER: columns=fullflexible, #+LaTeX_HEADER: > keepspaces=true #+LaTeX_HEADER: } > #+LaTeX_CLASS_OPTIONS: > [article,letterpaper,times,12pt,listings-bw,microtype] #+author: > Peter Davis #+title: Hello, Test Document > > #+BEGIN_SRC sh > curl -v -X GET -H "Authorization:...\", \"access_token\": \"..." > "http://blah.blah.blah.com/v1/blahblahblah/..." #+END_SRC > ------ cut here ------ > > Thank you! > > -pd > > > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Davis Subject: Re: Forcing line breaks in src (monospace) examples Date: Sun, 14 Jun 2015 12:23:06 -0400 Message-ID: <6sw6c71thentsl.fsf@dhcp-10-82-66-30.hmco.com> References: <557D936B.3050501@pfdstudio.com> <557D950F.7030009@pfdstudio.com> <20150614173637.7633a81e@zotac> <6sw6c7616qnv65.fsf@dhcp-10-82-66-30.hmco.com> <20150614181100.11ec3d7a@zotac> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4Agh-00058j-Hj for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 12:23:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4Age-0004Jm-AT for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 12:23:11 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:59326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4Age-0004Jc-5m for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 12:23:08 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9DA0720431 for ; Sun, 14 Jun 2015 12:23:07 -0400 (EDT) In-Reply-To: <20150614181100.11ec3d7a@zotac> (Robert Klein's message of "Sun, 14 Jun 2015 18:11:00 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Robert Klein Cc: emacs-orgmode@gnu.org Hi, Robert, That helps (it gets rid of the extra first page), but I'm still not getting the line to wrap. Thanks, -pd Robert Klein writes: > Hi Peter, > > sorry, I have > > (add-to-list 'org-latex-packages-alist '("" "listingsutf8")) > > in my .emacs (utf8 version of listings so I can use umlauts). > > > You can also simply put > > #+LaTeX_HEADER: \usepackage{listings} > > to the top of the file. > > > (PS: you won't need the xcolor package unless you want your triangle > e.g. in red...) > > Best regards > Robert > > > On Sun, 14 Jun 2015 11:53:22 -0400 > Peter Davis wrote: > >> Robert Klein writes: >> >> > Hi, >> > >> > On Sun, 14 Jun 2015 10:51:59 -0400 >> > Peter Davis wrote: >> > >> >> >> >> >> >> On 6/14/15 10:44 AM, Peter Davis wrote: >> >> > #+BEGIN_LaTeX >> >> > curl -v -X GET -H "Authorization:...\", \"access_token\": >> >> > \"..." "http://blah.blah.blah.com/v1/REST_API_STUFF/..." >> >> > #+END_LaTeX >> >> Sorry, that should be: >> >> >> >> >> >> #+BEGIN_LaTeX >> >> \tt{curl -v -X GET -H "Authorization:...\", \"access_token\": >> >> \"..." "http://blah.blah.blah.com/v1/REST_API_STUFF/..."} >> >> #+END_LaTeX >> >> >> >> >> > >> > >> > This will do the job: >> > >> > #+LaTeX_HEADER: \usepackage{xcolor} >> > #+LaTeX_HEADER: \lstset{ >> > #+LaTeX_HEADER: basicstyle=\ttfamily, >> > #+LaTeX_HEADER: breaklines=true, >> > #+LaTeX_HEADER: prebreak=\mbox{\ensuremath{\triangleright}}, >> > #+LaTeX_HEADER: columns=fullflexible, >> > #+LaTeX_HEADER: keepspaces=true >> > #+LaTeX_HEADER: } >> > >> > >> > #+begin_src sh >> > curl -v -X GET -H "Authorization:...", "access_token": "..." >> > "http://blah.blah.blah.com/v1/REST_API_STUFF/..." >> > #+end_src >> > >> > >> > Note I use a `sh' source block, not `curl' and not a LaTeX block. >> > So you'll also be able to publish to HTML and someone using the >> > document can copy and past the command to her/his command line. >> > >> > The `prebreak' setting for some reasons needs some kind of box or >> > the LaTeX process croaks. >> > >> > Also nice, I got this from >> > tex.stackexchange.com/questions/116534/lstlisting-line-wrapping is >> > this postbreak setting for lstlistings (needs the xcolor package >> > above): >> > >> > postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}, >> > >> >> Thanks, Robert. This looks very promising, but it doesn't seem to work >> for me. Here's my sample document: >> >> ------ cut here ------ >> #+LaTeX_HEADER: \usepackage{xcolor} >> #+LaTeX_HEADER: \lstset{ >> #+LaTeX_HEADER: basicstyle=\ttfamily, >> #+LaTeX_HEADER: breaklines=true, >> #+LaTeX_HEADER: prebreak=\mbox{\ensuremath{\triangleright}}, >> #+LaTeX_HEADER: >> postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}, >> #+LaTeX_HEADER: columns=fullflexible, #+LaTeX_HEADER: >> keepspaces=true #+LaTeX_HEADER: } >> #+LaTeX_CLASS_OPTIONS: >> [article,letterpaper,times,12pt,listings-bw,microtype] #+author: >> Peter Davis #+title: Hello, Test Document >> >> #+BEGIN_SRC sh >> curl -v -X GET -H "Authorization:...\", \"access_token\": \"..." >> "http://blah.blah.blah.com/v1/blahblahblah/..." #+END_SRC >> ------ cut here ------ >> >> Thank you! >> >> -pd >> >> >> From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Davis Subject: Re: Forcing line breaks in src (monospace) examples Date: Sun, 14 Jun 2015 12:36:12 -0400 Message-ID: <557DAD7C.1050201@pfdstudio.com> References: <557D936B.3050501@pfdstudio.com> <557D950F.7030009@pfdstudio.com> <20150614173637.7633a81e@zotac> <6sw6c7616qnv65.fsf@dhcp-10-82-66-30.hmco.com> <20150614181100.11ec3d7a@zotac> <6sw6c71thentsl.fsf@dhcp-10-82-66-30.hmco.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4AtP-0007sN-Vy for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 12:36:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4AtJ-00019r-4j for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 12:36:19 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:59349) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4AtJ-00019m-0q for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 12:36:13 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C427A20D0F for ; Sun, 14 Jun 2015 12:36:12 -0400 (EDT) In-Reply-To: <6sw6c71thentsl.fsf@dhcp-10-82-66-30.hmco.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org FWIW, here's the tex generated from my current test: % Created 2015-06-14 Sun 12:33 \documentclass[11pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{fixltx2e} \usepackage{graphicx} \usepackage{longtable} \usepackage{float} \usepackage{wrapfig} \usepackage{rotating} \usepackage[normalem]{ulem} \usepackage{amsmath} \usepackage{textcomp} \usepackage{marvosym} \usepackage{wasysym} \usepackage{amssymb} \usepackage{hyperref} \tolerance=1000 \usepackage{listingsutf8} \usepackage{listings} \usepackage{xcolor} \lstset{ basicstyle=\ttfamily, breaklines=true, prebreak=\mbox{\ensuremath{\color{red}\hookleftarrow}}, postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}, columns=fullflexible, keepspaces=true } \author{Peter Davis} \date{\today} \title{wraptest} \hypersetup{ pdfkeywords={}, pdfsubject={}, pdfcreator={Emacs 24.5.1 (Org mode 8.2.10)}} \begin{document} \maketitle \setcounter{tocdepth}{0} \tableofcontents \begin{verbatim} curl -v -X GET -H "Authorization:...\", \"access_token\": \"..." "http://sandbox.api.hmhco.com/v1/staffSectionAssociations/..." \end{verbatim} % Emacs 24.5.1 (Org mode 8.2.10) \end{document} From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Klein Subject: Re: Forcing line breaks in src (monospace) examples Date: Sun, 14 Jun 2015 18:38:36 +0200 Message-ID: <20150614183836.5db13a41@zotac> References: <557D936B.3050501@pfdstudio.com> <557D950F.7030009@pfdstudio.com> <20150614173637.7633a81e@zotac> <6sw6c7616qnv65.fsf@dhcp-10-82-66-30.hmco.com> <20150614181100.11ec3d7a@zotac> <6sw6c71thentsl.fsf@dhcp-10-82-66-30.hmco.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4Avi-00008y-Hd for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 12:38:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4Avf-0001ni-9y for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 12:38:42 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:57176) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4Avf-0001nQ-0X for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 12:38:39 -0400 In-Reply-To: <6sw6c71thentsl.fsf@dhcp-10-82-66-30.hmco.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Peter Davis Cc: emacs-orgmode@gnu.org Hi Peter, hmm, yes, you have to tell org to use the listings package. It works when I use this one-line .emacs: (setq org-latex-listings t) and your example file plus `#+LaTeX_HEADER: \usepackage{listings}': --- snip --- #+LaTeX_HEADER: \usepackage{listings} #+LaTeX_HEADER: \usepackage{xcolor} #+LaTeX_HEADER: \lstset{ #+LaTeX_HEADER: basicstyle=\ttfamily, #+LaTeX_HEADER: breaklines=true, #+LaTeX_HEADER: prebreak=\mbox{\ensuremath{\triangleright}}, #+LaTeX_HEADER: postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\$ #+LaTeX_HEADER: columns=fullflexible, #+LaTeX_HEADER: keepspaces=true #+LaTeX_HEADER: } #+LaTeX_CLASS_OPTIONS: [article,letterpaper,times,12pt,listings-bw,microtype] #+author: Peter Davis #+title: Hello, Test Document #+BEGIN_SRC sh curl -v -X GET -H "Authorization:...\", \"access_token\": \"..." "http://blah.blah.blah.com/v1/blahblahblah/..." #+END_SRC --- snip --- Sorry for the confusion. Best regards Robert On Sun, 14 Jun 2015 12:23:06 -0400 Peter Davis wrote: > > Hi, Robert, > > That helps (it gets rid of the extra first page), but I'm still not > getting the line to wrap. > > Thanks, > -pd > > > Robert Klein writes: > > > Hi Peter, > > > > sorry, I have > > > > (add-to-list 'org-latex-packages-alist '("" "listingsutf8")) > > > > in my .emacs (utf8 version of listings so I can use umlauts). > > > > > > You can also simply put > > > > #+LaTeX_HEADER: \usepackage{listings} > > > > to the top of the file. > > > > > > (PS: you won't need the xcolor package unless you want your triangle > > e.g. in red...) > > > > Best regards > > Robert > > > > > > On Sun, 14 Jun 2015 11:53:22 -0400 > > Peter Davis wrote: > > > >> Robert Klein writes: > >> > >> > Hi, > >> > > >> > On Sun, 14 Jun 2015 10:51:59 -0400 > >> > Peter Davis wrote: > >> > > >> >> > >> >> > >> >> On 6/14/15 10:44 AM, Peter Davis wrote: > >> >> > #+BEGIN_LaTeX > >> >> > curl -v -X GET -H "Authorization:...\", \"access_token\": > >> >> > \"..." "http://blah.blah.blah.com/v1/REST_API_STUFF/..." > >> >> > #+END_LaTeX > >> >> Sorry, that should be: > >> >> > >> >> > >> >> #+BEGIN_LaTeX > >> >> \tt{curl -v -X GET -H "Authorization:...\", \"access_token\": > >> >> \"..." "http://blah.blah.blah.com/v1/REST_API_STUFF/..."} > >> >> #+END_LaTeX > >> >> > >> >> > >> > > >> > > >> > This will do the job: > >> > > >> > #+LaTeX_HEADER: \usepackage{xcolor} > >> > #+LaTeX_HEADER: \lstset{ > >> > #+LaTeX_HEADER: basicstyle=\ttfamily, > >> > #+LaTeX_HEADER: breaklines=true, > >> > #+LaTeX_HEADER: prebreak=\mbox{\ensuremath{\triangleright}}, > >> > #+LaTeX_HEADER: columns=fullflexible, > >> > #+LaTeX_HEADER: keepspaces=true > >> > #+LaTeX_HEADER: } > >> > > >> > > >> > #+begin_src sh > >> > curl -v -X GET -H "Authorization:...", "access_token": "..." > >> > "http://blah.blah.blah.com/v1/REST_API_STUFF/..." > >> > #+end_src > >> > > >> > > >> > Note I use a `sh' source block, not `curl' and not a LaTeX block. > >> > So you'll also be able to publish to HTML and someone using the > >> > document can copy and past the command to her/his command line. > >> > > >> > The `prebreak' setting for some reasons needs some kind of box or > >> > the LaTeX process croaks. > >> > > >> > Also nice, I got this from > >> > tex.stackexchange.com/questions/116534/lstlisting-line-wrapping > >> > is this postbreak setting for lstlistings (needs the xcolor > >> > package above): > >> > > >> > postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}, > >> > > >> > >> Thanks, Robert. This looks very promising, but it doesn't seem to > >> work for me. Here's my sample document: > >> > >> ------ cut here ------ > >> #+LaTeX_HEADER: \usepackage{xcolor} > >> #+LaTeX_HEADER: \lstset{ > >> #+LaTeX_HEADER: basicstyle=\ttfamily, > >> #+LaTeX_HEADER: breaklines=true, > >> #+LaTeX_HEADER: prebreak=\mbox{\ensuremath{\triangleright}}, > >> #+LaTeX_HEADER: > >> postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}, > >> #+LaTeX_HEADER: columns=fullflexible, #+LaTeX_HEADER: > >> keepspaces=true #+LaTeX_HEADER: } > >> #+LaTeX_CLASS_OPTIONS: > >> [article,letterpaper,times,12pt,listings-bw,microtype] #+author: > >> Peter Davis #+title: Hello, Test Document > >> > >> #+BEGIN_SRC sh > >> curl -v -X GET -H "Authorization:...\", \"access_token\": \"..." > >> "http://blah.blah.blah.com/v1/blahblahblah/..." #+END_SRC > >> ------ cut here ------ > >> > >> Thank you! > >> > >> -pd > >> > >> > >> > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Davis Subject: Re: Forcing line breaks in src (monospace) examples Date: Sun, 14 Jun 2015 13:01:28 -0400 Message-ID: <557DB368.4050301@pfdstudio.com> References: <557D936B.3050501@pfdstudio.com> <557D950F.7030009@pfdstudio.com> <20150614173637.7633a81e@zotac> <6sw6c7616qnv65.fsf@dhcp-10-82-66-30.hmco.com> <20150614181100.11ec3d7a@zotac> <6sw6c71thentsl.fsf@dhcp-10-82-66-30.hmco.com> <20150614183836.5db13a41@zotac> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4BHp-0000KA-Tq for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 13:01:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4BHl-0002xV-Ad for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 13:01:33 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:49802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4BHl-0002v4-65 for emacs-orgmode@gnu.org; Sun, 14 Jun 2015 13:01:29 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 9043120ABF for ; Sun, 14 Jun 2015 13:01:28 -0400 (EDT) In-Reply-To: <20150614183836.5db13a41@zotac> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Ah! I wound up adding this: #+LaTeX_HEADER: \renewenvironment{verbatim}{\begin{lstlisting}}{\end{lstlisting}\ignorespacesafterend} but your approach is cleaner. Thanks! -pd On 6/14/15 12:38 PM, Robert Klein wrote: > Hi Peter, > > hmm, yes, you have to tell org to use the listings package. > > It works when I use this one-line .emacs: > > (setq org-latex-listings t) > > > and your example file plus `#+LaTeX_HEADER: \usepackage{listings}': > > --- snip --- > #+LaTeX_HEADER: \usepackage{listings} > #+LaTeX_HEADER: \usepackage{xcolor} > #+LaTeX_HEADER: \lstset{ > #+LaTeX_HEADER: basicstyle=\ttfamily, > #+LaTeX_HEADER: breaklines=true, > #+LaTeX_HEADER: prebreak=\mbox{\ensuremath{\triangleright}}, > #+LaTeX_HEADER: > postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\$ > #+LaTeX_HEADER: columns=fullflexible, > #+LaTeX_HEADER: keepspaces=true > #+LaTeX_HEADER: } > #+LaTeX_CLASS_OPTIONS: > [article,letterpaper,times,12pt,listings-bw,microtype] > #+author: Peter Davis > #+title: Hello, Test Document > > #+BEGIN_SRC > sh curl -v -X GET -H "Authorization:...\", \"access_token\": \"..." > "http://blah.blah.blah.com/v1/blahblahblah/..." > #+END_SRC > --- snip --- > > Sorry for the confusion. > > Best regards > Robert > > > > > On Sun, 14 Jun 2015 12:23:06 -0400 > Peter Davis wrote: > >> Hi, Robert, >> >> That helps (it gets rid of the extra first page), but I'm still not >> getting the line to wrap. >> >> Thanks, >> -pd >> >> >> Robert Klein writes: >> >>> Hi Peter, >>> >>> sorry, I have >>> >>> (add-to-list 'org-latex-packages-alist '("" "listingsutf8")) >>> >>> in my .emacs (utf8 version of listings so I can use umlauts). >>> >>> >>> You can also simply put >>> >>> #+LaTeX_HEADER: \usepackage{listings} >>> >>> to the top of the file. >>> >>> >>> (PS: you won't need the xcolor package unless you want your triangle >>> e.g. in red...) >>> >>> Best regards >>> Robert >>> >>> >>> On Sun, 14 Jun 2015 11:53:22 -0400 >>> Peter Davis wrote: >>> >>>> Robert Klein writes: >>>> >>>>> Hi, >>>>> >>>>> On Sun, 14 Jun 2015 10:51:59 -0400 >>>>> Peter Davis wrote: >>>>> >>>>>> >>>>>> On 6/14/15 10:44 AM, Peter Davis wrote: >>>>>>> #+BEGIN_LaTeX >>>>>>> curl -v -X GET -H "Authorization:...\", \"access_token\": >>>>>>> \"..." "http://blah.blah.blah.com/v1/REST_API_STUFF/..." >>>>>>> #+END_LaTeX >>>>>> Sorry, that should be: >>>>>> >>>>>> >>>>>> #+BEGIN_LaTeX >>>>>> \tt{curl -v -X GET -H "Authorization:...\", \"access_token\": >>>>>> \"..." "http://blah.blah.blah.com/v1/REST_API_STUFF/..."} >>>>>> #+END_LaTeX >>>>>> >>>>>> >>>>> >>>>> This will do the job: >>>>> >>>>> #+LaTeX_HEADER: \usepackage{xcolor} >>>>> #+LaTeX_HEADER: \lstset{ >>>>> #+LaTeX_HEADER: basicstyle=\ttfamily, >>>>> #+LaTeX_HEADER: breaklines=true, >>>>> #+LaTeX_HEADER: prebreak=\mbox{\ensuremath{\triangleright}}, >>>>> #+LaTeX_HEADER: columns=fullflexible, >>>>> #+LaTeX_HEADER: keepspaces=true >>>>> #+LaTeX_HEADER: } >>>>> >>>>> >>>>> #+begin_src sh >>>>> curl -v -X GET -H "Authorization:...", "access_token": "..." >>>>> "http://blah.blah.blah.com/v1/REST_API_STUFF/..." >>>>> #+end_src >>>>> >>>>> >>>>> Note I use a `sh' source block, not `curl' and not a LaTeX block. >>>>> So you'll also be able to publish to HTML and someone using the >>>>> document can copy and past the command to her/his command line. >>>>> >>>>> The `prebreak' setting for some reasons needs some kind of box or >>>>> the LaTeX process croaks. >>>>> >>>>> Also nice, I got this from >>>>> tex.stackexchange.com/questions/116534/lstlisting-line-wrapping >>>>> is this postbreak setting for lstlistings (needs the xcolor >>>>> package above): >>>>> >>>>> postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}, >>>>> >>>> Thanks, Robert. This looks very promising, but it doesn't seem to >>>> work for me. Here's my sample document: >>>> >>>> ------ cut here ------ >>>> #+LaTeX_HEADER: \usepackage{xcolor} >>>> #+LaTeX_HEADER: \lstset{ >>>> #+LaTeX_HEADER: basicstyle=\ttfamily, >>>> #+LaTeX_HEADER: breaklines=true, >>>> #+LaTeX_HEADER: prebreak=\mbox{\ensuremath{\triangleright}}, >>>> #+LaTeX_HEADER: >>>> postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{red}\hookrightarrow\space}}, >>>> #+LaTeX_HEADER: columns=fullflexible, #+LaTeX_HEADER: >>>> keepspaces=true #+LaTeX_HEADER: } >>>> #+LaTeX_CLASS_OPTIONS: >>>> [article,letterpaper,times,12pt,listings-bw,microtype] #+author: >>>> Peter Davis #+title: Hello, Test Document >>>> >>>> #+BEGIN_SRC sh >>>> curl -v -X GET -H "Authorization:...\", \"access_token\": \"..." >>>> "http://blah.blah.blah.com/v1/blahblahblah/..." #+END_SRC >>>> ------ cut here ------ >>>> >>>> Thank you! >>>> >>>> -pd >>>> >>>> >>>> > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Davis Subject: Re: Forcing line breaks in src (monospace) examples Date: Tue, 23 Jun 2015 10:59:02 -0400 Message-ID: <55897436.9040104@pfdstudio.com> References: <557D936B.3050501@pfdstudio.com> <557D950F.7030009@pfdstudio.com> <20150614173637.7633a81e@zotac> <6sw6c7616qnv65.fsf@dhcp-10-82-66-30.hmco.com> <20150614181100.11ec3d7a@zotac> <6sw6c71thentsl.fsf@dhcp-10-82-66-30.hmco.com> <20150614183836.5db13a41@zotac> <557DB368.4050301@pfdstudio.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7PfH-0002HE-IV for emacs-orgmode@gnu.org; Tue, 23 Jun 2015 10:59:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7PfD-0001uD-K4 for emacs-orgmode@gnu.org; Tue, 23 Jun 2015 10:59:07 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:50971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7PfD-0001tf-EB for emacs-orgmode@gnu.org; Tue, 23 Jun 2015 10:59:03 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 7F8D5203BF for ; Tue, 23 Jun 2015 10:59:02 -0400 (EDT) In-Reply-To: <557DB368.4050301@pfdstudio.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org So getting line breaks in exported LaTeX/PDF src examples is now working beautifully. Is there any way to do this in exported HTML? Thank you, -pd From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Subject: Re: Forcing line breaks in src (monospace) examples Date: Tue, 23 Jun 2015 15:11:48 +0000 Message-ID: References: <557D936B.3050501@pfdstudio.com> <557D950F.7030009@pfdstudio.com> <20150614173637.7633a81e@zotac> <6sw6c7616qnv65.fsf@dhcp-10-82-66-30.hmco.com> <20150614181100.11ec3d7a@zotac> <6sw6c71thentsl.fsf@dhcp-10-82-66-30.hmco.com> <20150614183836.5db13a41@zotac> <557DB368.4050301@pfdstudio.com> <55897436.9040104@pfdstudio.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114ee040c7bc7f051930cfad Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7Prk-0000BB-H3 for emacs-orgmode@gnu.org; Tue, 23 Jun 2015 11:12:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7Prj-0001AE-Ct for emacs-orgmode@gnu.org; Tue, 23 Jun 2015 11:12:00 -0400 Received: from mail-yk0-x229.google.com ([2607:f8b0:4002:c07::229]:34141) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7Prj-0001A3-6z for emacs-orgmode@gnu.org; Tue, 23 Jun 2015 11:11:59 -0400 Received: by ykfy125 with SMTP id y125so7087198ykf.1 for ; Tue, 23 Jun 2015 08:11:58 -0700 (PDT) In-Reply-To: <55897436.9040104@pfdstudio.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Peter Davis , emacs-orgmode@gnu.org --001a114ee040c7bc7f051930cfad Content-Type: text/plain; charset=UTF-8 On the topic of exporting auto-wrapped lines in source code blocks to .tex/.pdf: If you use minted instead of listings, the latest minted 2.0 (probably not yet on tex-live) latex package does line wrapping in the source code blocks very elegantly. https://github.com/gpoore/minted (setq org-latex-listings 'minted) (setq org-latex-minted-options '(("linenos") ("numbersep" "5pt") ("frame" "none") ; box frame is created by the mdframed package ("framesep" "2mm") ;; ("fontfamily" "zi4") ; required only when using pdflatex ; instead of xelatex ;; minted 2.0 specific features ("breaklines") ; line wrapping within code blocks )) On Tue, Jun 23, 2015 at 10:59 AM Peter Davis wrote: > > So getting line breaks in exported LaTeX/PDF src examples is now working > beautifully. > > Is there any way to do this in exported HTML? > > Thank you, > -pd > > > > --001a114ee040c7bc7f051930cfad Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On the topic of exporting auto-wrapped lines in sourc= e code blocks to .tex/.pdf:

If you use minted instead o= f listings, the latest minted 2.0 (probably not yet on tex-live) latex pack= age does line wrapping in the source code blocks very elegantly.


=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (setq org-latex-listings 'minted)

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq org-latex-minted-opti= ons
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 '(("linenos")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("numbersep" =C2=A0 "= 5pt")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ("frame" =C2=A0 =C2=A0 =C2=A0 "none")= ; box frame is created by the mdframed package
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("framesep" = =C2=A0 =C2=A0"2mm")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; ("fontfamily" =C2=A0"z= i4") ; required only when using pdflatex
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ; instead of xelatex
=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = ;; minted 2.0 specific features
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ("breaklines") ; line wrap= ping within code blocks
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 ))




On Tue, = Jun 23, 2015 at 10:59 AM Peter Davis <pfd@pfdstudio.com> wrote:

So getting line breaks in exported LaTeX/PDF src examples is now working beautifully.

Is there any way to do this in exported HTML?

Thank you,
-pd



--001a114ee040c7bc7f051930cfad-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Davis Subject: Re: Forcing line breaks in src (monospace) examples Date: Tue, 23 Jun 2015 11:30:26 -0400 Message-ID: <55897B92.7020907@pfdstudio.com> References: <557D936B.3050501@pfdstudio.com> <557D950F.7030009@pfdstudio.com> <20150614173637.7633a81e@zotac> <6sw6c7616qnv65.fsf@dhcp-10-82-66-30.hmco.com> <20150614181100.11ec3d7a@zotac> <6sw6c71thentsl.fsf@dhcp-10-82-66-30.hmco.com> <20150614183836.5db13a41@zotac> <557DB368.4050301@pfdstudio.com> <55897436.9040104@pfdstudio.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------000008070600070909080806" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53650) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7Q9g-0005AJ-MN for emacs-orgmode@gnu.org; Tue, 23 Jun 2015 11:30:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7Q9b-0002kT-J3 for emacs-orgmode@gnu.org; Tue, 23 Jun 2015 11:30:32 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:58410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7Q9b-0002iO-G8 for emacs-orgmode@gnu.org; Tue, 23 Jun 2015 11:30:27 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id ACE4B20AFD for ; Tue, 23 Jun 2015 11:30:26 -0400 (EDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------000008070600070909080806 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Thanks! I think for my purposes with HTML, it would be sufficient to replace
...
with .... Is there a way to get org to do that on export, or do I have to keep editing the HTML output? Thank you. -pd On 6/23/15 11:11 AM, Kaushal wrote: > On the topic of exporting auto-wrapped lines in source code blocks to > .tex/.pdf: > > If you use minted instead of listings, the latest minted 2.0 (probably > not yet on tex-live) latex package does line wrapping in the source > code blocks very elegantly. ... > > > On Tue, Jun 23, 2015 at 10:59 AM Peter Davis > wrote: > > > So getting line breaks in exported LaTeX/PDF src examples is now > working > beautifully. > > Is there any way to do this in exported HTML? > > Thank you, > -pd > > > --------------000008070600070909080806 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit Thanks!

I think for my purposes with HTML, it would be sufficient to replace <pre>...</pre> with <tt>...</tt>. Is there a way to get org to do that on export, or do I have to keep editing the HTML output?

Thank you.

-pd


On 6/23/15 11:11 AM, Kaushal wrote:
On the topic of exporting auto-wrapped lines in source code blocks to .tex/.pdf:

If you use minted instead of listings, the latest minted 2.0 (probably not yet on tex-live) latex package does line wrapping in the source code blocks very elegantly.
...


On Tue, Jun 23, 2015 at 10:59 AM Peter Davis <pfd@pfdstudio.com> wrote:

So getting line breaks in exported LaTeX/PDF src examples is now working
beautifully.

Is there any way to do this in exported HTML?

Thank you,
-pd




--------------000008070600070909080806--