2

I am using the \usepackage{pseudocode} in this code

 \documentclass{article}
 \textwidth=4.5in
 \textheight=7.125in
 \usepackage{pseudocode}
 \begin{document}
 \renewcommand{\thepseudocode}{}
 \begin{pseudocode}{m3partition}{a, i, j}
 \CALL {swap}{a[(i+j)/2] , a[j-1]} \\
 \IF a[i] > a[j-1] \  \CALL {swap} {a[i], a[j-1]} \\
 \IF a[i] > a[j] \  \CALL {swap} { a[i], a[j]} \\
 \IF a[j-1] > a[j]  \  \CALL {swap} {a[j-1], a[j]} \\
 \CALL {partition}{a, i+1, j-1}\\
 \end{pseudocode}   
 \end{document}

enter image description here

and when it renders it will have the Algorithm label which I want to remove, is there anyway to achieve this?

4
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Commented Apr 23, 2014 at 11:35
  • @ChristianHupfer this is the full code i have used Commented Apr 23, 2014 at 11:44
  • If you have tested you code and it produces the output above, it is quite ok. Commented Apr 23, 2014 at 11:47
  • I did and the output is as seen in the above picture Commented Apr 23, 2014 at 11:52

1 Answer 1

3
+300

The Algorithm string is hard coded in the pseudocode.sty file.

You can use the \xpatchcmd macro from the xpatch package to remove the respective part from the pseudocode environment. You must replace the string twice, because the second occurrence is the one you want to remove:

\documentclass{standalone}
\usepackage{pseudocode}
\usepackage{xpatch}
\xpatchcmd{\pseudocode}{\bfseries Algorithm \thepseudocode:}{}{}{}
\xpatchcmd{\pseudocode}{\bfseries Algorithm \thepseudocode:}{}{}{}
\begin{document}
\begin{pseudocode}{m3partition}{a, i, j}
\CALL {swap}{a[(i+j)/2] , a[j-1]} \\
\IF a[i] > a[j-1] \  \CALL {swap} {a[i], a[j-1]} \\
\IF a[i] > a[j] \  \CALL {swap} { a[i], a[j]} \\
\IF a[j-1] > a[j]  \  \CALL {swap} {a[j-1], a[j]} \\
\CALL {partition}{a, i+1, j-1}\\
\end{pseudocode}
\end{document}

enter image description here

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.