When I try to use pdflatex to compile the following latex code, it throws errors:
[steevmi1@phusca-L24500][21:01]
[~/] % cat ./bar.tex
% Created 2012-05-02 Wed 20:57
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[minted,minion]{org-preamble-pdflatex}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\providecommand{\alert}[1]{\textbf{#1}}
\title{bar}
\author{Steeves}
\date{\today}
\hypersetup{
pdfkeywords={},
pdfsubject={},
pdfcreator={Emacs Org-mode version 7.8.09}}
\begin{document}
\maketitle
% Org-mode is exporting headings to 3 levels.
\section{This is heading one}
\label{sec-1}
Some text
\subsection{This is heading two}
\label{sec-1-1}
Some more text
\end{document}% [steevmi1@phusca-L24500][21:01]
[~/] % pdflatex ./bar.tex
This is pdfTeX, Version 3.1415926-2.3-1.40.12 (TeX Live 2011/MacPorts 2011_5)
restricted \write18 enabled.
entering extended mode
(./bar.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, dumylang, nohyphenation, et
hiopic, arabic, farsi, pinyin, croatian, bulgarian, russian, ukrainian, czech,
slovak, danish, dutch, ukenglish, usenglishmax, finnish, basque, french, german
-x-2009-06-19, ngerman-x-2009-06-19, german, ngerman, swissgerman, monogreek, g
reek, ancientgreek, ibycus, hungarian, assamese, bengali, gujarati, hindi, kann
ada, malayalam, marathi, oriya, panjabi, tamil, telugu, sanskrit, italian, lati
n, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk, afrikaans, ar
menian, coptic, esperanto, estonian, icelandic, indonesian, interlingua, irish,
kurmanji, lao, romanian, serbian, serbianc, slovenian, turkish, uppersorbian,
welsh, polish, portuguese, spanish, catalan, galician, swedish, turkmen, loaded
.
(/opt/local/share/texmf-texlive-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/opt/local/share/texmf-texlive-dist/tex/latex/base/size11.clo))
(/opt/local/share/texmf-texlive-dist/tex/latex/base/inputenc.sty
(/opt/local/share/texmf-texlive-dist/tex/latex/base/utf8.def
(/opt/local/share/texmf-texlive-dist/tex/latex/base/t1enc.dfu)
(/opt/local/share/texmf-texlive-dist/tex/latex/base/ot1enc.dfu)
(/opt/local/share/texmf-texlive-dist/tex/latex/base/omsenc.dfu)))
(/Users/steevmi1/Library/texmf/tex/kjhealy/org-preamble-pdflatex.sty
(/opt/local/share/texmf-texlive-dist/tex/latex/base/ifthen.sty)
(/opt/local/share/texmf-texlive-dist/tex/latex/base/fontenc.sty
(/opt/local/share/texmf-texlive-dist/tex/latex/base/t1enc.def))
(/opt/local/share/texmf-texlive-dist/tex/latex/base/fixltx2e.sty)
(/opt/local/share/texmf-texlive-dist/tex/latex/wrapfig/wrapfig.sty)
(/opt/local/share/texmf-texlive-dist/tex/latex/rotating/rotating.sty
(/opt/local/share/texmf-texlive-dist/tex/latex/graphics/graphicx.sty
(/opt/local/share/texmf-texlive-dist/tex/latex/graphics/keyval.sty)
(/opt/local/share/texmf-texlive-dist/tex/latex/graphics/graphics.sty
(/opt/local/share/texmf-texlive-dist/tex/latex/graphics/trig.sty)
(/opt/local/share/texmf-texlive-dist/tex/latex/latexconfig/graphics.cfg)
(/opt/local/share/texmf-texlive-dist/tex/latex/pdftex-def/pdftex.def
(/opt/local/share/texmf-texlive-dist/tex/generic/oberdiek/infwarerr.sty)
(/opt/local/share/texmf-texlive-dist/tex/generic/oberdiek/ltxcmds.sty)))))
(/Users/steevmi1/Library/texmf/tex/kjhealy/memoir-article-styles.sty
! LaTeX Error: \andnext undefined.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.17 \renewcommand*{\andnext}
{%
?
I'm assuming that this is an issue where it's looking at the "memoir-article-styles.sty" file before it's loaded the actual memoir class, but I'm not sure how to fix it.
The contents of the org-preamble-pdflatex.sty file:
%% Preamble/settings for documents exported from .org files to .tex files when the
%% tex engine is pdflatex.
%%
%% Usage: \usepackage{org-preamble-pdflatex} in your document
%% preamble. \usepackage[minion]{org-preamble-pdflatex}
%% activates the MinionPro package instead of Times New Roman. The
%% actual Minion Pro font files must be installed first, in accordance
%% with the instructions in the MinionPro package.
%% \usepackage[minted]{org-preamble-xelatex} activates the minted
%% package for code highlighting. Minted requires that pygments be
%% installed (http://pygments.org/) and that \write18 support be
%% enabled in your tex compiler.
%% Kieran Healy
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{org-preamble-pdflatex}[2011/02/21 v0.01 Bundling of Preamble items for Org to pdfLaTeX export (including MinionPro)]
\RequirePackage{ifthen}
\newboolean{@minion}
\newboolean{@minted}
\setboolean{@minion}{false} % minion is off by default
\setboolean{@minted}{false} % minted is off by default
\DeclareOption{minion}{
\setboolean{@minion}{true}
}
\DeclareOption{minted}{
\setboolean{@minted}{true}
}
\ProcessOptions
\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}
\RequirePackage{fixltx2e}
\RequirePackage{wrapfig}
\RequirePackage{rotating}
\RequirePackage{memoir-article-styles}
\RequirePackage[american]{babel}
\RequirePackage[babel]{csquotes}
\RequirePackage[svgnames]{xcolor}
\RequirePackage{soul}
%%% If \RequirePackage[minion]{org-preamble-pdflatex} is set,
%%% MinionPro and microtype setup (requires full installation of MinionPro font)
%%% If MinionPro is not specified, use Times instead.
\ifthenelse{\boolean{@minion}}{
\RequirePackage[fullfamily,opticals,footnotefigures]{MinionPro}
\RequirePackage[scaled=0.78]{beramono}
\RequirePackage{microtype}
\RequirePackage[toc,eqno,enum]{tabfigures}
\renewcommand{\scdefault}{ssc} %% nicer small-caps headings
}{
\RequirePackage{times}
\RequirePackage[config=mt-ptm]{microtype}
\RequirePackage[scaled=0.74]{beramono}
}
\RequirePackage[colorlinks=true, urlcolor=DarkSlateBlue,
citecolor=DarkSlateBlue, filecolor=DarkSlateBlue, plainpages=false,
pdfpagelabels, bookmarksnumbered]{hyperref}
\RequirePackage{etoolbox}
%% Biblatex
% \RequirePackage[authordate, backend=biber, babel=hyphen, bibencoding=inputenc, strict, isbn=false, uniquename=false]{biblatex-chicago} % biblatex setup
\RequirePackage[style=authoryear,
bibstyle=authoryear,
citestyle=authoryear-comp,
uniquename=false,
hyperref=true,
backend=biber, babel=hyphen, bibencoding=inputenc]{biblatex}
%% Fix biblatex's odd preference for using In: by default.
\renewbibmacro{in:}{%
\ifentrytype{article}{}{%
\printtext{\bibstring{}\intitlepunct}}}
%% Basic bibliography
\addbibresource{/Users/kjhealy/Documents/bibs/socbib.bib}
%% these tweak the biblatex-chicago format to conform to AJS style.
\DeclareFieldFormat[article]{title}{\mkbibquote{#1}}
\DeclareFieldFormat[book]{title}{%
\mkbibemph{#1}\isdot} % for books
\DeclareFieldFormat{booktitle}{\mkbibemph{#1}} % for edited volumes
%% bibnamedash: with Minion Pro the three-emdash lines in the
%% bibliogrpaphy end up separated from one another, which is very
%% annoying. Replace them with a line of appropriate size and weight.
\renewcommand{\bibnamedash}{\rule[3.5pt]{3em}{0.5pt}\,}
%% Pagestyle
\pagestyle{kjh}
%% If [minted] option is chosen, activate minted
\ifthenelse{\boolean{@minted}}{
\RequirePackage{minted}
\usemintedstyle{tango}
\definecolor{bg}{rgb}{0.95,0.95,0.95}
\setkeys{Gin}{width=1\@textwidth}
}{}
\endinput
For the sake of completeness, the contents of memoir-article-style.sty are at https://github.com/kjhealy/latex-custom-kjh/tree/master/needs-memoir (the file is fairly large at 551 lines, so I'm putting a link to it rather than the actual contents).
org-preamble-pdflatex
? You probably need to post this package as well. – Boris May 3 '12 at 1:14\usepackage[minted,minion]{org-preamble-pdflatex}
and add\usepackage{hyperref}
. So your problem is related to what is inorg-preamble-pdflatex
. Also, since the problem is with a\renewcommand
, you could try adding\providecommand{\andnext}{}%
and see if that fixes it. – Peter Grill May 3 '12 at 1:18memoir-article-styles
with thearticle
class? Is this supported? Shouldn't you be usingmemoir
? – Stephan Lehmke May 3 '12 at 5:07