emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Peter Davis <pfd@pfdstudio.com>
To: emacs-orgmode@gnu.org
Subject: Forcing line breaks in src (monospace) examples
Date: Sun, 14 Jun 2015 10:44:59 -0400	[thread overview]
Message-ID: <557D936B.3050501@pfdstudio.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

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


[-- Attachment #2: Type: text/html, Size: 4094 bytes --]

             reply	other threads:[~2015-06-14 14:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-14 14:44 Peter Davis [this message]
2015-06-14 14:51 ` Forcing line breaks in src (monospace) examples Peter Davis
2015-06-14 15:36   ` Robert Klein
2015-06-14 15:53     ` Peter Davis
2015-06-14 16:11       ` Robert Klein
2015-06-14 16:23         ` Peter Davis
2015-06-14 16:36           ` Peter Davis
2015-06-14 16:38           ` Robert Klein
2015-06-14 17:01             ` Peter Davis
2015-06-23 14:59               ` Peter Davis
2015-06-23 15:11                 ` Kaushal
2015-06-23 15:30                   ` Peter Davis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=557D936B.3050501@pfdstudio.com \
    --to=pfd@pfdstudio.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).