XeTeXEmacs | Debug org-mode Template

Information and discussion about XeTeX, an alternative for pdfTeX based on e-Tex
Post Reply
petersalazar
Posts: 1
Joined: Sat Mar 10, 2012 3:04 am

Emacs | Debug org-mode Template

Post by petersalazar »

I'm a LaTeX newbie and I use Emacs org-mode to export to PDF via XeTeX.

I have a LaTeX export template I use with org-mode, and I've spent the last week trying and failing to figure out three things:
  1. How to add color to my section headers.
  2. How to put the section name in the header without the section numbering.
  3. How to put a page break after the Table of Contents given that I'm generating everything from within org-mode.
With colored section headers, I've tried various packages and methods, but they must be conflicting with something else I'm doing because it's not working.

With the section name in the header, I followed instructions to remove section numbering:

Code: Select all

\\renewcommand{\\chaptermark}[1]{\\markboth{#1}{}}
\\renewcommand{\\sectionmark}[1]{\\markboth{#1}{}}
...but this just resulted in a header that displayed "Contents" on every page and never changed.

My template is below. If anyone wants to take pity on me and help me fix it, I would be forever grateful.

Code: Select all

(add-to-list 'org-export-latex-classes
  '("salazar"
"\documentclass[12pt]{article}
\usepackage{float}
\usepackage[breaklinks=true,linktocpage,pdftitle={\@title},pdfauthor={\@author},xetex]{hyperref}
\usepackage{algorithm}
\usepackage{amsmath}
\usepackage{ifxetex}
\ifxetex
  \usepackage{fontspec,xltxtra,xunicode}
  \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
  \setromanfont{Adobe Garamond Pro}
  \setsansfont{Arial}
  \setmonofont{Courier}
\else
  \usepackage[mathletters]{ucs}
  \usepackage[utf8x]{inputenc}
\fi
\usepackage{microtype}
\usepackage{url}
\usepackage{graphicx}
\hypersetup{ colorlinks, citecolor=SteelBlue4,filecolor=SteelBlue4,linkcolor=SteelBlue4,urlcolor=SteelBlue4}
\usepackage[includeheadfoot,margin=2.2in,hmargin=2.2in,vmargin=1.5in]{geometry}
\makeatletter
\def\maketitle{
  \thispagestyle{empty}
    \vfill
  \begin{raggedright}
  \leavevmode
    \vskip 1cm
    \{\fontsize{50}{60}\selectfont \textbf{\@title}\par}
    \vskip 1cm
    \normalfont
    \{\Huge {\textit{\@author}\par}}
  \vfill
        \{\Large Peter Salazar}
    \newline
          \{\Large \href{mailto:cycleofsong@gmail.com}{cycleofsong@gmail.com}}
        \newline

    \{\Large \@date\par}
   \end{raggedright}
  \null
  \cleardoublepage
}

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markboth{#1}{}}
\lhead{\href{mailto:cycleofsong@gmail.com}{Peter Salazar}}
\chead{}
\rhead{{\@title}: {\nouppercase{\rightmark}}}
\lfoot{}
\cfoot{\thepage}
\rfoot{}
\usepackage{listings}
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
\setlength{\parindent}{0pt}
\setlength{\parskip}{12pt plus 2pt minus 1pt}
\usepackage{fancyvrb}
\usepackage{enumerate}
\usepackage{ctable}
\setlength{\paperwidth}{8.5in}
\setlength{\paperheight}{11in}
\tolerance=1000
\usepackage{tocloft}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
\usepackage[normalem]{ulem}
\usepackage[hyperref,x11names]{xcolor}
\newcommand{\textsubscr}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}}


\usepackage{paralist}
\let\itemize\compactitem
\let\description\compactdesc
\let\enumerate\compactenum  
\let\description\compactdesc
\usepackage{enumitem}
\setitemize{noitemsep,topsep=0pt,parsep=0pt,partopsep=0pt}

      [NO-DEFAULT-PACKAGES]
      [NO-PACKAGES]"

     ("\section{%s}" . "\section*{%s}")
     ("\subsection{%s}" . "\subsection*{%s}")
     ("\subsubsection{%s}" . "\subsubsection*{%s}")
     ("\paragraph{%s}" . "\paragraph*{%s}")
     ("\subparagraph{%s}" . "\subparagraph*{%s}")))
Last edited by localghost on Sat Mar 10, 2012 10:28 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

justdeath
Posts: 69
Joined: Mon Sep 05, 2011 10:27 am

Emacs | Debug org-mode Template

Post by justdeath »

Hello to the forum !

First the bad stuff: this does not compile... thus I can't help you much.

With what I can: for empty page on the contents:

Code: Select all

\tableofcontents
\clearpage %\newpage %\cleardoublepage (book only)
section without numbering (but you don't need numbers only in header):

Code: Select all

\renewcommand{\thesection}{}
That's for now. Send something working :)

Nikolay
Post Reply