2

I want to remove the spaces between the "and" and the if clauses in the following code:

  \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}

enter image description here

6
  • Please show us not only a piece of code, but a/some compilable minimal working example(s) reproducing your problems.
    – user156344
    Dec 24, 2018 at 14:39
  • my code is compilable I have tried it Dec 24, 2018 at 14:45
  • I mean that the code you show here is compilable, i.e. it has a document class, and begin with \begin{document} and end with \end{document} and also states the packages you used. Read more here.
    – user156344
    Dec 24, 2018 at 14:47
  • i have changed it Dec 24, 2018 at 15:04
  • i've removed the align tag, which is specific to the align environment in amsmath and replaced it by horizontal-alignment which covers the text situation described here. Dec 25, 2018 at 0:56

1 Answer 1

3

It's essentially impossible to typeset that piece of text in two-column mode, because of the very long identifiers.

I suggest to use algorithm* for typesetting it in single-column format and to use \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}

enter image description here

Modifying the code to have algorithm instead of algorithm* you get overfull boxes because some of the identifiers simply cannot fit a line.

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .