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

  • Please show us not only a piece of code, but a/some compilable minimal working example(s) reproducing your problems. – user156344 Dec 24 '18 at 14:39
  • my code is compilable I have tried it – user3406764 Dec 24 '18 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 '18 at 14:47
  • i have changed it – user3406764 Dec 24 '18 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. – barbara beeton Dec 25 '18 at 0:56
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.