emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] LaTeX export: Use the same regular expression for identifying horizontal lines as in HTML export
@ 2011-01-24  9:25 Valentin Wüstholz
  2011-02-10 16:05 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Valentin Wüstholz @ 2011-01-24  9:25 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi,

I have attached a small patch that makes LaTeX export use the same
regular expression as HTML export for identifying horizontal lines.
The regular expression used in HTML export seems more useful, since it
allows for leading whitespace, which is for instance introduced by
auto-indenting the buffer.

Best regards,

Valentin

[-- Attachment #2: org-latex.el.diff --]
[-- Type: application/octet-stream, Size: 501 bytes --]

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index ecaf1c0..242b001 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -2261,7 +2261,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
 
   ;; Convert horizontal rules
   (goto-char (point-min))
-  (while (re-search-forward "^----+.$" nil t)
+  (while (re-search-forward "^[ \t]*-\\{5,\\}[ \t]*$" nil t)
     (org-if-unprotected
      (replace-match (org-export-latex-protect-string "\\hrule") t t)))
 

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

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

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

* Re: [PATCH] LaTeX export: Use the same regular expression for identifying horizontal lines as in HTML export
  2011-01-24  9:25 [PATCH] LaTeX export: Use the same regular expression for identifying horizontal lines as in HTML export Valentin Wüstholz
@ 2011-02-10 16:05 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2011-02-10 16:05 UTC (permalink / raw)
  To: Valentin Wüstholz; +Cc: emacs-orgmode

Hi Valentin,

Valentin Wüstholz <wuestholz@gmail.com> writes:

> I have attached a small patch that makes LaTeX export use the same
> regular expression as HTML export for identifying horizontal lines.
> The regular expression used in HTML export seems more useful, since it
> allows for leading whitespace, which is for instance introduced by
> auto-indenting the buffer.

I've now applied this patch, with a minor update of the manual about
horizontal rules.

Thanks for this!

-- 
 Bastien

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

end of thread, other threads:[~2011-02-10 16:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-24  9:25 [PATCH] LaTeX export: Use the same regular expression for identifying horizontal lines as in HTML export Valentin Wüstholz
2011-02-10 16:05 ` Bastien

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