emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [beamer] Code blocks in lists?
@ 2012-02-06 12:58 Sebastien Vauban
  2012-02-06 13:11 ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastien Vauban @ 2012-02-06 12:58 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello,

I've identified a couple of troubles related to code blocks inside lists (in
Beamer):

- code blocks break the list

- "relative" indentation of the code inside its frame is wrong except when
  code begins at column 0: is this a requirement?

- sometimes, "ORG-LIST-END-MARKER" is exported in PDF and in HTML.

Here is an ECM to show all of the above.

For the impatient, see 2 screenshots at http://i.imgur.com/2iiWq.png.

Best regards,
Seb


--8<---------------cut here---------------start------------->8---
#+TITLE:     Code blocks in lists
#+DATE:      2012-02-06
#+LANGUAGE:  en
#+OPTIONS:   H:3 num:t toc:nil

#+startup: beamer
#+LaTeX_CLASS: beamer
#+LaTeX_CLASS_OPTIONS: [presentation,t]
#+BEAMER_HEADER_EXTRA: \usetheme{Madrid}\usecolortheme{default}
#+BEAMER_FRAME_LEVEL: 1
#+COLUMNS: %40ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)

#+begin_latex
\definecolor{keywords}{HTML}{0000FF}
\definecolor{back}{HTML}{EFEFEF}
\definecolor{frame}{HTML}{DDDDDD}
\lstset{
  basicstyle=\ttfamily\scriptsize,
  keywordstyle=\color{keywords},
  backgroundcolor=\color{back},
  frame=single,
  rulecolor=\color{frame}
}
#+end_latex

* Code in lists \\ Correct Org syntax

- This is an item

  This is some text to show how it's aligned...

  This is some extra text...

- This code block is properly indented in Org

  #+begin_src java
  if (test)
  {
      doit
  }
  #+end_src

  but *no correct relative indentation* in both PDF and HTML: see the code
  within its frame. There is a /left margin/ appended, not intended. Do I have
  to begin *all code blocks in column 0*?

- @Without this line@, there is a @bug@: output of =ORG-LIST-END-MARKER=.

* Code in lists \\ Workarounds?

- Weird indentation in Org

  #+begin_src java
if (test)
{
    doit
}
  #+end_src

  But *correct relative indentation* of the code (in PDF and HTML) in its frame.

- Wrong indentation in Org

#+begin_src java
if (test) {doit}
#+end_src

  Same (good) results regarding the relative indentation...

- In all cases, @putting code blocks seems to put an end to the list@

--8<---------------cut here---------------end--------------->8---

-- 
Sebastien Vauban

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

* Re: [beamer] Code blocks in lists?
  2012-02-06 12:58 [beamer] Code blocks in lists? Sebastien Vauban
@ 2012-02-06 13:11 ` Nicolas Goaziou
  2012-02-06 16:07   ` Sebastien Vauban
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2012-02-06 13:11 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



Hello,

"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:

> I've identified a couple of troubles related to code blocks inside lists (in
> Beamer):
>
> - code blocks break the list
>
> - "relative" indentation of the code inside its frame is wrong except when
>   code begins at column 0: is this a requirement?
>
> - sometimes, "ORG-LIST-END-MARKER" is exported in PDF and in HTML.

Could you try with a more recent Org? I think I have fixed this
recently.


Regards,

-- 
Nicolas Goaziou

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

* Re: [beamer] Code blocks in lists?
  2012-02-06 13:11 ` Nicolas Goaziou
@ 2012-02-06 16:07   ` Sebastien Vauban
  2012-02-06 16:37     ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastien Vauban @ 2012-02-06 16:07 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Nicolas,

Nicolas Goaziou wrote:
> "Sebastien Vauban" writes:
>
>> I've identified a couple of troubles related to code blocks inside lists (in
>> Beamer):
>>
>> - code blocks break the list
>>
>> - "relative" indentation of the code inside its frame is wrong except when
>>   code begins at column 0: is this a requirement?
>>
>> - sometimes, "ORG-LIST-END-MARKER" is exported in PDF and in HTML.
>
> Could you try with a more recent Org? I think I have fixed this
> recently.

I confirm that those 3 bugs (?) are there in the "release of this hour":

Org-mode version 7.8.03 (release_7.8.03.356.gfe2e)
GNU Emacs 24.0.92.1 (i386-mingw-nt5.1.2600) of 2011-12-07 on MARVIN

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: [beamer] Code blocks in lists?
  2012-02-06 16:07   ` Sebastien Vauban
@ 2012-02-06 16:37     ` Nicolas Goaziou
  2012-02-07 22:39       ` Sebastien Vauban
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2012-02-06 16:37 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:

> Nicolas Goaziou wrote:
>> "Sebastien Vauban" writes:
>>
>>> I've identified a couple of troubles related to code blocks inside lists (in
>>> Beamer):
>>>
>>> - code blocks break the list
>>>
>>> - "relative" indentation of the code inside its frame is wrong except when
>>>   code begins at column 0: is this a requirement?
>>>
>>> - sometimes, "ORG-LIST-END-MARKER" is exported in PDF and in HTML.
>>
>> Could you try with a more recent Org? I think I have fixed this
>> recently.
>
> I confirm that those 3 bugs (?) are there in the "release of this
> hour":

I can't reproduce any list break, except the last one, which is on
purpose (block at column 0).

> Org-mode version 7.8.03 (release_7.8.03.356.gfe2e)

Strange. This version doesn't exist yet. As the time of writing, we're
at release: Org-mode version 7.8.03 (release_7.8.03.321.gaac1c).


Regards,

-- 
Nicolas Goaziou

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

* Re: [beamer] Code blocks in lists?
  2012-02-06 16:37     ` Nicolas Goaziou
