
私は、bbm (好みのスタイルのインジケーター変数を記述するため) と hyperref パッケージ (Web URL を参照するため) の両方を使用しようとしています。
しかし、サブセクションのタイトルに bbm を使用すると、何か奇妙なことが起きているようです。何が起こっているのか、何かお分かりですか? 簡単な例:
\documentclass[12pt,titlepage]{article}
\usepackage{bbm}
\usepackage{hyperref}
\begin{document}
\subsection{Model: Logistic Regression of $\mathbbm{1}\left[var\right]$}
\href{http://www.google.com}{This} is a hyperlink, and
this\footnote{footnote} is a footnote.
$\mathbbm{1}\left[x\in S\right]$ is an indicator in plain text
\end{document}
実際のところ、数式自体は、本文テキストと同様に、問題なく PDF にコンパイルされます。
ただし、ドキュメントのどこかに赤いボックスが表示される傾向があります (.pdf のどこかをクリックすると消えます)。さらに、私のコンパイラ (latexmk で動作する Linux 上の SublimeText 3 の LaTeXTools プラグインを使用しています) では、次の警告メッセージが表示されますが、これをどう解釈すればよいのかわかりません。
./test.tex:8: Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `math shift' on input line 8.
./test.tex:8: Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `\left' on input line 8.
./test.tex:8: Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `\right' on input line 8.
./test.tex:8: Package hyperref Warning: Token not allowed in a PDF string (PDFDocEncoding):(hyperref) removing `math shift' on input line 8.
mathbbm
タイトルからインスタンスを除外するとsubsection
、ランダムな赤いボックスは引き続き表示されますが、警告は停止します。
答え1
のUnicode相当は\mathbb{1}
文字 であり1D7D9
、これを に挿入するに\texorpdfstring
は\unicode{"1D7D9}
\documentclass[12pt,titlepage]{article}
\usepackage[utf8]{inputenc}
\usepackage{bbm}
\usepackage[pdfencoding=auto,unicode=true]{hyperref}
\begin{document}
\subsection{Model: Logistic Regression of \texorpdfstring{$\mathbbm{1}}{\unichar{"1D7D9}}\left[var\right]$}
\href{http://www.google.com}{This} is a hyperlink, and
this\footnote{footnote} is a footnote.
$\mathbbm{1}\left[x\in S\right]$ is an indicator in plain text
\end{document}
文字とそのコードの視覚的なリストは、例えば以下から入手できます。 http://en.wikipedia.org/wiki/数学的英数字記号