emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Latex export problem with babel latex blocks when including files
@ 2011-03-16 12:30 Suvayu Ali
  2011-03-16 13:22 ` Eric Schulte
  2011-03-16 14:18 ` Eric S Fraga
  0 siblings, 2 replies; 5+ messages in thread
From: Suvayu Ali @ 2011-03-16 12:30 UTC (permalink / raw)
  To: Org mode mailing list

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

Hi Orgers,

I have been writing a large document in Org mode for pdf export with
latex. I use babel latex blocks for things like equations, and I have a
separate file as my appendix which I include in my primary org file.

Today when I introduced a babel latex block in the appendix, I noticed
that while exporting to latex/pdf, org wants to add the headline with
the latex babel block from the appendix at the end of the master org
file. I would expect no such behaviour while export.

I can replicate this bug with the two attached minimal org files. Can
someone confirm this?

Thanks,

-- 
Suvayu

Open source is the future. It sets us free.

[-- Attachment #2: appendix.org --]
[-- Type: text/plain, Size: 292 bytes --]

\appendix
# Needs \usepackage{appendix}
\appendixpage
\addappheadtotoc

* This is appendix A

  Definition of psedorapidity.

  #+begin_src latex
    \begin{equation}
    \label{eq:eta}
    \eta = -\ln\Bigg[\tan\Bigg(\frac{\theta}{2}\Bigg)\Bigg]
    \end{equation}
  #+end_src

[-- Attachment #3: test.org --]
[-- Type: text/plain, Size: 1167 bytes --]

#+TITLE:     Document title
#+AUTHOR:    Suvayu Ali
#+DATE:      \today
#+DESCRIPTION:
#+KEYWORDS:
#+LANGUAGE:  en
#+OPTIONS:   H:4 num:t toc:t ::t |:t ^:t -:t f:t *:t <:nil
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:nil pri:nil tags:nil
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport

#+BIND: org-confirm-babel-evaluate nil
# #+BIND: org-export-latex-title-command ""

#+LaTeX_CLASS: book
#+LaTeX_CLASS_OPTIONS: [12pt,letterpaper,oneside,colorlinks]
#+LaTeX_HEADER: \usepackage{amsmath}
#+LaTeX_HEADER: \usepackage{mathtools}
#+LaTeX_HEADER: \usepackage{appendix}
# #+LaTeX_HEADER: \maketitle

* Title of part 1

** Title of chapter 1
   Some text.

* Title of part 2

** Title of chapter 3
   The Standard Model gauge group is shown in \autoref{eq:symgrp}
   #+begin_src latex
     \begin{equation}
     \label{eq:symgrp}
     SU(3) \times SU(2) \times U(1)
     \end{equation}
   #+end_src


#+INCLUDE: appendix.org :minlevel 1

\backmatter
\newpage
\addcontentsline{toc}{chapter}{\bibname}

\bibliographystyle{plain}
\bibliography{master}


# Local Variables:
# org-export-allow-BIND: t
# End:

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

* Re: [BUG] Latex export problem with babel latex blocks when including files
  2011-03-16 12:30 [BUG] Latex export problem with babel latex blocks when including files Suvayu Ali
@ 2011-03-16 13:22 ` Eric Schulte
  2011-03-16 18:32   ` Suvayu Ali
  2011-03-16 14:18 ` Eric S Fraga
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Schulte @ 2011-03-16 13:22 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: Org mode mailing list

Hi,

First, you may well already be aware of this, but a block like the
following

#+begin_src latex
  \begin{equation}
    \label{eq:eta}
    \eta = -\ln\Bigg[\tan\Bigg(\frac{\theta}{2}\Bigg)\Bigg]
  \end{equation}
#+end_src

could just as easily be written as

\begin{equation}
  \label{eq:eta}
  \eta = -\ln\Bigg[\tan\Bigg(\frac{\theta}{2}\Bigg)\Bigg]
\end{equation}

Org-mode will recognize the inline latex, and will export it to both
html and tex as desired.

Second, I've run into similar headline issues when trying to place a
bibliography under it's own headline at the end of an Org-mode file.  I
believe that the answer here is to simply remove the headline from your
appendix file.  I don't believe that there exists any syntax by which to
tell Org-mode to not export a headline.

Best -- Eric

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> Hi Orgers,
>
> I have been writing a large document in Org mode for pdf export with
> latex. I use babel latex blocks for things like equations, and I have a
> separate file as my appendix which I include in my primary org file.
>
> Today when I introduced a babel latex block in the appendix, I noticed
> that while exporting to latex/pdf, org wants to add the headline with
> the latex babel block from the appendix at the end of the master org
> file. I would expect no such behaviour while export.
>
> I can replicate this bug with the two attached minimal org files. Can
> someone confirm this?
>
> Thanks,

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

* Re: [BUG] Latex export problem with babel latex blocks when including files
  2011-03-16 12:30 [BUG] Latex export problem with babel latex blocks when including files Suvayu Ali
  2011-03-16 13:22 ` Eric Schulte
@ 2011-03-16 14:18 ` Eric S Fraga
  2011-03-16 18:42   ` Suvayu Ali
  1 sibling, 1 reply; 5+ messages in thread
From: Eric S Fraga @ 2011-03-16 14:18 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: Org mode mailing list

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> Hi Orgers,
>
> I have been writing a large document in Org mode for pdf export with
> latex. I use babel latex blocks for things like equations, and I have a
> separate file as my appendix which I include in my primary org file.
>
> Today when I introduced a babel latex block in the appendix, I noticed
> that while exporting to latex/pdf, org wants to add the headline with
> the latex babel block from the appendix at the end of the master org
> file. I would expect no such behaviour while export.
>
> I can replicate this bug with the two attached minimal org files. Can
> someone confirm this?
>
> Thanks,

I cannot confirm this.  I get:

--8<---------------cut here---------------start------------->8---
...
\chapter{Title of chapter 3}
\label{sec-3_1}

   The Standard Model gauge group is shown in \autoref{eq:symgrp}

   \begin{equation}
        \label{eq:symgrp}
        SU(3) \times SU(2) \times U(1)
        \end{equation}

\appendix
\appendixpage
\addappheadtotoc
\section{This is appendix A}
\label{sec-3_1_1}


    Definition of psedorapidity.


    \begin{equation}
          \label{eq:eta}
          \eta = -\ln\Bigg[\tan\Bigg(\frac{\theta}{2}\Bigg)\Bigg]
          \end{equation}
...
--8<---------------cut here---------------end--------------->8---

which is what I would expect.  What do you get that is different?  Or
did I misunderstand your question/problem?

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.55.g87c42.dirty)

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

* Re: [BUG] Latex export problem with babel latex blocks when including files
  2011-03-16 13:22 ` Eric Schulte
@ 2011-03-16 18:32   ` Suvayu Ali
  0 siblings, 0 replies; 5+ messages in thread
From: Suvayu Ali @ 2011-03-16 18:32 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org mode mailing list

Hi Eric,

On Wed, 16 Mar 2011 07:22:19 -0600
"Eric Schulte" <schulte.eric@gmail.com> wrote:

> Hi,
> 
> First, you may well already be aware of this, but a block like the
> following
> 
> #+begin_src latex
>   \begin{equation}
>     \label{eq:eta}
>     \eta = -\ln\Bigg[\tan\Bigg(\frac{\theta}{2}\Bigg)\Bigg]
>   \end{equation}
> #+end_src
> 
> could just as easily be written as
> 
> \begin{equation}
>   \label{eq:eta}
>   \eta = -\ln\Bigg[\tan\Bigg(\frac{\theta}{2}\Bigg)\Bigg]
> \end{equation}
> 
> Org-mode will recognize the inline latex, and will export it to both
> html and tex as desired.
> 

Yes I realise that. Its just nicer with all the fontification in an org
buffer. I can also use org-edit-special and take advantage of the auctex
macros when writing the equations.

> Second, I've run into similar headline issues when trying to place a
> bibliography under it's own headline at the end of an Org-mode file.
> I believe that the answer here is to simply remove the headline from
> your appendix file.  I don't believe that there exists any syntax by
> which to tell Org-mode to not export a headline.
> 

I am not following here. I don't want to suppress export of any of the
headlines. I have several appendices under their own headlines in the
included file. The only issue is org tries to insert the appendix
headlines at the end of the master latex file while exporting.

Removing the source block from the appendix definitely solves
everything, so its barely an issue. But it would nice to be able to use
babel blocks for the fontification and the org-edit-special
capability. :)

