emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: rpgoldman@sift.info
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: Request for suggestions including source code
Date: Thu, 05 May 2011 11:07:45 -0600	[thread overview]
Message-ID: <8739ksvpfs.fsf@gmail.com> (raw)
In-Reply-To: 4DC1D33E.3090700@sift.info

Robert Goldman <rpgoldman@sift.info> writes:

> On 5/4/11 May 4 -5:23 PM, Thomas S. Dye wrote:
>> 
>> On May 4, 2011, at 11:59 AM, Robert Goldman wrote:
>> 
>>> On 5/4/11 May 4 -4:13 PM, Thomas S. Dye wrote:
>>>> Aloha Robert,
>>>>
>>>> Have a look at the listings and minted packages.  You can specify font
>>>> size on a per-document or per-language basis.  I believe listings has an
>>>> option to wrap long lines (don't remember this for minted, though).
>>>>
>>>> The instructions here might be helpful:
>>>>
>>>> http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-12_2
>>>
>>> Hm.  I'm still grappling with this.  I am including many of these
>>> examples by using a source snippet (in sh) that goes out and pulls the
>>> example out of a source code file.
>>>
>>> Even after adding
>>>
>>> #+LaTeX_HEADER \usepackage{listings}
>>>
>>> and
>>>
>>> #+src: setup-listings
>>>
>> 
>> Sorry for the confusion.  In the example, the line
>> 
>> #+source: setup-listings
>> 
>> names the source code block that follows.   I don't think it will do
>> anything by itself in your document.
>> 
>> That code block named setup-listings contains an example of a listings
>> setup that maps Org-mode's output for Emacs Lisp code blocks to
>> something listings recognizes.  It can be executed in Org-mode, using
>> Babel, to setup the listings export.  After this is done, then the
>> example should export correctly.
>> 
>> I'm not sure what is going wrong on your end.  Perhaps
>> org-export-latex-custom-lang-environments needs to be configured for the
>> language you're using?
>
> Is there any chance that this won't work because I have a source snippet
> in one language (sh) that returns as results a source snippet in a
> /different/ language (a lisp-like domain-specific language)?  I don't
> off-hand see how I can come up with a single label for the source block
> that takes this into account....
>
> This may be a weird enough case that I should be aiming at a solution
> that is much simpler:  e.g., just figuring out how to change all of my
> verbatim environments to use a smaller font or changing the export
> behavior so that /all/ verbatim blocks turn into listings blocks.
>

You could customize the value of the `org-export-latex-verbatim-wrap'
variable to include a line of latex to shrink the font size.  For
example

#+begin_src emacs-lisp :results silent
  (setq org-export-latex-verbatim-wrap
        '("{\\scriptsize\n\\begin{verbatim}\n" . "\\end{verbatim}\n}\n"))
#+end_src

Best -- Eric

>
> Best,
> r
>
>

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

      parent reply	other threads:[~2011-05-05 20:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-04 20:53 Request for suggestions including source code Robert Goldman
2011-05-04 21:13 ` Thomas S. Dye
2011-05-04 21:44   ` Nick Dokos
2011-05-04 22:01     ` Robert Goldman
2011-05-04 23:10       ` Nick Dokos
2011-05-05  0:11         ` Robert Goldman
2011-05-04 21:59   ` Robert Goldman
2011-05-04 22:23     ` Thomas S. Dye
2011-05-04 22:29       ` Robert Goldman
2011-05-04 22:49         ` brian powell
2011-05-05 17:07         ` Eric Schulte [this message]

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=8739ksvpfs.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rpgoldman@sift.info \
    /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).