
我正在嘗試用乳膠以簡單的列表格式編寫演算法。
在第一點中,我需要一個「alpha」符號,後面跟著一個下標「out」。
這就是我所做的,但它似乎不喜歡它,並拋出幾個錯誤並給出奇怪的輸出。
\begin{document}
\section{Algorithm}
\begin{footnotesize}
\begin{itemize}[noitemsep]
\item A maximum probability \textalpha _{out} for removal is pre-specified,
\item Step 2...,
\item Step 3...,
\item Step 4...,
\end{itemize}
\end{footnotesize}
\end{document}
在發布此內容之前,我還嘗試了{textgreek}
所描述的包這裡,但這似乎也不起作用。我一定做錯了什麼。
是否有一個簡單的解決方案來實現包含特殊字元的清單?
提前致謝。
答案1
對於 alpha 為什麼不直接使用$\alpha_{out}$
, or $\alpha_{\mbox{out}}$
or $\alpha_{\text{out}}$
or...
答案2
textgreek
如果您安裝了此軟體包的更新安裝,則可以在文字模式下使用希臘字母。其他選項用於inputenc
使用 unicode 字元甚至babel
.另請參閱包upgreek
和textgreek
。對於下標,您可以\textsubscript
按註釋使用,使用fixltx2e
或 a\raisebox
而不使用其他包,或者在數學模式下_{\text{}}
使用amsmath
包,如 Werner 所說,或_{\textrm{}}
使用amstext
包。例子:
\documentclass{article}
\usepackage[greek,english]{babel} % for 1st solution, no math mode
\usepackage[utf8]{inputenc} % for 2nd solution, no math mode
\usepackage{fixltx2e, textgreek} % for 3rd solution, no math mode
\usepackage{amstext,upgreek} % for 4th solution, math mode
\usepackage{amstext,txfonts} % for 5th solution, "fake" text mode
\def\alphaout{\ensuremath\alphaup\raisebox{-.3ex}{\scriptsize out}}
\begin{document}
{\greektext a}\raisebox{-.3ex}{\scriptsize out}
α\raisebox{-.3ex}{\scriptsize out}
\textalpha\textsubscript{out}
$\upalpha_{\textrm{out}}$
\alphaout
\end{document}