> Best -- Eric

Thanks a lot.

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: [BUG] Latex export problem with babel latex blocks when including files
  2011-03-16 14:18 ` Eric S Fraga
@ 2011-03-16 18:42   ` Suvayu Ali
  0 siblings, 0 replies; 5+ messages in thread
From: Suvayu Ali @ 2011-03-16 18:42 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: Org mode mailing list

Hi Eric,

Sorry I was a bit sleepy when I made my original post earlier, I wasn't
clear enough with my description of the problem. :-p

On Wed, 16 Mar 2011 14:18:47 +0000
Eric S Fraga <e.fraga@ucl.ac.uk> wrote:

> which is what I would expect.  What do you get that is different?  Or
> did I misunderstand your question/problem?

The exported latex code is as expected. But the presence of the babel
block in the included file (appendix) makes org prompt like this:

No match - create this as a new heading? (y or n) 

Responding no, repeats this 2 more times and responding yes puts an
extra headline (the headline with the babel source block in the appendix
file) in the master org file.

Its a very minor issue, as Eric Schulte said, I can just use bare latex
without the babel blocks. I hope I have clearly explained myself this
time. :)

Thanks,

-- 
Suvayu

Open source is the future. It sets us free.

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

end of thread, other threads:[~2011-03-16 18:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-16 12:30 [BUG] Latex export problem with babel latex blocks when including files Suvayu Ali
2011-03-16 13:22 ` Eric Schulte
2011-03-16 18:32   ` Suvayu Ali
2011-03-16 14:18 ` Eric S Fraga
2011-03-16 18:42   ` Suvayu Ali

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