emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Carsten Dominik <dominik@science.uva.nl>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-export-region-as-latex exports more than region
Date: Wed, 06 Feb 2008 19:08:07 -0500	[thread overview]
Message-ID: <1654.1202342887@alphaville.zko.hp.com> (raw)
In-Reply-To: Your message of "Sun, 03 Feb 2008 09:22:03 +0100." <FEE716EF-6C98-432E-9A99-BE83550B6DBB@science.uva.nl>

Carsten Dominik <dominik@science.uva.nl> wrote:

> 
> On Jan 28, 2008, at 8:41 PM, Scott Otterson wrote:
> 
>     Tables are one of the handiest org mode features, especially since I can export them into latex.  But there's a small bug:  If I
>     select a single table in an org file, and then type:
>    
>       M-x org-export-region-as-latex
>     org mode exports all tables in that file, plus some miscellaneous headlines.

> If you select a table and then export to latex normally, you should get a
> file with just the table and some document setup around it.
> 
> So maybe this is a misunderstanding, or I cannot reproduce what you describe.
> 

GNU Emacs 22.1.50.2 (i686-pc-linux-gnu, GTK+ Version 2.10.11) of 2007-11-23
Org-mode version 5.19a

I tried to do this with a file that contains a headline, a little text
and two copies of the same table (I shortened the second one so I could
tell which one is which). If there is nothing before the headline:

------------------------------cut--------------------------------------------
* Headline

text text text

| first table elided
#+TBLFM: $2=2*$1+1::$3=$2 % 8::$4=$2^2::$5=$4 - 1::$6=($2*$2 - 1) / 8::$7=$6 % 2

| second table elided
#+TBLFM: $2=2*$1+1::$3=$2 % 8::$4=$2^2::$5=$4 - 1::$6=($2*$2 - 1) / 8::$7=$6 % 2
------------------------------cut--------------------------------------------

and I select everything from the beginning to the empty line separating
the two tables, then I get a very "interesting" buffer when I run
org-export-region-as-latex. It contains:

 - The standard latex preamble.

 - The headline in an \itemize environment.

 - The text.

 - One \tabular environment containing the first table concatenated with
   the second table.

 - We then repeat items 2 and 3.

 - One \tabular environment containing the first table.

 - Then a \section with the headline.

 - Then the text.

 - Then another \tabular containing the first table.


If I add an empty line before the headline and select from the beginning
(i.e. including the empty line just added) to the empty line between the
two tables, everything works as expected. If I omit the initial empty
line from the region (i.e. select from the headline on), I get crazy
output but not quite as crazy as before: the fourth and fifth items
above are not there, but everything else is.

I did a little tracing and it looks to me that the function
org-export-latex-first-lines returns much more than it should in the two
strange cases above.

HTH,
Nick

PS. Here is a suggestion so that org-version behaves like emacs-version -
makes it easier to insert version strings in mail messages and bug reports:

(defun org-version (&optional here)
  (interactive "P")
  (let ((version (format "Org-mode version %s" org-version)))
    (message version)
    (if here
        (insert version))))

  parent reply	other threads:[~2008-02-07  0:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-28 19:41 org-export-region-as-latex exports more than region Scott Otterson
2008-02-03  8:22 ` Carsten Dominik
2008-02-06 19:38   ` Scott Otterson
2008-02-08 18:07     ` Scott Otterson
2008-02-07  0:08   ` Nick Dokos [this message]
2008-02-07  9:41     ` Carsten Dominik
2008-02-08 15:13     ` Bastien Guerry
  -- strict thread matches above, loose matches on Subject: below --
2008-01-28 19:41 Scott Otterson

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=1654.1202342887@alphaville.zko.hp.com \
    --to=nicholas.dokos@hp.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).