emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: RCY <recif@yahoo.com>
To: "Thomas S. Dye" <tsd@tsdye.com>
Cc: Emacs-orgmode@gnu.org
Subject: Re: Booktabs in new LaTeX exporter
Date: Fri, 28 Dec 2012 05:50:34 -0500	[thread overview]
Message-ID: <CAD_Xbc6tqCpN_J3TsEykDLZKT_JBoYTRAKCbxx+KJ9Gz=PbgDw@mail.gmail.com> (raw)
In-Reply-To: <m17go3j6k3.fsf@tsdye.com>

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

Hi,
 Thanks for looking into this. I tried your suggestions but I am still
having the problem. It seems that some but not all attributes I set are
recognized. So in the example below it sets sideways table but ignores the
booktabs and positioning attributes.

#+LATEX_CLASS: article
#+LATEX_HEADER: \usepackage{booktabs}
----org-file-----
* Test
#+CAPTION: Test table
#+attr_latex: :booktabs t :align |r|l| :float sidewaystable
 |----+----|
 | 1  | 2  |
 |----+----|
 | A1 | A2 |
 | B1 | B2 |
 | C1 | C2 |
 |----+----|

-----latex buffer-----
:
\begin{sidewaystable}[htb]
\caption{Test table}
\begin{center}
\begin{tabular}{ll}
\hline
 1   &  2   \\
\hline
 A1  &  A2  \\
 B1  &  B2  \\
 C1  &  C2  \\
\hline
\end{tabular}
\end{center}
\end{sidewaystable}
-------------------------

On Thu, Dec 27, 2012 at 8:42 PM, Thomas S. Dye <tsd@tsdye.com> wrote:

