From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: Error when exporting to LaTeX Date: Sat, 20 Mar 2010 15:59:22 +0100 Message-ID: References: <876375d3aj.fsf@mundaneum.com> <87zl4hj5ty.fsf@mundaneum.com> <50EF1D2C-DF86-4644-A49E-148AA67DCAEB@gmail.com> <87eilnfurt.fsf@mundaneum.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: multipart/mixed; boundary="===============1011499800==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nt09J-0007Sk-Gh for emacs-orgmode@gnu.org; Sat, 20 Mar 2010 10:59:37 -0400 Received: from [140.186.70.92] (port=38904 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nt09H-0007SV-UA for emacs-orgmode@gnu.org; Sat, 20 Mar 2010 10:59:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nt09E-0004D2-JY for emacs-orgmode@gnu.org; Sat, 20 Mar 2010 10:59:35 -0400 Received: from pony.ic.uva.nl ([145.18.40.181]:36127) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nt09E-0004Cg-2i for emacs-orgmode@gnu.org; Sat, 20 Mar 2010 10:59:32 -0400 In-Reply-To: <87eilnfurt.fsf@mundaneum.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?ISO-8859-1?Q?S=E9bastien_Vauban?= Cc: emacs-orgmode@gnu.org --===============1011499800== Content-Type: multipart/alternative; boundary=Apple-Mail-1-879670381 --Apple-Mail-1-879670381 Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable On Jan 18, 2010, at 1:43 PM, S=E9bastien Vauban wrote: > Hi Carsten, > > Carsten Dominik wrote: >> On Jan 14, 2010, at 12:15 PM, S=E9bastien Vauban wrote: >>> S=E9bastien 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 =20= >>>> 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 =20 > environment), > work fine in some cases. > > Though, here is a relatively simple Org file that exposes some of =20 > the problems > I'm still confronted with: > > --8<---------------cut here---------------start------------->8--- > #+TITLE: Spanish manual > #+AUTHOR: Me > #+EMAIL: no@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}=20 > \begin{minipage}{\linewidth}} {\end{minipage}\end{Sbox}=20 > \shadowbox{\TheSbox}} > #+LaTeX_HEADER: \newcommand{\rfill}{{\leavevmode \color{blue!=20 > 80}\leaders \hrule height 0.7pt\hfill} \\} > #+LaTeX_HEADER: \newcommand{\rsh}{{\color{blue!80}\rule{0.7cm}=20 > {0.7pt}}} > #+LaTeX_HEADER: \newcommand{\titlebox}[3]{\begin{tikzpicture}[every =20= > text node part/.style=3D{text centered}] \node[rectangle split, =20 > rectangle split parts=3D2, rectangle split part fill=3D{blue!50,white}, = =20 > line width=3D0.5mm, draw=3Dblue, text width=3D#1, rounded corners](rs) = {#2 =20 > \nodepart{second} #3}; \end{tikzpicture}} > > > * Table in LaTeX environment > > #+BEGIN_etiket > Nombre y apellidos del estudiante: \rfill > D=EDa(s) de la semana que tiene clase y de qu=E9 hora a qu=E9 hora: > | lunes | martes | mi=E9rcoles | =20 > jueves | > | de \rsh{} a \rsh{} | de \rsh{} a \rsh{} | de \rsh{} a \rsh{} | de =20= > \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 =20 > workaround I'm > trying to use. > > \titlebox{8cm}{DECIR}{ > - presentarse > - saludar > - despedirse > } > > #+LaTeX: \titlebox{8cm}{LEER}{ > - las instrucciones en clase > - algunos letreros p=FAblicos > #+LaTeX: } > > #+LaTeX: {}\titlebox{8cm}{ESCRIBIR}{ > - el nombre y apellido > - cu=E1ndo uno tiene clase (d=EDas de la semana) > - qui=E9n es el profesor > #+LaTeX: } > > #+LaTeX: {}\titlebox{8cm}{OBJETIVOS GRAMATICALES}{ > | - singular de SER y de LLAMARSE | > | - =BFC=F3mo? | > | - =BFQui=E9n? | > #+LaTeX: } > > > * Other table > > Here, I'm trying to use the "accolades" workaround for allowing Org =20= > to > interpret what will be inside LaTeX environments. > > #+LaTeX: {}\titlebox{8cm}{El presente (singular): Llamarse y ser.}{ > #+ATTR_LaTeX: align=3Dp{4cm}p{4cm} > | *LLAMARSE* | *SER* | > | *Me llam\rsh{}* Isabel. | *\rsh{}* Isabel. | > | =BFC=F3mo *te llam\rsh{}?* | =BFQui=E9n *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 =20= > LaTeX > document, but, still, the table is not converted. For this last thing the following pretty bad work-around should work: #+ATTR_LaTeX: align=3Dp{4cm}p{4cm} #+LaTeX: {}\titlebox{8cm}{El presente (singular): Llamarse y ser.}{ %} | *LLAMARSE* | *SER* | | *Me llam\rsh{}* Isabel. | *\rsh{}* Isabel. | | =BFC=F3mo *te llam\rsh{}?* | =BFQui=E9n *eres*? | | *Se llam\rsh{}* Ana. | *\rsh{}* Ana. | #+LaTeX: } A better way would probably be to create an environment that makes the =20= title box, so that the table is not an argument of a LaTeX macro (which Org-mode =20= always protects). #+ATTR_LaTeX: align=3Dp{4cm}p{4cm} #+LaTeX: {}\begin{mytitlebox}{8cm}{El presente (singular): Llamarse y =20= ser.} | *LLAMARSE* | *SER* | | *Me llam\rsh{}* Isabel. | *\rsh{}* Isabel. | | =BFC=F3mo *te llam\rsh{}?* | =BFQui=E9n *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 --Apple-Mail-1-879670381 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Jan 18, 2010, = at 1:43 PM, S=E9bastien Vauban wrote:

