emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Forcing line breaks in src (monospace) examples
@ 2015-06-14 14:44 Peter Davis
  2015-06-14 14:51 ` Peter Davis
  0 siblings, 1 reply; 12+ messages in thread
From: Peter Davis @ 2015-06-14 14:44 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-06-23 15:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-14 14:44 Forcing line breaks in src (monospace) examples Peter Davis
2015-06-14 14:51 ` 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

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