TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The algorithmic sample code that I am using is something like this:

\caption{Caption Here‎.} \label{alg:Name}  ‎‎   
‎\end{algorithmic}     ‎

How can I customize the algorithmic output? for example, when I just entered the \REQUIRE it give me the Setup keyword. BTW, I don't want the numbering along each line, may be I just should not use this package at all :D.

I tried to bypass using such package with some \hrule and \rule defined above and below the text like this:

Some text goes here for cation of the algorithm  

But the text and everything in between goes to the outside of page margin. I just used the code


‎‎‎‎‎ instead of the second \rule but still not satisfied with the output, esp. the thickness of the \hrule.

alt text

Please ignore the Persian writings, I want the headline of my algorithm like that without using algorithmic, or using algorithmic package and customized texts for '\ENSURE' and '\REQUIRE'.

Edit (New Question): How can I have the same output using ordinary lines? In other words, how can I define the thickness of two consecutive lines such that the text in-between does not fall outside of the page margin?

share|improve this question
I'm not sure what your question is. I guess you want to use rules in some way that is similar in appearance to algorithmic but vastly different in function. You should describe your end goal. – TH. Dec 4 '10 at 9:32
The first question is answered, but it seems that it could be easier to get the same output if any body can answer the second question. – Yasser Sobhdel Dec 4 '10 at 12:38

The (redefinable) definitions of the algorithms package are listed on p. 13 of the documentation. Example:


If you want to change the effects of \REQUIRE to, say, Whatever: (typeset in italic), add the following to the preamble of your document:

share|improve this answer
up vote 0 down vote accepted

The Answer to the second question can be found at:

I copy and paste the answer:



Hello world
     \begin{question}Item one\end{question}
     \begin{question}Item two\end{question}
     \begin{question}Item three\end{question}

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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