emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* centering blocks cause latex export to crash
@ 2011-12-14 21:06 Robert Goldman
  2011-12-14 21:13 ` Nick Dokos
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Robert Goldman @ 2011-12-14 21:06 UTC (permalink / raw)
  To: Org Mode

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

I am using the latest org from git.

The attached org-mode file causes latex export to crash with an error of
"unbalanced begin/end center blocks with ...."

This did work, as recently as a month ago, so something relatively
recent has broken it.

best,
r

[-- Attachment #2: center-export-bug.org --]
[-- Type: text/plain, Size: 707 bytes --]

#+TITLE:     center-export-bug.org
#+AUTHOR:    Robert P. Goldman
#+EMAIL:     rpgoldman@sift.info
#+DATE:      2011-12-14 Wed
#+DESCRIPTION:
#+KEYWORDS:
#+LANGUAGE:  en
#+OPTIONS:   H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+LINK_UP:   
#+LINK_HOME: 
#+XSLT:
#+TAGS: noexport

#+begin_center
Not Cleared for Public Release
#+end_center

* Problem with centering block.

My document fails to export successfully to latex with the above =center= block
in it.


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

* Re: centering blocks cause latex export to crash
  2011-12-14 21:06 centering blocks cause latex export to crash Robert Goldman
@ 2011-12-14 21:13 ` Nick Dokos
  2011-12-14 21:41   ` Robert Goldman
  2011-12-14 21:28 ` Robert Goldman
  2011-12-23 17:54 ` Bastien
  2 siblings, 1 reply; 8+ messages in thread
From: Nick Dokos @ 2011-12-14 21:13 UTC (permalink / raw)
  To: rpgoldman; +Cc: nicholas.dokos, Org Mode

Robert Goldman <rpgoldman@sift.info> wrote:

> I am using the latest org from git.
> 
> The attached org-mode file causes latex export to crash with an error of
> "unbalanced begin/end center blocks with ...."
> 
> This did work, as recently as a month ago, so something relatively
> recent has broken it.
> 
> best,
> r

Indeed, but note that the latex exporter has always been a little flaky
with stuff before the first headline. As a workaround, if you add a
headline before the block, it works.

Nick

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

* Re: centering blocks cause latex export to crash
  2011-12-14 21:06 centering blocks cause latex export to crash Robert Goldman
  2011-12-14 21:13 ` Nick Dokos
@ 2011-12-14 21:28 ` Robert Goldman
  2011-12-23 17:54 ` Bastien
  2 siblings, 0 replies; 8+ messages in thread
From: Robert Goldman @ 2011-12-14 21:28 UTC (permalink / raw)
  To: Org Mode

On 12/14/11 Dec 14 -3:06 PM, Robert Goldman wrote:
> I am using the latest org from git.
> 
> The attached org-mode file causes latex export to crash with an error of
> "unbalanced begin/end center blocks with ...."
> 
> This did work, as recently as a month ago, so something relatively
> recent has broken it.

I got in the debugger, and the problem is that the regular expression
for the end of the centering block, computed as inner-re in
org-export-blocks-preprocess fails to match my #+end_center

inner-re is:

(inner-re (format "[\r\n][ \t]*#\\+\\(begin\\|end\\)_%s"
				     (regexp-quote (downcase (match-string 2)))))

I don't understand why this is happening: I haven't been able to tell if
the regular expression is incorrectly written, so it fails to find the
ending of the center block, or if somehow the logic in the while loop
(which counts begins and ends to make sure they match) is counting wrong.

Cheers,
r

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

* Re: centering blocks cause latex export to crash
  2011-12-14 21:13 ` Nick Dokos
@ 2011-12-14 21:41   ` Robert Goldman
  2011-12-14 22:16     ` Nick Dokos
  0 siblings, 1 reply; 8+ messages in thread
From: Robert Goldman @ 2011-12-14 21:41 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Org Mode

On 12/14/11 Dec 14 -3:13 PM, Nick Dokos wrote:
> Robert Goldman <rpgoldman@sift.info> wrote:
> 
>> I am using the latest org from git.
>>
>> The attached org-mode file causes latex export to crash with an error of
>> "unbalanced begin/end center blocks with ...."
>>
>> This did work, as recently as a month ago, so something relatively
>> recent has broken it.
>>
>> best,
>> r
> 
> Indeed, but note that the latex exporter has always been a little flaky
> with stuff before the first headline. As a workaround, if you add a
> headline before the block, it works.
> 
> Nick

Thanks.  But the workaround is not ideal here --- the centering block is
supposed to say "Not Cleared for Public Release" for reasons of
conditions on my research grant, and that really is not supposed to be
in a heading.

I have another work-around, but I think the general principle is that
forbidding text before the first header is not an ideal constraint. If
there's a way to have a header that doesn't produce output (a la
noexport), but that doesn't suppress its children, that might be a handy
way to accomplish this.  I don't know if that's possible (that would
also be handy for outlines where you want the outline structure to "fade
away" and just leave you with the text that the outline inspired).

Best,
r

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

* Re: centering blocks cause latex export to crash
  2011-12-14 21:41   ` Robert Goldman