@ 2012-02-07 22:39       ` Sebastien Vauban
  2012-02-07 23:21         ` Nick Dokos
  2012-02-09 16:34         ` Nicolas Goaziou
  0 siblings, 2 replies; 7+ messages in thread
From: Sebastien Vauban @ 2012-02-07 22:39 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Nicolas,

Nicolas Goaziou wrote:
> "Sebastien Vauban"
> <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>
>> Nicolas Goaziou wrote:
>>> "Sebastien Vauban" writes:
>>>
>>>> I've identified a couple of troubles related to code blocks inside lists (in
>>>> Beamer):
>>>>
>>>> - code blocks break the list
>>>>
>>>> - "relative" indentation of the code inside its frame is wrong except when
>>>>   code begins at column 0: is this a requirement?
>>>>
>>>> - sometimes, "ORG-LIST-END-MARKER" is exported in PDF and in HTML.
>>>
>>> Could you try with a more recent Org? I think I have fixed this
>>> recently.
>>
>> I confirm that those 3 bugs (?) are there in the "release of this
>> hour":
>
> I can't reproduce any list break ...

Does that mean that you consider the following as normal?

#+begin_src latex
\begin{frame}[fragile]
\frametitle{Code in lists}
\framesubtitle{Correct Org syntax}
\label{sec-1}


\begin{itemize}
\item This is an item

  This is some text to show how it's aligned\ldots{}

  This is some extra text\ldots{}
\item This code block is properly indented in Org
\end{itemize}


\lstset{language=java}
\begin{lstlisting}
  if (test)
  {
      doit
  }
\end{lstlisting}

  but \textbf{no correct relative indentation} in both PDF and HTML: see the code
  within its frame. There is a \emph{left margin} appended, not intended. Do I have
  to begin \textbf{all code blocks in column 0}?
ORG-LIST-END-MARKER
\end{frame}
#+end_src

You see that there are 2 items in the list, which is ended, then there is the
code, then some "volatile" paragraph.

In the PDF, the paragraph "but ..." is not indented properly, as it would have
been if the code wasn't there, in the middle.

> ... except the last one, which is on purpose (block at column 0).

IIUC, every code block, inside lists or not, must be located at column 0?

>> Org-mode version 7.8.03 (release_7.8.03.356.gfe2e)
>
> Strange. This version doesn't exist yet. As the time of writing, we're
> at release: Org-mode version 7.8.03 (release_7.8.03.321.gaac1c).

I have no idea why it's the case: I don't have any pending modification or
whatsoever, and simply git pull every day or so. Though, my Git experience is
still limited...

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: [beamer] Code blocks in lists?
  2012-02-07 22:39       ` Sebastien Vauban
@ 2012-02-07 23:21         ` Nick Dokos
  2012-02-09 16:34         ` Nicolas Goaziou
  1 sibling, 0 replies; 7+ messages in thread
From: Nick Dokos @ 2012-02-07 23:21 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: nicholas.dokos, emacs-orgmode

Sebastien Vauban <wxhgmqzgwmuf@spammotel.com> wrote:


> >> Org-mode version 7.8.03 (release_7.8.03.356.gfe2e)
> >
> > Strange. This version doesn't exist yet. As the time of writing, we're
> > at release: Org-mode version 7.8.03 (release_7.8.03.321.gaac1c).
> 
> I have no idea why it's the case: I don't have any pending modification or
> whatsoever, and simply git pull every day or so. Though, my Git experience is
> still limited...
> 

Maybe there are spurious merge commits because of some unintentional
change you made?  In any case, try doing a ``git log -N'' and 
``git log -N origin/master'' for various values of N and see where
yours differs from origin/master.

If you really have nothing in your tree that is worth saving, then
the simplest way to get back in sync is to delete the whole org-mode
directory and clone it again - but you'd better double check!

Nick

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

* Re: [beamer] Code blocks in lists?
  2012-02-07 22:39       ` Sebastien Vauban
  2012-02-07 23:21         ` Nick Dokos
@ 2012-02-09 16:34         ` Nicolas Goaziou
  1 sibling, 0 replies; 7+ messages in thread
From: Nicolas Goaziou @ 2012-02-09 16:34 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



Hello,

"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:

> Nicolas Goaziou wrote:

>> I can't reproduce any list break ...
>
> Does that mean that you consider the following as normal?

No, it just means that I cannot reproduce it, notwithstanding how
abnormal your LaTeX output is.

> IIUC, every code block, inside lists or not, must be located at column
> 0?

No, but last code block boundaries in your example are at column 0, so
list above ends there. Lists don't care about code's indentation. What
really matters is indentation of the "#+begin_src" line.


Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2012-02-09 16:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-06 12:58 [beamer] Code blocks in lists? Sebastien Vauban
2012-02-06 13:11 ` Nicolas Goaziou
2012-02-06 16:07   ` Sebastien Vauban
2012-02-06 16:37     ` Nicolas Goaziou
2012-02-07 22:39       ` Sebastien Vauban
2012-02-07 23:21         ` Nick Dokos
2012-02-09 16:34         ` Nicolas Goaziou

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