Re: [Orgmode] Re: Error when exporting to LaTeX

2010-03-20 Thread Carsten Dominik


On Jan 18, 2010, at 1:43 PM, Sébastien Vauban wrote:


Hi Carsten,

Carsten Dominik wrote:

On Jan 14, 2010, at 12:15 PM, Sébastien Vauban wrote:

Sébastien Vauban wrote:


Here a problem when exporting such a file:

--8<---cut here---start->8---
#+MACRO: rest {\leavevmode \leaders \hrule height 0.7pt\hfill} \\

Nombre y apellidos del estudiante: {{{rest}}}
--8<---cut here---end--->8---

The `rest' macro is for filling the rest of the current line with  
an

horizontal rule.

It needs to be enclosed between accolades.


The macro just does text replacement, so the LaTeX exporter
sees naked braces which it escapes as it should.  In fact there seems
to be a bug causing the opening "{" not to be escaped - I have just
fixed that, I hope.


The above, and the "accolade workaround" (in front of the LaTeX  
environment),

work fine in some cases.

Though, here is a relatively simple Org file that exposes some of  
the problems

I'm still confronted with:

--8<---cut here---start->8---
#+TITLE: Spanish manual
#+AUTHOR:Me
#+EMAIL: n...@one.com
#+DATE:  2010-01-18
#+OPTIONS:   H:4 num:t toc:nil
#+LaTeX_CLASS: article

#+LaTeX_HEADER: \usepackage{xcolor}
#+LaTeX_HEADER: \usepackage{fancybox}
#+LaTeX_HEADER: \usepackage{tikz}
#+LaTeX_HEADER: \usetikzlibrary{shapes,calc}
#+LaTeX_HEADER: \newenvironment{etiket} {\fboxsep 10pt \begin{Sbox} 
\begin{minipage}{\linewidth}} {\end{minipage}\end{Sbox} 
\shadowbox{\TheSbox}}
#+LaTeX_HEADER: \newcommand{\rfill}{{\leavevmode \color{blue! 
80}\leaders \hrule height 0.7pt\hfill} \\}
#+LaTeX_HEADER: \newcommand{\rsh}{{\color{blue!80}\rule{0.7cm} 
{0.7pt}}}
#+LaTeX_HEADER: \newcommand{\titlebox}[3]{\begin{tikzpicture}[every  
text node part/.style={text centered}] \node[rectangle split,  
rectangle split parts=2, rectangle split part fill={blue!50,white},  
line width=0.5mm, draw=blue, text width=#1, rounded corners](rs) {#2  
\nodepart{second} #3}; \end{tikzpicture}}



* Table in LaTeX environment

#+BEGIN_etiket
Nombre y apellidos del estudiante: \rfill
Día(s) de la semana que tiene clase y de qué hora a qué hora:
| lunes  | martes | miércoles  |  
jueves |
| de \rsh{} a \rsh{} | de \rsh{} a \rsh{} | de \rsh{} a \rsh{} | de  
\rsh{} a \rsh{} |

#+END_etiket

 Here, you just see a nice result of mixing a table and a LaTeX
 environment... Excellent!!!


* List items

 DECIR
   - presentarse
   - saludar
   - despedirse

 Here, though, I can't get such *list items* framed, what ever  
workaround I'm

 trying to use.

\titlebox{8cm}{DECIR}{
 - presentarse
 - saludar
 - despedirse
}

#+LaTeX: \titlebox{8cm}{LEER}{
 - las instrucciones en clase
 - algunos letreros públicos
#+LaTeX: }

#+LaTeX: {}\titlebox{8cm}{ESCRIBIR}{
 - el nombre y apellido
 - cuándo uno tiene clase (días de la semana)
 - quién es el profesor
#+LaTeX: }

#+LaTeX: {}\titlebox{8cm}{OBJETIVOS GRAMATICALES}{
 | - singular de SER y de LLAMARSE |
 | - ¿Cómo?|
 | - ¿Quién?   |
#+LaTeX: }


* Other table

 Here, I'm trying to use the "accolades" workaround for allowing Org  
to

 interpret what will be inside LaTeX environments.

#+LaTeX: {}\titlebox{8cm}{El presente (singular): Llamarse y ser.}{
 #+ATTR_LaTeX: align=p{4cm}p{4cm}
 | *LLAMARSE*  | *SER*|
 | *Me llam\rsh{}* Isabel. | *\rsh{}* Isabel. |
 | ¿Cómo *te llam\rsh{}?*  | ¿Quién *eres*?   |
 | *Se llam\rsh{}* Ana.| *\rsh{}* Ana.|
#+LaTeX: }

 Though, it fails converting the above table to a LaTeX table.

 *Removing the ATTR LaTeX line* allows a conversion to a compilable  
LaTeX

 document, but, still, the table is not converted.


For this last thing the following pretty bad work-around should work:

#+ATTR_LaTeX: align=p{4cm}p{4cm}
#+LaTeX: {}\titlebox{8cm}{El presente (singular): Llamarse y ser.}{ %}
 | *LLAMARSE*  | *SER*|
 | *Me llam\rsh{}* Isabel. | *\rsh{}* Isabel. |
 | ¿Cómo *te llam\rsh{}?*  | ¿Quién *eres*?   |
 | *Se llam\rsh{}* Ana.| *\rsh{}* Ana.|
#+LaTeX: }


A better way would probably be to create an environment that makes the  
title box,
so that the table is not an argument of a LaTeX macro (which Org-mode  
always protects).


#+ATTR_LaTeX: align=p{4cm}p{4cm}
#+LaTeX: {}\begin{mytitlebox}{8cm}{El presente (singular): Llamarse y  
ser.}

 | *LLAMARSE*  | *SER*|
 | *Me llam\rsh{}* Isabel. | *\rsh{}* Isabel. |
 | ¿Cómo *te llam\rsh{}?*  | ¿Quién *eres*?   |
 | *Se llam\rsh{}* Ana.| *\rsh{}* Ana.|
#+LaTeX: \end{mytitlebox}


I do not know how to define such an environment, but I am sure
that this is easy to do.  The same should work with lists.

HTH

- Carsten

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/ema

[Orgmode] Re: Error when exporting to LaTeX

2010-01-20 Thread Sébastien Vauban
Hi Carsten en all,

Sébastien Vauban wrote:
> The "accolade workaround" (in front of the LaTeX environment), work fine in
> some cases.
>
> Though, here is a relatively simple Org file that exposes some of the problems
> I'm still confronted with:
>
> #+TITLE: Spanish manual
> #+AUTHOR:Me
> #+EMAIL: n...@one.com
> #+DATE:  2010-01-18
> #+OPTIONS:   H:4 num:t toc:nil
> #+LaTeX_CLASS: article
>
> #+LaTeX_HEADER: \usepackage{xcolor}
> #+LaTeX_HEADER: \usepackage{fancybox}
> #+LaTeX_HEADER: \usepackage{tikz}
> #+LaTeX_HEADER: \usetikzlibrary{shapes,calc}
> #+LaTeX_HEADER: \newenvironment{etiket} {\fboxsep 10pt 
> \begin{Sbox}\begin{minipage}{\linewidth}} 
> {\end{minipage}\end{Sbox}\shadowbox{\TheSbox}}
> #+LaTeX_HEADER: \newcommand{\rfill}{{\leavevmode \color{blue!80}\leaders 
> \hrule height 0.7pt\hfill} \\}
> #+LaTeX_HEADER: \newcommand{\rsh}{{\color{blue!80}\rule{0.7cm}{0.7pt}}}
> #+LaTeX_HEADER: \newcommand{\titlebox}[3]{\begin{tikzpicture}[every text node 
> part/.style={text centered}] \node[rectangle split, rectangle split parts=2, 
> rectangle split part fill={blue!50,white}, line width=0.5mm, draw=blue, text 
> width=#1, rounded corners](rs) {#2 \nodepart{second} #3}; \end{tikzpicture}}
>
>
> * Table in LaTeX environment
>
> #+BEGIN_etiket
> Nombre y apellidos del estudiante: \rfill
> Día(s) de la semana que tiene clase y de qué hora a qué hora:
> | lunes  | martes | miércoles  | jueves   
>   |
> | de \rsh{} a \rsh{} | de \rsh{} a \rsh{} | de \rsh{} a \rsh{} | de \rsh{} a 
> \rsh{} |
> #+END_etiket
>
>   Here, you just see a nice result of mixing a table and a LaTeX
>   environment... Excellent!!!
>
>
> * List items
>
>   DECIR
> - presentarse
> - saludar
> - despedirse
>
>   Here, though, I can't get such *list items* framed, what ever workaround I'm
>   trying to use.
>
> \titlebox{8cm}{DECIR}{
>   - presentarse
>   - saludar
>   - despedirse
> }
>
> #+LaTeX: \titlebox{8cm}{LEER}{
>   - las instrucciones en clase
>   - algunos letreros públicos
> #+LaTeX: }
>
> #+LaTeX: {}\titlebox{8cm}{ESCRIBIR}{
>   - el nombre y apellido
>   - cuándo uno tiene clase (días de la semana)
>   - quién es el profesor
> #+LaTeX: }
>
> #+LaTeX: {}\titlebox{8cm}{OBJETIVOS GRAMATICALES}{
>   | - singular de SER y de LLAMARSE |
>   | - ¿Cómo?|
>   | - ¿Quién?   |
> #+LaTeX: }
>
>
> * Other table
>
>   Here, I'm trying to use the "accolades" workaround for allowing Org to
>   interpret what will be inside LaTeX environments.
>
> #+LaTeX: {}\titlebox{8cm}{El presente (singular): Llamarse y ser.}{
>   #+ATTR_LaTeX: align=p{4cm}p{4cm}
>   | *LLAMARSE*  | *SER*|
>   | *Me llam\rsh{}* Isabel. | *\rsh{}* Isabel. |
>   | ¿Cómo *te llam\rsh{}?*  | ¿Quién *eres*?   |
>   | *Se llam\rsh{}* Ana.| *\rsh{}* Ana.|
> #+LaTeX: }
>
>   Though, it fails converting the above table to a LaTeX table.
>
>   *Removing the ATTR LaTeX line* allows a conversion to a compilable LaTeX
>   document, but, still, the table is not converted.
>
> Any idea of how to get these working?

I am still trying to get around this, but I currently find no escape to this.

One of the problem is, maybe, that we can't pass extra information to the
environments through Chris Gray's (excellent) org-special-blocks?

Any hint or direction to search?

Best regards,
  Seb

-- 
Sébastien Vauban



___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Error when exporting to LaTeX

2010-01-18 Thread Sébastien Vauban
Hi Carsten,

Carsten Dominik wrote:
> On Jan 14, 2010, at 12:15 PM, Sébastien Vauban wrote:
>> Sébastien Vauban wrote:
>>>
>>> Here a problem when exporting such a file:
>>>
>>> --8<---cut here---start->8---
>>> #+MACRO: rest {\leavevmode \leaders \hrule height 0.7pt\hfill} \\
>>>
>>> Nombre y apellidos del estudiante: {{{rest}}}
>>> --8<---cut here---end--->8---
>>>
>>> The `rest' macro is for filling the rest of the current line with an
>>> horizontal rule.
>>>
>>> It needs to be enclosed between accolades.
>
> The macro just does text replacement, so the LaTeX exporter
> sees naked braces which it escapes as it should.  In fact there seems
> to be a bug causing the opening "{" not to be escaped - I have just
> fixed that, I hope.

The above, and the "accolade workaround" (in front of the LaTeX environment),
work fine in some cases.

Though, here is a relatively simple Org file that exposes some of the problems
I'm still confronted with:

--8<---cut here---start->8---
#+TITLE: Spanish manual
#+AUTHOR:Me
#+EMAIL: n...@one.com
#+DATE:  2010-01-18
#+OPTIONS:   H:4 num:t toc:nil
#+LaTeX_CLASS: article

#+LaTeX_HEADER: \usepackage{xcolor}
#+LaTeX_HEADER: \usepackage{fancybox}
#+LaTeX_HEADER: \usepackage{tikz}
#+LaTeX_HEADER: \usetikzlibrary{shapes,calc}
#+LaTeX_HEADER: \newenvironment{etiket} {\fboxsep 10pt 
\begin{Sbox}\begin{minipage}{\linewidth}} 
{\end{minipage}\end{Sbox}\shadowbox{\TheSbox}}
#+LaTeX_HEADER: \newcommand{\rfill}{{\leavevmode \color{blue!80}\leaders \hrule 
height 0.7pt\hfill} \\}
#+LaTeX_HEADER: \newcommand{\rsh}{{\color{blue!80}\rule{0.7cm}{0.7pt}}}
#+LaTeX_HEADER: \newcommand{\titlebox}[3]{\begin{tikzpicture}[every text node 
part/.style={text centered}] \node[rectangle split, rectangle split parts=2, 
rectangle split part fill={blue!50,white}, line width=0.5mm, draw=blue, text 
width=#1, rounded corners](rs) {#2 \nodepart{second} #3}; \end{tikzpicture}}


* Table in LaTeX environment

#+BEGIN_etiket
Nombre y apellidos del estudiante: \rfill
Día(s) de la semana que tiene clase y de qué hora a qué hora:
| lunes  | martes | miércoles  | jueves 
|
| de \rsh{} a \rsh{} | de \rsh{} a \rsh{} | de \rsh{} a \rsh{} | de \rsh{} a 
\rsh{} |
#+END_etiket

  Here, you just see a nice result of mixing a table and a LaTeX
  environment... Excellent!!!


* List items

  DECIR
- presentarse
- saludar
- despedirse

  Here, though, I can't get such *list items* framed, what ever workaround I'm
  trying to use.

\titlebox{8cm}{DECIR}{
  - presentarse
  - saludar
  - despedirse
}

#+LaTeX: \titlebox{8cm}{LEER}{
  - las instrucciones en clase
  - algunos letreros públicos
#+LaTeX: }

#+LaTeX: {}\titlebox{8cm}{ESCRIBIR}{
  - el nombre y apellido
  - cuándo uno tiene clase (días de la semana)
  - quién es el profesor
#+LaTeX: }

#+LaTeX: {}\titlebox{8cm}{OBJETIVOS GRAMATICALES}{
  | - singular de SER y de LLAMARSE |
  | - ¿Cómo?|
  | - ¿Quién?   |
#+LaTeX: }


* Other table

  Here, I'm trying to use the "accolades" workaround for allowing Org to
  interpret what will be inside LaTeX environments.

#+LaTeX: {}\titlebox{8cm}{El presente (singular): Llamarse y ser.}{
  #+ATTR_LaTeX: align=p{4cm}p{4cm}
  | *LLAMARSE*  | *SER*|
  | *Me llam\rsh{}* Isabel. | *\rsh{}* Isabel. |
  | ¿Cómo *te llam\rsh{}?*  | ¿Quién *eres*?   |
  | *Se llam\rsh{}* Ana.| *\rsh{}* Ana.|
#+LaTeX: }

  Though, it fails converting the above table to a LaTeX table.

  *Removing the ATTR LaTeX line* allows a conversion to a compilable LaTeX
  document, but, still, the table is not converted.
--8<---cut here---end--->8---

Any idea of how to get these working?

Best regards,
  Seb

-- 
Sébastien Vauban



___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: Error when exporting to LaTeX

2010-01-14 Thread Carsten Dominik

Hi Sebastian,

On Jan 14, 2010, at 12:15 PM, Sébastien Vauban wrote:


Hi all,

Sébastien Vauban wrote:


Here a problem when exporting such a file:


--8<---cut here---start->8---
#+MACRO: rest {\leavevmode \leaders \hrule height 0.7pt\hfill} \\

Nombre de la escuela de idiomas: {{{rest}}}
Nombre y apellidos del estudiante: {{{rest}}}
--8<---cut here---end--->8---


The `rest' macro is for filling the rest of the current line with an
horizontal rule.

It needs to be enclosed between accolades.


The macro just does text replacement, so the LaTeX exporter
sees naked braces which it escapes as it should.  In fact there seems
to be a bug causing the opening "{" not to be escaped - I have just
fixed that, I hope.

Org-mode buffers are not LaTeX buffers, so braces are seen as just
characters that should appear in print, unless they surround the
arguments of a LaTeX macro.

So you probably could write

  #+LaTeX_HEADER: \def\same#1{#1}
  #+MACRO: rest \same{{\leavevmode \leaders \hrule height 0.7pt 
\hfill} \\}


  Nombre de la escuela de idiomas: {{{rest}}}
  Nombre y apellidos del estudiante: {{{rest}}}


However, I think it is must better and more stable to write:

  #+LaTeX_HEADER: \newcommand{\rest}{{\leavevmode \leaders \hrule  
height 0.7pt\hfill} \\}


  Nombre de la escuela de idiomas: \rest
  Nombre y apellidos del estudiante: \rest

Don't forget that LaTeX is the most powerful macro processor here,
so just use its capabilities.

HTH

- Carsten



___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Error when exporting to LaTeX

2010-01-14 Thread Sébastien Vauban
Hi all,

Sébastien Vauban wrote:
>
> Here a problem when exporting such a file:
>
--8<---cut here---start->8---
#+MACRO: rest {\leavevmode \leaders \hrule height 0.7pt\hfill} \\

Nombre de la escuela de idiomas: {{{rest}}}
Nombre y apellidos del estudiante: {{{rest}}}
--8<---cut here---end--->8---
>
> The `rest' macro is for filling the rest of the current line with an
> horizontal rule.
>
> It needs to be enclosed between accolades.
>
> Though, it wrongly gets translated into:
>
--8<---cut here---start->8---
Nombre de la escuela de idiomas: {\leavevmode \leaders \hrule height 
0.7pt\hfill\} \\
Nombre y apellidos del estudiante: {\leavevmode \leaders \hrule height 
0.7pt\hfill\} \\
--8<---cut here---end--->8---
>
> Notice the backslash in front of the final accolade.

I tried a workaround, using replacement constructions for the accolades:
- \bgroup ... \egroup
- \begingroup ... \endgroup

Though they are correctly translated, they don't provide the required result:
the horizontal filling rules just don't show up!

Any idea how to circumvent this?

Best regards,
  Seb

-- 
Sébastien Vauban



___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode