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