我想删除以下代码中“and”和 if 子句之间的空格:
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{algorithm}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{xcolor}
\usepackage{multirow}
\setlength{\textfloatsep}{0.1cm}
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\begin{document}
\begin{algorithm}
\caption{Technique}
\begin{algorithmic}
\begin{algorithm}
\caption{SurroundednessPattern}
\FORALL{methodTrace in methodTraceList}
\IF {$!$methodtrace.Method.Callees.isEmpty() \AND
$!$methodtrace.Method.Callers.isEmpty()
\AND methodtrace.Method.Callees.AllTs(methodtrace.Requirement)
\AND methodtrace.Method.Callers.AllTs(methodtrace.Requirement)
} \STATE methodTrace.Prediction=T
\ELSIF {$!$methodtrace.Method.Callees.isEmpty() \AND
$!$methodtrace.Method.Callers.isEmpty()
\AND methodtrace.Method.Callees.AllNs(methodtrace.Requirement)
\AND methodtrace.Method.Callers.AllNs(methodtrace.Requirement)
} \STATE methodTrace.Prediction=N
\ENDIF
\IF {methodtrace.Method.Callees.isEmpty() \AND
$!$methodtrace.Method.Callers.isEmpty()
\AND methodtrace.Method.Callees.AllTs(methodtrace.Requirement)
\AND methodtrace.Method.Callers.AllTs(methodtrace.Requirement)
} \STATE methodTrace.Prediction=T
\ELSIF {methodtrace.Method.Callees.isEmpty() \AND
$!$methodtrace.Method.Callers.isEmpty()
\AND methodtrace.Method.Callees.AllNs(methodtrace.Requirement)
\AND methodtrace.Method.Callers.AllNs(methodtrace.Requirement)
} \STATE methodTrace.Prediction=N
\ENDIF
\ENDFOR
\FORALL{methodTrace in methodTraceList}
\IF {$!$methodtrace.Method.Callees.isEmpty() \AND
$!$methodtrace.Method.Callers.isEmpty()
\AND methodtrace.Method.Callees.AtLeast1T(methodtrace.Requirement)
\AND methodtrace.Method.Callers.AtLeast1T(methodtrace.Requirement)
} \STATE methodTrace.Prediction=T
\ELSIF {$!$methodtrace.Method.Callees.isEmpty() \AND
$!$methodtrace.Method.Callers.isEmpty()
\AND (!methodtrace.Method.Callees.AllNs(methodtrace.Requirement)
\OR !methodtrace.Method.Callers.AllNs(methodtrace.Requirement))
} \STATE methodTrace.Prediction=N
\ENDIF
\IF {methodtrace.Method.Callees.isEmpty() \AND
$!$methodtrace.Method.Callers.isEmpty()
\AND methodtrace.Method.Callers.AtLeast1T(methodtrace.Requirement)
} \STATE methodTrace.Prediction=T
\ENDIF
\ENDFOR
\end{algorithmic}
\end{algorithm}
\end{document}
答案1
由于标识符太长,因此基本上不可能以双列模式排版该段文本。
我建议使用algorithm*
单列格式进行排版并使用\raggedright
。
\documentclass[conference]{IEEEtran}
\IEEEoverridecommandlockouts
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{algorithm}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{xcolor}
\usepackage{multirow}
\setlength{\textfloatsep}{0.1cm}
\begin{document}
\begin{algorithm*}
\caption{SurroundednessPattern}
\begin{algorithmic}[1]
\raggedright
\FORALL{methodTrace in methodTraceList}
\IF {$!$methodtrace.Method.Callees.isEmpty() \AND
$!$methodtrace.Method.Callers.isEmpty()
\AND methodtrace.Method.Callees.AllTs(methodtrace.Requirement)
\AND methodtrace.Method.Callers.AllTs(methodtrace.Requirement)
} \STATE methodTrace.Prediction=T
\ENDIF
\IF {methodtrace.Method.Callees.isEmpty() \AND
$!$methodtrace.Method.Callers.isEmpty()
\AND methodtrace.Method.Callees.AllTs(methodtrace.Requirement)
\AND methodtrace.Method.Callers.AllTs(methodtrace.Requirement)
} \STATE methodTrace.Prediction=T
\ELSIF {methodtrace.Method.Callees.isEmpty() \AND
$!$methodtrace.Method.Callers.isEmpty()
\AND methodtrace.Method.Callees.AllNs(methodtrace.Requirement)
\AND methodtrace.Method.Callers.AllNs(methodtrace.Requirement)
} \STATE methodTrace.Prediction=N
\ENDIF
\ENDFOR
\FORALL{methodTrace in methodTraceList}
\IF {$!$methodtrace.Method.Callees.isEmpty() \AND
$!$methodtrace.Method.Callers.isEmpty()
\AND methodtrace.Method.Callees.AtLeast1T(methodtrace.Requirement)
\AND methodtrace.Method.Callers.AtLeast1T(methodtrace.Requirement)
} \STATE methodTrace.Prediction=T
\ELSIF {$!$methodtrace.Method.Callees.isEmpty() \AND
$!$methodtrace.Method.Callers.isEmpty()
\AND (!methodtrace.Method.Callees.AllNs(methodtrace.Requirement)
\OR !methodtrace.Method.Callers.AllNs(methodtrace.Requirement))
} \STATE methodTrace.Prediction=N
\ENDIF
\IF {methodtrace.Method.Callees.isEmpty() \AND
$!$methodtrace.Method.Callers.isEmpty()
\AND methodtrace.Method.Callers.AtLeast1T(methodtrace.Requirement)
} \STATE methodTrace.Prediction=T
\ENDIF
\ENDFOR
\end{algorithmic}
\end{algorithm*}
\end{document}
修改代码以algorithm
避免algorithm*
出现溢出的框,因为某些标识符根本无法容纳一行。