emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Empty inline tasks in latex export
@ 2014-05-16  2:19 R. Michael Weylandt
  2014-05-16  8:39 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: R. Michael Weylandt @ 2014-05-16  2:19 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

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

If the body if the inline task is empty, org-latex-inlinetask writes
nil in the exported document. This patch skips including contents (and
the bar above it) if it's nil.

Michael

[-- Attachment #2: 0001-Handle-empty-tasks-without-printing-nil-in-org-latex.patch --]
[-- Type: application/octet-stream, Size: 1321 bytes --]

From ea2156ca9d6bfe1ec98cc767af8e2d7bc5a1442d Mon Sep 17 00:00:00 2001
From: Michael Weylandt <michael.weylandt@gmail.com>
Date: Thu, 15 May 2014 22:06:47 -0400
Subject: [PATCH] Handle empty tasks without printing nil in
 org-latex-inlinetask

* ox-latex.el (org-latex-inlinetask): Skip printing of task body if
  contents is nil

TINYCHANGE
---
 lisp/ox-latex.el | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index cea21be..7129efd 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1625,16 +1625,17 @@ holding contextual information."
 	       title
 	       (when tags (format "\\hfill{}\\textsc{:%s:}"
 				  (mapconcat 'identity tags ":"))))))
-	 (format (concat "\\begin{center}\n"
-			 "\\fbox{\n"
-			 "\\begin{minipage}[c]{.6\\textwidth}\n"
-			 "%s\n\n"
-			 "\\rule[.8em]{\\textwidth}{2pt}\n\n"
-			 "%s"
-			 "\\end{minipage}\n"
-			 "}\n"
-			 "\\end{center}")
-		 full-title contents))))))
+	 (concat "\\begin{center}\n"
+		 "\\fbox{\n"
+		 "\\begin{minipage}[c]{.6\\textwidth}\n"
+		 (format "%s\n\n" full-title)
+		 (if contents
+		     (format "\\rule[.8em]{\\textwidth}{2pt}\n\n%s"
+			     contents))		 
+		 "\\end{minipage}\n"
+		 "}\n"
+		 "\\end{center}"))))))
+		 
 
 
 ;;;; Italic
-- 
1.8.3.4 (Apple Git-47)


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

* Re: [PATCH] Empty inline tasks in latex export
  2014-05-16  2:19 [PATCH] Empty inline tasks in latex export R. Michael Weylandt
@ 2014-05-16  8:39 ` Nicolas Goaziou
  2014-05-16 13:03   ` Michael Weylandt
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2014-05-16  8:39 UTC (permalink / raw)
  To: R. Michael Weylandt; +Cc: emacs-orgmode@gnu.org

Hello,

"R. Michael Weylandt" <michael.weylandt@gmail.com> writes:

> If the body if the inline task is empty, org-latex-inlinetask writes
> nil in the exported document. This patch skips including contents (and
> the bar above it) if it's nil.

Thank you for reporting it and providing this patch. I applied
a slightly different version.


Regards,

-- 
Nicolas Goaziou

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

* Re: [PATCH] Empty inline tasks in latex export
  2014-05-16  8:39 ` Nicolas Goaziou
@ 2014-05-16 13:03   ` Michael Weylandt
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Weylandt @ 2014-05-16 13:03 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode@gnu.org

On May 16, 2014, at 4:39, Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> Hello,
> 
> "R. Michael Weylandt" <michael.weylandt@gmail.com> writes:
> 
>> If the body if the inline task is empty, org-latex-inlinetask writes
>> nil in the exported document. This patch skips including contents (and
>> the bar above it) if it's nil.
> 
> Thank you for reporting it and providing this patch. I applied
> a slightly different version.

Great,
Thanks for this

Michael

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

end of thread, other threads:[~2014-05-16 13:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-16  2:19 [PATCH] Empty inline tasks in latex export R. Michael Weylandt
2014-05-16  8:39 ` Nicolas Goaziou
2014-05-16 13:03   ` Michael Weylandt

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