jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.87k stars 3.39k forks source link

subscript in italics bug #1767

Closed mclearc closed 10 years ago

mclearc commented 10 years ago

It seems that writing something like

*this is emphasis with~subscript~* 

produces an error in Latex. It has to read

*this is emphasis with*~subscript~ 

instead.

jkr commented 10 years ago

Works for me with with pandoc 1.13.1 (either going straight to pdf or to tex and then compiling by hand).

Which version of pandoc? And what's the output of

echo '*this is emphasis with~subscript~*' | pandoc -t latex
mclearc commented 10 years ago

Hmm. I'm using pandoc 1.13.1.

I get what I should in terminal:

\emph{this is emphasis with\textsubscript{subscript}}

But when trying in a document (using vim 7.4 and vim-pandoc, though I've tried this in Sublime Text 3 as well) I get

Undefined control sequence.
\fakesubscript #1->\@textsubscript 
                               {\selectfont #1}
l.204 L\textsubscript{2}}

pandoc: Error producing PDF from TeX source

I've tried this with a couple different documents. Any ideas?

jkr commented 10 years ago

Not sure how those text editors do it. Does the entire document compile to pdf correctly from the command line? pandoc input.md -o out.pdf ? If so, have you checked to make sure that the text editors are using the correct version of pandoc? (Sometimes there's a more recent version in cabal/bin and an older version installed somewhere else.)

mclearc commented 10 years ago

It doesn't compile from the command line either and gives the same error. I'll have to see if there is perhaps something up with the template.

jkr commented 10 years ago

Oh, yeah -- good point. Could you post the standalone tex output with whatever your default template is?

mclearc commented 10 years ago

Here is the preamble plus a relevant bit with the subscript output (see the end) that's causing the problem.

\documentclass[, 11pt]{article}

\usepackage{amssymb,amsmath} \usepackage{ifxetex,ifluatex} \usepackage{fontspec,xltxtra,xunicode} \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} \setromanfont[Mapping=tex-text]{Optima} \setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Optima} \setmonofont[Scale=MatchLowercase]{Andale Mono}

%VARIABLE OPTIONS

%BEAMER \usepackage{graphicx} \setkeys{Gin}{keepaspectratio} \setkeys{Gin}{width=\textwidth} \setkeys{Gin}{height=.75\textheight}

\usepackage{url}

%PACKAGES \usepackage{soul} \usepackage{setspace} \usepackage{mdwlist} \usepackage{fancyhdr} \usepackage{lastpage} \usepackage{type1cm} % scalable fonts \usepackage{lettrine} \usepackage{microtype} \usepackage{epigraph} \usepackage[italian=guillemets]{csquotes} \usepackage{comment} \usepackage[letterpaper,centering,margin=1.75in]{geometry} \usepackage[usenames,dvipsnames,svgnames,table]{xcolor} %\definecolor{gray}{rgb}{0.459,0.438,0.471} \usepackage[hang,flushmargin, stable, multiple]{footmisc} %\usepackage{footnotebackref} \usepackage{titling} \usepackage{footnote} \makesavenoteenv{minipage} \usepackage{manyfoot} \DeclareNewFootnote{A}[fnsymbol] \definecolor{darkblue}{rgb}{0.0,0.0,.5} \usepackage[setpagesize=false, unicode=false, xetex, breaklinks=true]{hyperref} \hypersetup{ % colorlinks=true, % citecolor=teal, % linkcolor=purple, urlcolor=darkblue}

%LAYOUT SETTINGS \setlength{\parindent}{1.5em} %\setlength{\parskip}{2pt plus 2pt minus 1pt} %\setlength\parindent{0pt} %\setlength{\parskip}{6pt plus 2pt minus 1pt} \setlength{\emergencystretch}{3em} % prevent overfull lines %\renewcommand*\thesubsection{\arabic{subsection}}

%symbol footnote flag, helpful for epigraph note \long\def\symbolfootnote[#1]#2{\begingroup\def\thefootnote{\fnsymbol{footnote}}\footnote[#1]{#2}\endgroup}

\addtolength{\footskip}{0.5cm} \setlength{\footnotemargin}{0.3cm} \setlength{\footnotesep}{0.4cm} \widowpenalty=8000 \clubpenalty=8000 \interfootnotelinepenalty=10000 %\setlength{\footnotesep}{0.35cm} \setlength{\headheight}{15pt} \setlength{\epigraphwidth}{.8\textwidth}

\newfontface\smallcapsfont[Scale=0.75,LetterSpace=3.0]{Optima} \renewcommand\textsc[1]{{\smallcapsfont \uppercase{#1}}}

%PAGE STYLE \pagestyle{fancy} \lhead{Priority Monism, Intuition, and Freedom}

\chead{} \rhead{\thedate}

\lfoot{\today} \cfoot{} \rfoot{\thepage} % Fake a table of contents to get the hyperlinks %\makeatletter %\newcommand\silenttableofcontents{% % \newwrite\tf@toc % \immediate\openout\tf@toc \jobname.toc %}

%\makeatother

%HEADER VARIABLES

\pretitle{\begin{flushleft}\huge} \title{\textbf{Priority Monism, Intuition, and Freedom}} \posttitle{\par\end{flushleft}\vspace{-5mm}} \setlength{\droptitle}{-80pt} \preauthor{\begin{flushleft}\Large} %\author{\Large \vspace{0.05in} } \author{Colin McLear} \postauthor{\par\end{flushleft}\vspace{-9mm}} \date{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\maketitle

\begin{abstract}

\noindent \footnotesize{I argue that Kant's attempts to secure the possibility of freedom via transcendental idealism are in fundamental tension with his conception of intuition, both in its Godly intellectual form, and in the spatio- temporal form of creatures like us. Hence, Kant's attempt to limit Priority Monism to the phenomenal level while leaving open the possibility for free action at the noumenal level seems vulnerable to a deep internal inconsistency. I close by examining some possible avenues by which the Kantian position might be defended.}

\end{abstract}

%\renewcommand\tableofcontents

%SPACING %%%\onehalfspacing %

\section{Introduction}\label{introduction}

In a note from 1797 Kant says that

\begin{quote} the system of the \emph{Critique of Pure Reason} revolves around two cardinal points: as system of nature and of freedom, each of which leads to the necessity of the other. -- The ideality of space and time and the reality of the concept of freedom (R 6353; cf.~R 6344, R 6349). \end{quote}

\noindent As Kant makes clear here, he construes the ideality of space and time, and thus his system of transcendental idealism, as crucial to securing the possibility of freedom. Elsewhere, Kant explicitly sets his system of transcendental idealism against Spinoza's monistic necessitarianism, infamously arguing that,

\begin{quote} if this ideality of time and space is not adopted, nothing remains but Spinozism, in which space and time are essential determinations of the original being itself, while the things dependent upon it (ourselves, therefore, included) are not substances but merely accidents inhering in it; for, if these things exist merely as its effects in time, which would be the condition of their existence itself, then the actions of these beings would have to be merely its actions that it performs in any place and at any time. Thus Spinozism, despite the absurdity of its fundamental idea, argues more consistently than the creation theory can when beings assumed to be substances and in themselves existing in time are regarded as effects of a supreme cause and yet as not belonging to him and his action but as substances in themselves. (\emph{CPrR} 5:101-2) \end{quote}

\noindent Here Kant juxtaposes his own transcendental idealism with a Spinozistic monism, which he seems to think is entailed by transcendental realism about space and time. As he puts it in a lecture dated from the early 1790's,

\begin{quote} If I take space as an entity in itself, then Spinozism is irrefutable, i.e.~the parts of the world are parts of the Godhead. Space is the Godhead, it is united {[}\emph{einig}{]}, omnipresent, nothing can be thought outside of it, everything is in it'' (\emph{Metaphysik} L\textsubscript{2} (1790/91?), 28:567). \end{quote}

\end{document}

mclearc commented 10 years ago

The document works with the template in jam/pandoc-templates. So there must be a conflict with a package or something. I'll try to hunt it down.

jkr commented 10 years ago

I think you need \usepackage{fixltx2e} in there. (Not entirely sure why, but the comment says it fixes subscripts)

jkr commented 10 years ago

Ah, yep. In the description of the problems fixed by fixltx2e one of them is:

\emph can pro­duce caps/small caps text

I assume the same goes for subscripts etc.

mclearc commented 10 years ago

Yep. That fixed it. Thanks for your help!