emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ed Hirgelt <ehirgelt@gmail.com>
To: Carsten Dominik <dominik@science.uva.nl>
Cc: emacs-orgmode emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Patch to LaTeX Export verbatim
Date: Wed, 17 Jun 2009 11:23:04 -0700	[thread overview]
Message-ID: <9ABF835C-5E1E-49F8-ABF1-FC6ACEE50437@gmail.com> (raw)

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

I use memoir with LaTeX and like the boxedverbatim environment. And I  
often
need to wrap that in a mini page to keep it all together.  So I put this
hack together to generalize the way that source is exported to LaTeX.

Hope you can incorporate it.  It is against the latest org-exp.el from  
git.

Thanks,
Ed Hirgelt

[-- Attachment #2: org-exp.patch --]
[-- Type: application/octet-stream, Size: 1241 bytes --]

--- org-exp.el-keep	2009-06-11 15:51:10.000000000 -0700
+++ org-exp.el	2009-06-17 11:04:26.000000000 -0700
@@ -452,6 +452,19 @@
   :group 'org-export-latex
   :type 'boolean)
 
+(defcustom org-export-LaTeX-verbatim-wrap '("\\begin{verbatim}\n"
+					    "\\end{verbatim}\n")
+  "When exporting a fixed-width section with LaTeX use the first
+item in the list to open the environment and the second to close
+it.
+
+Defaults to \\begin{verbatim} and \\end{verbatim}.
+"
+  :group 'org-export_translation
+  :group 'org-export-latex
+  :type '(list  (string :tag "Open")
+		(string :tag "Close")))
+
 (defcustom org-export-with-fixed-width t
   "Non-nil means, lines starting with \":\" will be in fixed width font.
 This can be used to have pre-formatted text, fragments of code etc.  For
@@ -2248,7 +2261,8 @@
 	     ((eq backend 'latex)
 	      (setq rtn (org-export-number-lines rtn 'latex 0 0 num cont rpllbl fmt))
 	      (concat "\n#+BEGIN_LaTeX\n"
-		      (org-add-props (concat "\\begin{verbatim}\n" rtn "\n\\end{verbatim}\n")
+		      (org-add-props (concat (car org-export-LaTeX-verbatim-wrap)
+					     rtn (cadr org-export-LaTeX-verbatim-wrap))
 			  '(org-protected t))
 		      "#+END_LaTeX\n\n"))
 	     ((eq backend 'ascii)

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



[-- Attachment #4: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

             reply	other threads:[~2009-06-17 18:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-17 18:23 Ed Hirgelt [this message]
2009-06-18  7:32 ` Patch to LaTeX Export verbatim Carsten Dominik
2009-06-18  8:21 ` Carsten Dominik

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=9ABF835C-5E1E-49F8-ABF1-FC6ACEE50437@gmail.com \
    --to=ehirgelt@gmail.com \
    --cc=dominik@science.uva.nl \
    --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).