emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Patch to LaTeX Export verbatim
@ 2009-06-17 18:23 Ed Hirgelt
  2009-06-18  7:32 ` Carsten Dominik
  2009-06-18  8:21 ` Carsten Dominik
  0 siblings, 2 replies; 3+ messages in thread
From: Ed Hirgelt @ 2009-06-17 18:23 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode emacs-orgmode

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

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

* Re: Patch to LaTeX Export verbatim
  2009-06-17 18:23 Patch to LaTeX Export verbatim Ed Hirgelt
@ 2009-06-18  7:32 ` Carsten Dominik
  2009-06-18  8:21 ` Carsten Dominik
  1 sibling, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2009-06-18  7:32 UTC (permalink / raw)
  To: Ed Hirgelt; +Cc: emacs-orgmode emacs-orgmode, Carsten Dominik

Applied, with the following changes:

The variable has been renamed to org-export-latex-verbatim-wrap and
its definition has been moved to org-latex.el.  The value of the
variable must be a cons cell, not a list (just because this is how
Org usually works for options like this, not because it is truly  
better).

Thanks.

- Carsten

On Jun 17, 2009, at 8:23 PM, Ed Hirgelt wrote:

> 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
> <org-exp.patch>
> _______________________________________________
> 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

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

* Re: Patch to LaTeX Export verbatim
  2009-06-17 18:23 Patch to LaTeX Export verbatim Ed Hirgelt
  2009-06-18  7:32 ` Carsten Dominik
@ 2009-06-18  8:21 ` Carsten Dominik
  1 sibling, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2009-06-18  8:21 UTC (permalink / raw)
  To: Ed Hirgelt; +Cc: emacs-orgmode emacs-orgmode, Carsten Dominik

Applied, with the following changes:

The variable has been renamed to org-export-latex-verbatim-wrap and
its definition has been moved to org-latex.el.  The value of the
variable must be a cons cell, not a list (just because this is how
Org usually works for options like this, not because it is truly  
better).

Thanks.

- Carsten

On Jun 17, 2009, at 8:23 PM, Ed Hirgelt wrote:

> 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
> <org-exp.patch>
> _______________________________________________
> 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

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

end of thread, other threads:[~2009-06-18  8:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-17 18:23 Patch to LaTeX Export verbatim Ed Hirgelt
2009-06-18  7:32 ` Carsten Dominik
2009-06-18  8:21 ` Carsten Dominik

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