我一直在尝试一个简单的反应,chemformula
但它没有显示箭头。有一个类似的问题这里但该解决方案对我来说不起作用(我没有使用 dvips)。
这里有一个平均能量损失
\documentclass[a4paper,12pt]{article}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{chemmacros}
\chemsetup{modules=all}
\chemsetup{formula=chemformula}
\begin{document}
\ch{glucosa_{(s)} <=> glucosa_{(aq)}}
\end{document}
报告的错误是:
*************************************************
* chemmacros warning: "no-greek"
*
* You haven't loaded any package for upright Greek letters or no unique choice
* was possible. Either load one of packages specified in the manual or select
* a chemgreek mapping manually.
*************************************************
(/usr/local/texlive/2018/texmf-dist/tex/latex/elements/elements_names_spanish.d
ef)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! chemformula error: "unknown-arrow"
!
! The arrow type <=> doesn't exist on line 26.
!
! See the chemformula documentation for further information.
!
! Type <return> to continue.
!...............................................
l.26 \ch{glucosa_{(s)} <=> glucosa_{(aq)}}
答案1
您必须删除babel
的修改(正在进行>
和<
活动的修改)。
\documentclass[a4paper,12pt]{article}
\usepackage[spanish]{babel}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{chemmacros}
\chemsetup{modules=all}
\chemsetup{formula=chemformula}
\let\chold\ch
\renewcommand\ch[1]{%
\catcode`<=12
\catcode`>=12
\chold{#1}%
\catcode`<=\active
\catcode`>=\active
}
\begin{document}
<<Test>>
\ch{glucosa_{(s)} <=> glucosa_{(aq)}}
<<Test>>
\end{document}
替代方案(Troy 在评论中提到):
\documentclass[a4paper,12pt]{article}
\usepackage[spanish,es-noquoting]{babel}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{chemmacros}
\chemsetup{modules=all}
\chemsetup{formula=chemformula}
\begin{document}
<<Test>>
\ch{glucosa_{(s)} <=> glucosa_{(aq)}}
<<Test>>
\end{document}