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--