From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: Booktabs in new LaTeX exporter Date: Thu, 27 Dec 2012 15:42:36 -1000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:50331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ToOyZ-00043c-9u for Emacs-orgmode@gnu.org; Thu, 27 Dec 2012 20:43:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ToOyX-0004y7-2b for Emacs-orgmode@gnu.org; Thu, 27 Dec 2012 20:43:07 -0500 Received: from oproxy6-pub.bluehost.com ([67.222.54.6]:48474) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1ToOyW-0004xz-Np for Emacs-orgmode@gnu.org; Thu, 27 Dec 2012 20:43:05 -0500 In-Reply-To: (RCY's message of "Thu, 27 Dec 2012 20:20:36 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: RCY Cc: Emacs-orgmode@gnu.org 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 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 t= he > .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 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 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=3D1000 >> > \usepackage{booktabs} >> > \providecommand{\alert}[1]{\textbf{#1}} >> > >> > \title{tst} >> > \author{RC} >> > \date{\today} >> > \hypersetup{ >> > pdfkeywords=3D{}, >> > pdfsubject=3D{}, >> > pdfcreator=3D{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=3D1000 >> > \usepackage{booktabs} >> > \providecommand{\alert}[1]{\textbf{#1}} >> > >> > \title{tst} >> > \author{RC} >> > \date{\today} >> > \hypersetup{ >> > pdfkeywords=3D{}, >> > pdfsubject=3D{}, >> > pdfcreator=3D{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, > > =C2=A0I had tried t but then removed it when it did not work and the > documentation seemed to indicate that :booktabs was a toggle.=C2=A0 > I tried your suggestion to add=C2=A0=C2=A0(setq org-e-latex-tables-bookta= bs 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 wrote: > > Aloha RCY, >=20=20=20=20=20 > You can have this in your setup to enable booktabs globally: >=20=20=20=20=20 > =C2=A0 (setq org-e-latex-tables-booktabs t) >=20=20=20=20=20 > Or, you can give a table this attribute: >=20=20=20=20=20 > #+attr_latex: :booktabs t >=20=20=20=20=20 > I think your example should work if you add the t after :booktabs. >=20=20=20=20=20 > hth, > Tom >=20=20=20=20=20 >=20=20=20=20=20 >=20=20=20=20=20 > RCY writes: >=20=20=20=20=20 > > 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: > > > > =C2=A0 =C2=A0(setq org-install-dir "~/.emacs.d/src/org-mode") > > =C2=A0 =C2=A0(add-to-list 'load-path (concat org-install-dir > "/contrib/lisp")) > > =C2=A0 =C2=A0(add-to-list 'load-path (concat org-install-dir "/lisp= ")) > > =C2=A0 =C2=A0(require 'org-e-latex) > > > > =C2=A0 =C2=A0(add-to-list 'org-e-latex-classes > > =C2=A0 =C2=A0'("article" > > =C2=A0 =C2=A0"\\documentclass[11pt]{article} > > =C2=A0 =C2=A0\[DEFAULT-PACKAGES] > > =C2=A0 =C2=A0\[PACKAGES] > > =C2=A0 =C2=A0\[EXTRA]" > > =C2=A0 =C2=A0("\\section{%s}" . "\\section*{%s}") > > =C2=A0 =C2=A0("\\subsection{%s}" . "\\subsection*{%s}") > > =C2=A0 =C2=A0("\\subsubsection{%s}" . "\\subsubsection*{%s}"))) > > > > -----org.file----------- > > #+LATEX_CLASS: article > > #+LATEX_HEADER: \usepackage{booktabs} > > * Test > > #+ATTR_LATEX: :booktabs > > #+CAPTION: Test table > > =C2=A0|----+----| > > =C2=A0| 1 =C2=A0| 2 | > > =C2=A0|----+----| > > =C2=A0| A1 | A2 | > > =C2=A0| B1 | B2 | > > =C2=A0| C1 | C2 | > > =C2=A0|----+----| > > > > ------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=3D1000 > > \usepackage{booktabs} > > \providecommand{\alert}[1]{\textbf{#1}} > > > > \title{tst} > > \author{RC} > > \date{\today} > > \hypersetup{ > > =C2=A0 pdfkeywords=3D{}, > > =C2=A0 pdfsubject=3D{}, > > =C2=A0 pdfcreator=3D{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 > > =C2=A01 =C2=A0 & =C2=A02 =C2=A0 \\ > > \hline > > =C2=A0A1 =C2=A0& =C2=A0A2 =C2=A0\\ > > =C2=A0B1 =C2=A0& =C2=A0B2 =C2=A0\\ > > =C2=A0C1 =C2=A0& =C2=A0C2 =C2=A0\\ > > \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.=C2=A0 > > > > As a minimal example, I started emacs -q, and evaluated the > following: > > > > =C2=A0 =C2=A0(setq org-install-dir "~/.emacs.d/src/org-mode") > > =C2=A0 =C2=A0(add-to-list 'load-path (concat org-install-dir > "/contrib/lisp")) > > =C2=A0 =C2=A0(add-to-list 'load-path (concat org-install-dir "/lisp= ")) > > =C2=A0 =C2=A0(require 'org-e-latex) > > > > =C2=A0 =C2=A0(add-to-list 'org-e-latex-classes > > =C2=A0 =C2=A0'("article" > > =C2=A0 =C2=A0"\\documentclass[11pt]{article} > > =C2=A0 =C2=A0\[DEFAULT-PACKAGES] > > =C2=A0 =C2=A0\[PACKAGES] > > =C2=A0 =C2=A0\[EXTRA]" > > =C2=A0 =C2=A0("\\section{%s}" . "\\section*{%s}") > > =C2=A0 =C2=A0("\\subsection{%s}" . "\\subsection*{%s}") > > =C2=A0 =C2=A0("\\subsubsection{%s}" . "\\subsubsection*{%s}"))) > > > > -----org.file----------- > > #+LATEX_CLASS: article > > #+LATEX_HEADER: \usepackage{booktabs} > > * Test > > #+ATTR_LATEX: :booktabs > > #+CAPTION: Test table > > =C2=A0|----+----| > > =C2=A0| 1 =C2=A0| 2 | > > =C2=A0|----+----| > > =C2=A0| A1 | A2 | > > =C2=A0| B1 | B2 | > > =C2=A0| C1 | C2 | > > =C2=A0|----+----| > > > > ------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=3D1000 > > \usepackage{booktabs} > > \providecommand{\alert}[1]{\textbf{#1}} > > > > \title{tst} > > \author{RC} > > \date{\today} > > \hypersetup{ > > =C2=A0 pdfkeywords=3D{}, > > =C2=A0 pdfsubject=3D{}, > > =C2=A0 pdfcreator=3D{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}=C2=A0 > > \begin{center} > > \begin{tabular}{ll} > > \hline > > =C2=A01 =C2=A0 & =C2=A02 =C2=A0 \\ > > \hline > > =C2=A0A1 =C2=A0& =C2=A0A2 =C2=A0\\ > > =C2=A0B1 =C2=A0& =C2=A0B2 =C2=A0\\ > > =C2=A0C1 =C2=A0& =C2=A0C2 =C2=A0\\ > > \hline > > \end{tabular} > > \end{center} > > \end{table} > > > > \end{document} > > >=20=20=20=20=20 >=20=20=20=20=20 > -- > Thomas S. Dye > http://www.tsdye.com >=20=20=20=20=20 > --=20 Thomas S. Dye http://www.tsdye.com