git.iko.soy/typeable/pandoc
on master help sign in
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

commit3337b46e3030e0e1da6c5d9602a03100d5881b87 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 8 Jun 2008, 03:29 (18 years ago) parentcd38d4a
2 files changed+6−6
Text/Pandoc/Writers/LaTeX.hs+3−3 tests/writer.latex+3−3
Text/Pandoc/Writers/LaTeX.hs+3−3
@@ -257,9 +257,9 @@ inlineToLaTeX (Superscript lst) =
257257inlineToLaTeX (Subscript lst) = do
258258 contents <- inlineListToLaTeX $ deVerb lst
259259 -- oddly, latex includes \textsuperscript but not \textsubscript
260− -- so we have to define it:
261− addToHeader "\\newcommand{\\textsubscript}[1]{\\ensuremath{_{\\scriptsize\\textrm{#1}}}}"
262− return $ inCmd "textsubscript" contents
260+ -- so we have to define it (using a different name so as not to conflict with memoir class):
261+ addToHeader "\\newcommand{\\textsubscr}[1]{\\ensuremath{_{\\scriptsize\\textrm{#1}}}}"
262+ return $ inCmd "textsubscr" contents
263263inlineToLaTeX (Code str) = do
264264 st <- get
265265 if stInNote st
tests/writer.latex+3−3
@@ -5,7 +5,7 @@
55\setlength{\parindent}{0pt}
66\setlength{\parskip}{6pt plus 2pt minus 1pt}
77
8−\newcommand{\textsubscript}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}}
8+\newcommand{\textsubscr}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}}
99\usepackage[breaklinks=true]{hyperref}
1010\usepackage[normalem]{ulem}
1111\usepackage{enumerate}
@@ -529,8 +529,8 @@ This is code: \verb!>!, \verb!$!, \verb!\!, \verb!\$!,
529529Superscripts: a\textsuperscript{bc}d
530530a\textsuperscript{\emph{hello}} a\textsuperscript{hello there}.
531531
532−Subscripts: H\textsubscript{2}O, H\textsubscript{23}O,
533−H\textsubscript{many of them}O.
532+Subscripts: H\textsubscr{2}O, H\textsubscr{23}O,
533+H\textsubscr{many of them}O.
534534
535535These should not be superscripts or subscripts, because of the
536536unescaped spaces: a\^{}b c\^{}d, a\ensuremath{\sim}b