@ 2011-12-14 22:16     ` Nick Dokos
  0 siblings, 0 replies; 8+ messages in thread
From: Nick Dokos @ 2011-12-14 22:16 UTC (permalink / raw)
  To: rpgoldman; +Cc: nicholas.dokos, Org Mode

Robert Goldman <rpgoldman@sift.info> wrote:


> Thanks.  But the workaround is not ideal here --- the centering block is
> supposed to say "Not Cleared for Public Release" for reasons of
> conditions on my research grant, and that really is not supposed to be
> in a heading.
> 

Can it be in a watermark? Something like this perhaps:

#+LATEX_HEADER: \usepackage{draftwatermark}
#+LATEX_HEADER: \SetWatermarkText{Not Cleared for Public Release}
#+LATEX_HEADER: \SetWatermarkFontSize{42pt}

> I have another work-around, but I think the general principle is that
> forbidding text before the first header is not an ideal constraint. If
> there's a way to have a header that doesn't produce output (a la
> noexport), but that doesn't suppress its children, that might be a handy
> way to accomplish this.  I don't know if that's possible (that would
> also be handy for outlines where you want the outline structure to "fade
> away" and just leave you with the text that the outline inspired).
> 

Agreeed - I believe it's a long standing weakness in the implementation
of the exporter and I also believe we'll see a reimplementation (soon?)
based on Nicolas's parser. BTW, I wonder what the parser says about text
before the first headline.

Nick

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

* Re: centering blocks cause latex export to crash
  2011-12-14 21:06 centering blocks cause latex export to crash Robert Goldman
  2011-12-14 21:13 ` Nick Dokos
  2011-12-14 21:28 ` Robert Goldman
@ 2011-12-23 17:54 ` Bastien
  2011-12-23 18:41   ` Nick Dokos
  2 siblings, 1 reply; 8+ messages in thread
From: Bastien @ 2011-12-23 17:54 UTC (permalink / raw)
  To: rpgoldman; +Cc: Org Mode

Hi Robert,

Robert Goldman <rpgoldman@sift.info> writes:

> The attached org-mode file causes latex export to crash with an error of
> "unbalanced begin/end center blocks with ...."

This should work as expected now - please pull and confirm.

Thanks,

-- 
 Bastien

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

* Re: centering blocks cause latex export to crash
  2011-12-23 17:54 ` Bastien
@ 2011-12-23 18:41   ` Nick Dokos
  2011-12-24 22:27     ` Robert Goldman
  0 siblings, 1 reply; 8+ messages in thread
From: Nick Dokos @ 2011-12-23 18:41 UTC (permalink / raw)
  To: Bastien; +Cc: nicholas.dokos, Org Mode, rpgoldman

Bastien <bzg@altern.org> wrote:

> Hi Robert,
> 
> Robert Goldman <rpgoldman@sift.info> writes:
> 
> > The attached org-mode file causes latex export to crash with an error of
> > "unbalanced begin/end center blocks with ...."
> 
> This should work as expected now - please pull and confirm.
> 

I tried it with Robert's skeleton input file: AFAICT, it works as
expected. I hope it works with Robert's real file too.

Thanks for fixing it!

Nick

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

* Re: centering blocks cause latex export to crash
  2011-12-23 18:41   ` Nick Dokos
@ 2011-12-24 22:27     ` Robert Goldman
  0 siblings, 0 replies; 8+ messages in thread
From: Robert Goldman @ 2011-12-24 22:27 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: Bastien, Org Mode

On 12/23/11 Dec 23 -12:41 PM, Nick Dokos wrote:
> Bastien <bzg@altern.org> wrote:
> 
>> Hi Robert,
>>
>> Robert Goldman <rpgoldman@sift.info> writes:
>>
>>> The attached org-mode file causes latex export to crash with an error of
>>> "unbalanced begin/end center blocks with ...."
>>
>> This should work as expected now - please pull and confirm.
>>
> 
> I tried it with Robert's skeleton input file: AFAICT, it works as
> expected. I hope it works with Robert's real file too.
> 
> Thanks for fixing it!
> 
> Nick

Yes, this works with my original source file, too!

Thanks and Happy Holidays!

Robert

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

end of thread, other threads:[~2011-12-24 22:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-14 21:06 centering blocks cause latex export to crash Robert Goldman
2011-12-14 21:13 ` Nick Dokos
2011-12-14 21:41   ` Robert Goldman
2011-12-14 22:16     ` Nick Dokos
2011-12-14 21:28 ` Robert Goldman
2011-12-23 17:54 ` Bastien
2011-12-23 18:41   ` Nick Dokos
2011-12-24 22:27     ` Robert Goldman

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