Amir Rachum wrote:
I haven't a clue about LaTeX itself. Can you explain what I need to do
with this code?
And also I want it to take effect only in the algorithm float, not the
rest of the document.
Put it into ERT (Insert>TeX Code) at the very beginning of the algorithm
float, and then you can just use the enumerate environment. Because such
redeclarations are local to an environment, you won't have
Actually, you're going to have the wrong sort of indentation doing it
that way. So you will need to adjust that. Adding something like
\setlength\leftmargin{0pt}
might do it, but you'll have to play with other list settings to get it
just right, I think. See here:
http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/ltx-260.html
for details on other lengths you can change. Maybe you could try
something like:
\setlength\labelsep{???}
to restore indentation, but I'm not sure what to put in there.
Sorry this is so complicated, but when you want to get automatic
numbering of a special kind, then you're basically programming.
Alternatively, you might be able to use the program listing environment
to do what you want. You can Insert>Program Listing in your algorithm
float, and then see if listings provides for customization of line
numbers. The docs are here:
http://www.ctan.org/tex-archive/macros/latex/contrib/listings/listings.pdf
I'm not myself familiar with listings, though.
rh
Thanks,
- Amir Rachum
On Fri, Jun 5, 2009 at 6:38 PM, rgheck <[email protected]
<mailto:[email protected]>> wrote:
Amir Rachum wrote:
yes.
Well, the first question then is how to do it in LaTeX, and to do
that you need to produce some sort of list, I'd guess.
Alternatively, you could just use the enumeration environment and
change the numbering format. This will give you the correct LaTeX
output, though it won't show properly on the screen. Something
like this will do the trick:
\renewcommand\labelenumi{(\arabic{enumi})}
\renewcommand\labelenumii{(\arabic{enumi}.\arabic{enumii})}
\renewcommand\labelenumiii{(\arabic{enumi}.\arabic{enumii}.\arabic{enumiii})}
I'll leave yo to do \labelenumiv.
rh
Thanks,
- Amir Rachum
On Fri, Jun 5, 2009 at 4:44 PM, rgheck <[email protected]
<mailto:[email protected]> <mailto:[email protected]
<mailto:[email protected]>>> wrote:
Amir Rachum wrote:
Hi guys,
I'm trying to write some algorithms in LyX 1.6.1 under XP.
I want to write pseudo code that will number my lines
like so:
(1) bla
(2) bla
(2.1) bla
(2.2) bla
(2.3.1) again
etc.
Is there any way to do this? I have no idea how to use
packages and haven't
found an easy way to achieve this. I am willing to try
though,
so if you can
post step by step instuctions I would appreciate it.
I'm not sure I understand. Do you want the lines to be
automatically numbered in this way?
rh