URL 包含 # 導致錯誤

URL 包含 # 導致錯誤
\begin{frame}{Triphala Churn}
     \begin{enumerate}
     \item  Three fruits – Amalaki [Indian Gooseberry – Emblica officinalis], Haritaki [Myrobalan – Terminalia chebula], and Vibhatika [Belleric Myrobalan – Terminalia belerica]
    \item Laxative 
    \item result in allergic reaction including anaphylaxis 
     \end{enumerate}
     Ref: http://www.stylecraze.com/articles/harmful-side-effects-of-triphala-churna/#gref
    \end{frame}

我收到錯誤可能是因為#gref。解決辦法是什麼。我嘗試 $..$ 將其包含為數學符號。

答案1

url提供了\url,它可以處理特殊字元。fragile框架可能還需要選項:

\usepackage{url}% (shold be already loaded by `hyperref`, which is loaded by `beamer`)

\begin{frame}[fragile]
  ...
  \url{http://www.example.org/index.html#gref}
\end{frame}

相關內容