Hi = Carsten,

Carsten Dominik wrote:
On = Jan 14, 2010, at 12:15 PM, S=E9bastien Vauban = wrote:
S=E9bastien 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:     no@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=3D{text centered}] \node[rectangle split, rectangle split = parts=3D2, rectangle split part fill=3D{blue!50,white}, line = width=3D0.5mm, draw=3Dblue, text width=3D#1, rounded corners](rs) {#2 = \nodepart{second} #3}; \end{tikzpicture}}


* Table in LaTeX = environment

#+BEGIN_etiket
Nombre y apellidos del estudiante: = \rfill
D=EDa(s) de la semana que tiene clase y de qu=E9 hora a qu=E9 = hora:
| lunes =             &n= bsp;| martes =             | = mi=E9rcoles          | = jueves =             |<= br>| 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=FAblicos
#+LaTeX: }

#+LaTeX: = {}\titlebox{8cm}{ESCRIBIR}{
 - el nombre y apellido
 - = cu=E1ndo uno tiene clase (d=EDas de la semana)
 - qui=E9n es el = profesor
#+LaTeX: }

#+LaTeX: {}\titlebox{8cm}{OBJETIVOS = GRAMATICALES}{
 | - singular de SER y de LLAMARSE |
 | = - =BFC=F3mo? =             &n= bsp;          |
=  | - =BFQui=E9n? =             &n= bsp;         |
#+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=3Dp{4cm}p{4cm}
 | *LLAMARSE* =             &n= bsp;| *SER* =            |
=  | *Me llam\rsh{}* Isabel. | *\rsh{}* Isabel. |
 | =BFC=F3mo= *te llam\rsh{}?*  | =BFQui=E9n *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=3Dp{4cm}p{4cm}
#+LaTeX: {}\titlebox{8cm}{El = presente (singular): Llamarse y ser.}{ %}
 | = *LLAMARSE*              | *SER* =            |
 | *Me = llam\rsh{}* Isabel. | *\rsh{}* Isabel. |
 | =BFC=F3m= o *te llam\rsh{}?*  | =BFQui=E9n *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=3Dp{4cm}p{4cm}
#+LaTeX: = {}\begin{mytitlebox}{8cm}{El presente (singular): Llamarse y = ser.}
 | *LLAMARSE*         =      | *SER*           =  |
 | *Me llam\rsh{}* Isabel. | *\rsh{}* = Isabel. |
 | =BFC=F3mo *te llam\rsh{}?*  | = =BFQui=E9n *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

= --Apple-Mail-1-879670381-- --===============1011499800== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============1011499800==--