aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-06-08 03:29:09 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-06-08 03:29:09 +0000
commit3337b46e3030e0e1da6c5d9602a03100d5881b87 (patch)
tree158cd76e5cbff9cc275e5540e2e036d24f52d8cf
parentcd38d4ae79b41972960fd038c7c7cfbfe2dae92a (diff)
downloadpandoc-3337b46e3030e0e1da6c5d9602a03100d5881b87.tar.gz
Use \textsubscr instead of \textsubscript for LaTeX subscript macro.
\textsubscript conflicts with a definition in the memoir class. Resolves Issue #65. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1280 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r--Text/Pandoc/Writers/LaTeX.hs6
-rw-r--r--tests/writer.latex6
2 files changed, 6 insertions, 6 deletions
diff --git a/Text/Pandoc/Writers/LaTeX.hs b/Text/Pandoc/Writers/LaTeX.hs
index 7e7ecb222..a2e6eec2c 100644
--- a/Text/Pandoc/Writers/LaTeX.hs
+++ b/Text/Pandoc/Writers/LaTeX.hs
@@ -257,9 +257,9 @@ inlineToLaTeX (Superscript lst) =
inlineToLaTeX (Subscript lst) = do
contents <- inlineListToLaTeX $ deVerb lst
-- oddly, latex includes \textsuperscript but not \textsubscript
- -- so we have to define it:
- addToHeader "\\newcommand{\\textsubscript}[1]{\\ensuremath{_{\\scriptsize\\textrm{#1}}}}"
- return $ inCmd "textsubscript" contents
+ -- so we have to define it (using a different name so as not to conflict with memoir class):
+ addToHeader "\\newcommand{\\textsubscr}[1]{\\ensuremath{_{\\scriptsize\\textrm{#1}}}}"
+ return $ inCmd "textsubscr" contents
inlineToLaTeX (Code str) = do
st <- get
if stInNote st
diff --git a/tests/writer.latex b/tests/writer.latex
index 071aaf774..0da95f679 100644
--- a/tests/writer.latex
+++ b/tests/writer.latex
@@ -5,7 +5,7 @@
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
-\newcommand{\textsubscript}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}}
+\newcommand{\textsubscr}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}}
\usepackage[breaklinks=true]{hyperref}
\usepackage[normalem]{ulem}
\usepackage{enumerate}
@@ -529,8 +529,8 @@ This is code: \verb!>!, \verb!$!, \verb!\!, \verb!\$!,
Superscripts: a\textsuperscript{bc}d
a\textsuperscript{\emph{hello}} a\textsuperscript{hello there}.
-Subscripts: H\textsubscript{2}O, H\textsubscript{23}O,
-H\textsubscript{many of them}O.
+Subscripts: H\textsubscr{2}O, H\textsubscr{23}O,
+H\textsubscr{many of them}O.
These should not be superscripts or subscripts, because of the
unescaped spaces: a\^{}b c\^{}d, a\ensuremath{\sim}b