> Hmm,
>
> It works like a charm here.
>
> I add booktabs like this:
>
>   (add-to-list 'org-export-latex-packages-alist '("" "booktabs"))
>
> Also, I noticed you have \[PACKAGES].  I don't escape the opening brace:
>
>   (add-to-list 'org-e-latex-classes
>                '("koma-article"
>                  "\\documentclass{scrartcl}
>       [NO-DEFAULT-PACKAGES]
>       [PACKAGES]
>       [EXTRA]
>       \\let\\itemize\\compactitem
>       \\let\\description\\compactdesc
>       \\let\\enumerate\\compactenum
>       \\bibliography{local}
>       \\newcommand{\\rc}{\\textsuperscript{14}C}
>       \\newcolumntype{Y}{>{\\RaggedRight\\arraybackslash}X}"
>                  ("\\section{%s}" . "\\section*{%s}")
>                  ("\\subsection{%s}" . "\\subsection*{%s}")
>                  ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
>                  ("\\paragraph{%s}" . "\\paragraph*{%s}")
>                  ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
>
> hth,
> Tom
>
> RCY <recif@yahoo.com> writes:
>
> > Hi,
> >  I had tried t but then removed it when it did not work and the
> > documentation seemed to indicate that :booktabs was a toggle.
> > I tried your suggestion to add  (setq org-e-latex-tables-booktabs t) to
> the
> > .emacs file but I am still getiing \hline. I did make sure to get the
> > latest version from git and I am running emacs 24.3.50.1.
> >
> > Thanks.
> >
> >
> > On Thu, Dec 27, 2012 at 7:17 PM, Thomas S. Dye <tsd@tsdye.com> wrote:
> >
> >> Aloha RCY,
> >>
> >> You can have this in your setup to enable booktabs globally:
> >>
> >>   (setq org-e-latex-tables-booktabs t)
> >>
> >> Or, you can give a table this attribute:
> >>
> >> #+attr_latex: :booktabs t
> >>
> >> I think your example should work if you add the t after :booktabs.
> >>
> >> hth,
> >> Tom
> >>
> >> RCY <recif@yahoo.com> writes:
> >>
> >> > I am trying to use the booktabs package for tables in the new
> exporter,
> >> > however I am unable to get \toprule, etc instead of \hrule
> >> > I would appreciate any suggestions to fix this.
> >> >
> >> > As a minimal example, I started emacs -q, and evaluated the following:
> >> >
> >> >    (setq org-install-dir "~/.emacs.d/src/org-mode")
> >> >    (add-to-list 'load-path (concat org-install-dir "/contrib/lisp"))
> >> >    (add-to-list 'load-path (concat org-install-dir "/lisp"))
> >> >    (require 'org-e-latex)
> >> >
> >> >    (add-to-list 'org-e-latex-classes
> >> >    '("article"
> >> >    "\\documentclass[11pt]{article}
> >> >    \[DEFAULT-PACKAGES]
> >> >    \[PACKAGES]
> >> >    \[EXTRA]"
> >> >    ("\\section{%s}" . "\\section*{%s}")
> >> >    ("\\subsection{%s}" . "\\subsection*{%s}")
> >> >    ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
> >> >
> >> > -----org.file-----------
> >> > #+LATEX_CLASS: article
> >> > #+LATEX_HEADER: \usepackage{booktabs}
> >> > * Test
> >> > #+ATTR_LATEX: :booktabs
> >> > #+CAPTION: Test table
> >> >  |----+----|
> >> >  | 1  | 2 |
> >> >  |----+----|
> >> >  | A1 | A2 |
> >> >  | B1 | B2 |
> >> >  | C1 | C2 |
> >> >  |----+----|
> >> >
> >> > ------latex-buffer from org-export-latex-as-buffer-------
> >> > % Created 2012-12-27 Thu 18:44
> >> > \documentclass[11pt]{article}
> >> > \usepackage[utf8]{inputenc}
> >> > \usepackage[T1]{fontenc}
> >> > \usepackage{fixltx2e}
> >> > \usepackage{graphicx}
> >> > \usepackage{longtable}
> >> > \usepackage{float}
> >> > \usepackage{wrapfig}
> >> > \usepackage{soul}
> >> > \usepackage{textcomp}
> >> > \usepackage{marvosym}
> >> > \usepackage{wasysym}
> >> > \usepackage{latexsym}
> >> > \usepackage{amssymb}
> >> > \usepackage{hyperref}
> >> > \tolerance=1000
> >> > \usepackage{booktabs}
> >> > \providecommand{\alert}[1]{\textbf{#1}}
> >> >
> >> > \title{tst}
> >> > \author{RC}
> >> > \date{\today}
> >> > \hypersetup{
> >> >   pdfkeywords={},
> >> >   pdfsubject={},
> >> >   pdfcreator={Emacs Org-mode version 7.9.2+}}
> >> >
> >> > \begin{document}
> >> >
> >> > \maketitle
> >> >
> >> > \setcounter{tocdepth}{3}
> >> > \tableofcontents
> >> > \vspace*{1cm}
> >> > \section{Test}
> >> > \label{sec-1}
> >> >
> >> > \begin{table}[htb]
> >> > \caption{Test table}
> >> > \begin{center}
> >> > \begin{tabular}{ll}
> >> > \hline
> >> >  1   &  2   \\
> >> > \hline
> >> >  A1  &  A2  \\
> >> >  B1  &  B2  \\
> >> >  C1  &  C2  \\
> >> > \hline
> >> > \end{tabular}
> >> > \end{center}
> >> > \end{table}
> >> >
> >> > \end{document}
> >> > I am trying to use the booktabs package for tables in the new
> >> > exporter, however I am unable to get \toprule, etc instead of \hrule
> >> >
> >> > I would appreciate any suggestions to fix this.
> >> >
> >> > As a minimal example, I started emacs -q, and evaluated the following:
> >> >
> >> >    (setq org-install-dir "~/.emacs.d/src/org-mode")
> >> >    (add-to-list 'load-path (concat org-install-dir "/contrib/lisp"))
> >> >    (add-to-list 'load-path (concat org-install-dir "/lisp"))
> >> >    (require 'org-e-latex)
> >> >
> >> >    (add-to-list 'org-e-latex-classes
> >> >    '("article"
> >> >    "\\documentclass[11pt]{article}
> >> >    \[DEFAULT-PACKAGES]
> >> >    \[PACKAGES]
> >> >    \[EXTRA]"
> >> >    ("\\section{%s}" . "\\section*{%s}")
> >> >    ("\\subsection{%s}" . "\\subsection*{%s}")
> >> >    ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
> >> >
> >> > -----org.file-----------
> >> > #+LATEX_CLASS: article
> >> > #+LATEX_HEADER: \usepackage{booktabs}
> >> > * Test
> >> > #+ATTR_LATEX: :booktabs
> >> > #+CAPTION: Test table
> >> >  |----+----|
> >> >  | 1  | 2 |
> >> >  |----+----|
> >> >  | A1 | A2 |
> >> >  | B1 | B2 |
> >> >  | C1 | C2 |
> >> >  |----+----|
> >> >
> >> > ------latex-buffer from org-export-latex-as-buffer-------
> >> > % Created 2012-12-27 Thu 18:44
> >> > \documentclass[11pt]{article}
> >> > \usepackage[utf8]{inputenc}
> >> > \usepackage[T1]{fontenc}
> >> > \usepackage{fixltx2e}
> >> > \usepackage{graphicx}
> >> > \usepackage{longtable}
> >> > \usepackage{float}
> >> > \usepackage{wrapfig}
> >> > \usepackage{soul}
> >> > \usepackage{textcomp}
> >> > \usepackage{marvosym}
> >> > \usepackage{wasysym}
> >> > \usepackage{latexsym}
> >> > \usepackage{amssymb}
> >> > \usepackage{hyperref}
> >> > \tolerance=1000
> >> > \usepackage{booktabs}
> >> > \providecommand{\alert}[1]{\textbf{#1}}
> >> >
> >> > \title{tst}
> >> > \author{RC}
> >> > \date{\today}
> >> > \hypersetup{
> >> >   pdfkeywords={},
> >> >   pdfsubject={},
> >> >   pdfcreator={Emacs Org-mode version 7.9.2+}}
> >> >
> >> > \begin{document}
> >> >
> >> > \maketitle
> >> >
> >> > \setcounter{tocdepth}{3}
> >> > \tableofcontents
> >> > \vspace*{1cm}
> >> > \section{Test}
> >> > \label{sec-1}
> >> >
> >> > \begin{table}[htb]
> >> > \caption{Test table}
> >> > \begin{center}
> >> > \begin{tabular}{ll}
> >> > \hline
> >> >  1   &  2   \\
> >> > \hline
> >> >  A1  &  A2  \\
> >> >  B1  &  B2  \\
> >> >  C1  &  C2  \\
> >> > \hline
> >> > \end{tabular}
> >> > \end{center}
> >> > \end{table}
> >> >
> >> > \end{document}
> >> >
> >>
> >> --
> >> Thomas S. Dye
> >> http://www.tsdye.com
> >>
> > Hi,
> >
> >  I had tried t but then removed it when it did not work and the
> > documentation seemed to indicate that :booktabs was a toggle.
> > I tried your suggestion to add  (setq org-e-latex-tables-booktabs t)
> > to the .emacs file but I am still getiing \hline. I did make sure to
> > get the latest version from git and I am running emacs 24.3.50.1.
> >
> > Thanks.
> >
> >
> > On Thu, Dec 27, 2012 at 7:17 PM, Thomas S. Dye <tsd@tsdye.com> wrote:
> >
> >     Aloha RCY,
> >
> >     You can have this in your setup to enable booktabs globally:
> >
> >       (setq org-e-latex-tables-booktabs t)
> >
> >     Or, you can give a table this attribute:
> >
> >     #+attr_latex: :booktabs t
> >
> >     I think your example should work if you add the t after :booktabs.
> >
> >     hth,
> >     Tom
> >
> >
> >
> >     RCY <recif@yahoo.com> writes:
> >
> >     > I am trying to use the booktabs package for tables in the new
> >     exporter,
> >     > however I am unable to get \toprule, etc instead of \hrule
> >     > I would appreciate any suggestions to fix this.
> >     >
> >     > As a minimal example, I started emacs -q, and evaluated the
> >     following:
> >     >
> >     >    (setq org-install-dir "~/.emacs.d/src/org-mode")
> >     >    (add-to-list 'load-path (concat org-install-dir
> >     "/contrib/lisp"))
> >     >    (add-to-list 'load-path (concat org-install-dir "/lisp"))
> >     >    (require 'org-e-latex)
> >     >
> >     >    (add-to-list 'org-e-latex-classes
> >     >    '("article"
> >     >    "\\documentclass[11pt]{article}
> >     >    \[DEFAULT-PACKAGES]
> >     >    \[PACKAGES]
> >     >    \[EXTRA]"
> >     >    ("\\section{%s}" . "\\section*{%s}")
> >     >    ("\\subsection{%s}" . "\\subsection*{%s}")
> >     >    ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
> >     >
> >     > -----org.file-----------
> >     > #+LATEX_CLASS: article
> >     > #+LATEX_HEADER: \usepackage{booktabs}
> >     > * Test
> >     > #+ATTR_LATEX: :booktabs
> >     > #+CAPTION: Test table
> >     >  |----+----|
> >     >  | 1  | 2 |
> >     >  |----+----|
> >     >  | A1 | A2 |
> >     >  | B1 | B2 |
> >     >  | C1 | C2 |
> >     >  |----+----|
> >     >
> >     > ------latex-buffer from org-export-latex-as-buffer-------
> >     > % Created 2012-12-27 Thu 18:44
> >     > \documentclass[11pt]{article}
> >     > \usepackage[utf8]{inputenc}
> >     > \usepackage[T1]{fontenc}
> >     > \usepackage{fixltx2e}
> >     > \usepackage{graphicx}
> >     > \usepackage{longtable}
> >     > \usepackage{float}
> >     > \usepackage{wrapfig}
> >     > \usepackage{soul}
> >     > \usepackage{textcomp}
> >     > \usepackage{marvosym}
> >     > \usepackage{wasysym}
> >     > \usepackage{latexsym}
> >     > \usepackage{amssymb}
> >     > \usepackage{hyperref}
> >     > \tolerance=1000
> >     > \usepackage{booktabs}
> >     > \providecommand{\alert}[1]{\textbf{#1}}
> >     >
> >     > \title{tst}
> >     > \author{RC}
> >     > \date{\today}
> >     > \hypersetup{
> >     >   pdfkeywords={},
> >     >   pdfsubject={},
> >     >   pdfcreator={Emacs Org-mode version 7.9.2+}}
> >     >
> >     > \begin{document}
> >     >
> >     > \maketitle
> >     >
> >     > \setcounter{tocdepth}{3}
> >     > \tableofcontents
> >     > \vspace*{1cm}
> >     > \section{Test}
> >     > \label{sec-1}
> >     >
> >     > \begin{table}[htb]
> >     > \caption{Test table}
> >     > \begin{center}
> >     > \begin{tabular}{ll}
> >     > \hline
> >     >  1   &  2   \\
> >     > \hline
> >     >  A1  &  A2  \\
> >     >  B1  &  B2  \\
> >     >  C1  &  C2  \\
> >     > \hline
> >     > \end{tabular}
> >     > \end{center}
> >     > \end{table}
> >     >
> >     > \end{document}
> >     > I am trying to use the booktabs package for tables in the new
> >     > exporter, however I am unable to get \toprule, etc instead of
> >     \hrule
> >     >
> >     > I would appreciate any suggestions to fix this.
> >     >
> >     > As a minimal example, I started emacs -q, and evaluated the
> >     following:
> >     >
> >     >    (setq org-install-dir "~/.emacs.d/src/org-mode")
> >     >    (add-to-list 'load-path (concat org-install-dir
> >     "/contrib/lisp"))
> >     >    (add-to-list 'load-path (concat org-install-dir "/lisp"))
> >     >    (require 'org-e-latex)
> >     >
> >     >    (add-to-list 'org-e-latex-classes
> >     >    '("article"
> >     >    "\\documentclass[11pt]{article}
> >     >    \[DEFAULT-PACKAGES]
> >     >    \[PACKAGES]
> >     >    \[EXTRA]"
> >     >    ("\\section{%s}" . "\\section*{%s}")
> >     >    ("\\subsection{%s}" . "\\subsection*{%s}")
> >     >    ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
> >     >
> >     > -----org.file-----------
> >     > #+LATEX_CLASS: article
> >     > #+LATEX_HEADER: \usepackage{booktabs}
> >     > * Test
> >     > #+ATTR_LATEX: :booktabs
> >     > #+CAPTION: Test table
> >     >  |----+----|
> >     >  | 1  | 2 |
> >     >  |----+----|
> >     >  | A1 | A2 |
> >     >  | B1 | B2 |
> >     >  | C1 | C2 |
> >     >  |----+----|
> >     >
> >     > ------latex-buffer from org-export-latex-as-buffer-------
> >     > % Created 2012-12-27 Thu 18:44
> >     > \documentclass[11pt]{article}
> >     > \usepackage[utf8]{inputenc}
> >     > \usepackage[T1]{fontenc}
> >     > \usepackage{fixltx2e}
> >     > \usepackage{graphicx}
> >     > \usepackage{longtable}
> >     > \usepackage{float}
> >     > \usepackage{wrapfig}
> >     > \usepackage{soul}
> >     > \usepackage{textcomp}
> >     > \usepackage{marvosym}
> >     > \usepackage{wasysym}
> >     > \usepackage{latexsym}
> >     > \usepackage{amssymb}
> >     > \usepackage{hyperref}
> >     > \tolerance=1000
> >     > \usepackage{booktabs}
> >     > \providecommand{\alert}[1]{\textbf{#1}}
> >     >
> >     > \title{tst}
> >     > \author{RC}
> >     > \date{\today}
> >     > \hypersetup{
> >     >   pdfkeywords={},
> >     >   pdfsubject={},
> >     >   pdfcreator={Emacs Org-mode version 7.9.2+}}
> >     >
> >     > \begin{document}
> >     >
> >     > \maketitle
> >     >
> >     > \setcounter{tocdepth}{3}
> >     > \tableofcontents
> >     > \vspace*{1cm}
> >     > \section{Test}
> >     > \label{sec-1}
> >     >
> >     > \begin{table}[htb]
> >     > \caption{Test table}
> >     > \begin{center}
> >     > \begin{tabular}{ll}
> >     > \hline
> >     >  1   &  2   \\
> >     > \hline
> >     >  A1  &  A2  \\
> >     >  B1  &  B2  \\
> >     >  C1  &  C2  \\
> >     > \hline
> >     > \end{tabular}
> >     > \end{center}
> >     > \end{table}
> >     >
> >     > \end{document}
> >     >
> >
> >
> >     --
> >     Thomas S. Dye
> >     http://www.tsdye.com
> >
> >
>
> --
> Thomas S. Dye
> http://www.tsdye.com
>

[-- Attachment #2: Type: text/html, Size: 20887 bytes --]

  reply	other threads:[~2012-12-28 10:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-27 23:57 Booktabs in new LaTeX exporter RCY
2012-12-28  0:17 ` Thomas S. Dye
2012-12-28  1:20   ` RCY
2012-12-28  1:42     ` Thomas S. Dye
2012-12-28 10:50       ` RCY [this message]
2012-12-28 17:27         ` Thomas S. Dye
2012-12-28 18:05           ` RCY
2012-12-28 19:06             ` Thomas S. Dye
2012-12-28 23:07               ` RCY

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='CAD_Xbc6tqCpN_J3TsEykDLZKT_JBoYTRAKCbxx+KJ9Gz=PbgDw@mail.gmail.com' \
    --to=recif@yahoo.com \
    --cc=Emacs-orgmode@gnu.org \
    --cc=tsd@tsdye.com \
    /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).