Skip to content

Instantly share code, notes, and snippets.

@doraTeX
Created May 3, 2017 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doraTeX/19c482287e80cc018a564b7914d4792f to your computer and use it in GitHub Desktop.
Save doraTeX/19c482287e80cc018a564b7914d4792f to your computer and use it in GitHub Desktop.
chemfig の原子出力にヒラギノ従属欧文を使う例 (LuaLaTeX)
%! lualatex
\documentclass{ltjsarticle}
\usepackage{chemfig}
\usepackage[hiragino-pron]{luatexja-preset}
\usepackage{unicode-math}
\setmathfontface\chemrm{HiraginoSans-W3.ttc} %% ヒラギノ角ゴシック W3 で数式の文字を出す命令 \chemrm を定義
\def\printatom#1{\ensuremath{\chemrm{#1}}} %% chemfig の原子出力命令を \chemrm に変更
\begin{document}
日本語:ほげほげ
化学式:\chemfig{CH_3-CH(-[2]CH_3)-CH_2-C(=[:60]O)-[:-60]O-H}
数式:$f(x)=x^2-x+1>0$
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment