Display Pseudocode-Algorithms in Lyx
Is there a nice way to display Algorithms in Pseudocode-Algorithms in Lyx? Perhaps like in here: http://bit.ly/belSIj It would be great if something like Input: and Output: were implemented... Regards, iustifico
Re: Display Pseudocode-Algorithms in Lyx
On 10/14/2010 01:19 PM, iustifico wrote: Is there a nice way to display Algorithms in Pseudocode-Algorithms in Lyx? Perhaps like in here: http://bit.ly/belSIj It would be great if something like Input: and Output: were implemented... LyX supports the listings package, so I'd look into that. rh
Re: Display Pseudocode-Algorithms in Lyx
Am 14.10.2010 19:19, schrieb iustifico: Is there a nice way to display Algorithms in Pseudocode-Algorithms in Lyx? Yes, see chap. 7 Program Code Listings of the EmbeddedObjects manual that you find in LyX's help menu. regards Uwe
Re: Display Pseudocode-Algorithms in Lyx
Thank you, that is exactly what I am looking for. I see, that it is also possible to chose a language and lyx highlightens the keywords. That is nice! But I only want to write Pseudecode. Which of these available languages suits for that? Another question: Is it possible to write mathsymbols into this environment? CMD-M (MacOSX) doesn't seem to work... Regards, iustifico 2010/10/14 Uwe Stöhr uwesto...@web.de Am 14.10.2010 19:19, schrieb iustifico: Is there a nice way to display Algorithms in Pseudocode-Algorithms in Lyx? Yes, see chap. 7 Program Code Listings of the EmbeddedObjects manual that you find in LyX's help menu. regards Uwe
Re: Display Pseudocode-Algorithms in Lyx
iustifico iustifico at gmail.com writes: Thank you, that is exactly what I am looking for. I see, that it is also possible to chose a language and lyx highlightens the keywords. That is nice! But I only want to write Pseudecode. Which of these available languages suits for that? It depends on whether you want keywords (such as if or for) highlighted by a special font. If no, then you can leave the language box at no language selected. If yes, you want to look for a language that considers the keywords in your pseudocode to be reserved words. You might try Python or maybe sh to start. I typically use no language or else experiment. Another question: Is it possible to write mathsymbols into this environment? CMD-M (MacOSX) doesn't seem to work... Go to the advanced tab of the listing settings dialog and put mathescape=true in the right side pane. You will need to enter the math in raw LaTeX, not using the math editor. A trick I use is to use the math editor to type the math in a math inset, then copy it and paste it into the listings box. (I still have to supply the dollar signs myself.) /Paul
Re: Display Pseudocode-Algorithms in Lyx
Am 14.10.2010 21:09, schrieb iustifico: But I only want to write Pseudecode. Which of these available languages suits for that? This depend on the keywords that listings should recognize. Personally, I use Pascal for writing pseudocode. Another question: Is it possible to write mathsymbols into this environment? CMD-M (MacOSX) doesn't seem to work... This is possible, see the attached LyX file: - set the option mathescape = true for the listing - create the formula outside of the listing - copy the content of the formula (not the formula inset) to the clipboard via Ctrl-c - in the listing write $$ and paste between the dollar signs via Ctrl-v I'll add this info to the manual for LyX 1.6.8. regards Uwe ListingsMath.lyx Description: application/lyx
Display Pseudocode-Algorithms in Lyx
Is there a nice way to display Algorithms in Pseudocode-Algorithms in Lyx? Perhaps like in here: http://bit.ly/belSIj It would be great if something like Input: and Output: were implemented... Regards, iustifico
Re: Display Pseudocode-Algorithms in Lyx
On 10/14/2010 01:19 PM, iustifico wrote: Is there a nice way to display Algorithms in Pseudocode-Algorithms in Lyx? Perhaps like in here: http://bit.ly/belSIj It would be great if something like Input: and Output: were implemented... LyX supports the listings package, so I'd look into that. rh
Re: Display Pseudocode-Algorithms in Lyx
Am 14.10.2010 19:19, schrieb iustifico: Is there a nice way to display Algorithms in Pseudocode-Algorithms in Lyx? Yes, see chap. 7 Program Code Listings of the EmbeddedObjects manual that you find in LyX's help menu. regards Uwe
Re: Display Pseudocode-Algorithms in Lyx
Thank you, that is exactly what I am looking for. I see, that it is also possible to chose a language and lyx highlightens the keywords. That is nice! But I only want to write Pseudecode. Which of these available languages suits for that? Another question: Is it possible to write mathsymbols into this environment? CMD-M (MacOSX) doesn't seem to work... Regards, iustifico 2010/10/14 Uwe Stöhr uwesto...@web.de Am 14.10.2010 19:19, schrieb iustifico: Is there a nice way to display Algorithms in Pseudocode-Algorithms in Lyx? Yes, see chap. 7 Program Code Listings of the EmbeddedObjects manual that you find in LyX's help menu. regards Uwe
Re: Display Pseudocode-Algorithms in Lyx
iustifico iustifico at gmail.com writes: Thank you, that is exactly what I am looking for. I see, that it is also possible to chose a language and lyx highlightens the keywords. That is nice! But I only want to write Pseudecode. Which of these available languages suits for that? It depends on whether you want keywords (such as if or for) highlighted by a special font. If no, then you can leave the language box at no language selected. If yes, you want to look for a language that considers the keywords in your pseudocode to be reserved words. You might try Python or maybe sh to start. I typically use no language or else experiment. Another question: Is it possible to write mathsymbols into this environment? CMD-M (MacOSX) doesn't seem to work... Go to the advanced tab of the listing settings dialog and put mathescape=true in the right side pane. You will need to enter the math in raw LaTeX, not using the math editor. A trick I use is to use the math editor to type the math in a math inset, then copy it and paste it into the listings box. (I still have to supply the dollar signs myself.) /Paul
Re: Display Pseudocode-Algorithms in Lyx
Am 14.10.2010 21:09, schrieb iustifico: But I only want to write Pseudecode. Which of these available languages suits for that? This depend on the keywords that listings should recognize. Personally, I use Pascal for writing pseudocode. Another question: Is it possible to write mathsymbols into this environment? CMD-M (MacOSX) doesn't seem to work... This is possible, see the attached LyX file: - set the option mathescape = true for the listing - create the formula outside of the listing - copy the content of the formula (not the formula inset) to the clipboard via Ctrl-c - in the listing write $$ and paste between the dollar signs via Ctrl-v I'll add this info to the manual for LyX 1.6.8. regards Uwe ListingsMath.lyx Description: application/lyx
Display Pseudocode-Algorithms in Lyx
Is there a nice way to display Algorithms in Pseudocode-Algorithms in Lyx? Perhaps like in here: http://bit.ly/belSIj It would be great if something like "Input:" and "Output:" were implemented... Regards, iustifico
Re: Display Pseudocode-Algorithms in Lyx
On 10/14/2010 01:19 PM, iustifico wrote: Is there a nice way to display Algorithms in Pseudocode-Algorithms in Lyx? Perhaps like in here: http://bit.ly/belSIj It would be great if something like "Input:" and "Output:" were implemented... LyX supports the listings package, so I'd look into that. rh
Re: Display Pseudocode-Algorithms in Lyx
Am 14.10.2010 19:19, schrieb iustifico: Is there a nice way to display Algorithms in Pseudocode-Algorithms in Lyx? Yes, see chap. 7 "Program Code Listings" of the EmbeddedObjects manual that you find in LyX's help menu. regards Uwe
Re: Display Pseudocode-Algorithms in Lyx
Thank you, that is exactly what I am looking for. I see, that it is also possible to chose a language and lyx highlightens the keywords. That is nice! But I only want to write Pseudecode. Which of these available languages suits for that? Another question: Is it possible to write mathsymbols into this environment? CMD-M (MacOSX) doesn't seem to work... Regards, iustifico 2010/10/14 Uwe Stöhr <uwesto...@web.de> > Am 14.10.2010 19:19, schrieb iustifico: > > > Is there a nice way to display Algorithms in Pseudocode-Algorithms in Lyx? >> > > Yes, see chap. 7 "Program Code Listings" of the EmbeddedObjects manual that > you find in LyX's help menu. > > regards Uwe >
Re: Display Pseudocode-Algorithms in Lyx
iustifico gmail.com> writes: > Thank you, that is exactly what I am looking for. I see, that it is also > possible to chose a language and lyx highlightens the keywords. That is nice! > > But I only want to write Pseudecode. Which of these available languages > suits for that? It depends on whether you want "keywords" (such as "if" or "for") highlighted by a special font. If no, then you can leave the language box at "no language selected". If yes, you want to look for a language that considers the keywords in your pseudocode to be reserved words. You might try Python or maybe sh to start. I typically use "no language" or else experiment. > > Another question: Is it possible to write mathsymbols into this environment? CMD-M (MacOSX) doesn't seem to work... Go to the advanced tab of the listing settings dialog and put mathescape=true in the right side pane. You will need to enter the math in raw LaTeX, not using the math editor. A trick I use is to use the math editor to type the math in a math inset, then copy it and paste it into the listings box. (I still have to supply the dollar signs myself.) /Paul
Re: Display Pseudocode-Algorithms in Lyx
Am 14.10.2010 21:09, schrieb iustifico: But I only want to write Pseudecode. Which of these available languages suits for that? This depend on the keywords that listings should recognize. Personally, I use Pascal for writing pseudocode. Another question: Is it possible to write mathsymbols into this environment? CMD-M (MacOSX) doesn't seem to work... This is possible, see the attached LyX file: - set the option mathescape = true for the listing - create the formula outside of the listing - copy the content of the formula (not the formula inset) to the clipboard via Ctrl-c - in the listing write $$ and paste between the dollar signs via Ctrl-v I'll add this info to the manual for LyX 1.6.8. regards Uwe ListingsMath.lyx Description: application/lyx
Algorithms in LyX
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. Thanks, - Amir Rachum
Re: Algorithms in LyX
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
Re: Algorithms in LyX
yes. Thanks, - Amir Rachum On Fri, Jun 5, 2009 at 4:44 PM, rgheck rgh...@bobjweil.com 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
Re: Algorithms in LyX
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 rgh...@bobjweil.com mailto:rgh...@bobjweil.com 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
Re: Algorithms in LyX
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. Thanks, - Amir Rachum On Fri, Jun 5, 2009 at 6:38 PM, rgheck rgh...@bobjweil.com 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 rgh...@bobjweil.com mailto: rgh...@bobjweil.com 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
Re: Algorithms in LyX
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 (InsertTeX 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 InsertProgram 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 rgh...@bobjweil.com mailto:rgh...@bobjweil.com 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 rgh...@bobjweil.com mailto:rgh...@bobjweil.com mailto:rgh...@bobjweil.com mailto:rgh...@bobjweil.com 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
Re: Algorithms in LyX
I would recommend to typeset them in LaTeX boxes (inside LyX) using: - algorithmic, see http://en.wikibooks.org/wiki/LaTeX/Algorithms_and_Pseudocode - clrscode, see http://www.cs.dartmouth.edu/~thc/clrscode/ I have some examples with clrscode, if you wish them ... -- Andrés
Re: Algorithms in LyX
Amir Rachum schrieb: 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 I guess the easies solution is to use a normal numbering, see attached. regards Uwe newfile1.lyx Description: application/lyx newfile1.pdf Description: Adobe PDF document
Re: Algorithms in LyX
This works great! Thanks, - Amir Rachum On Fri, Jun 5, 2009 at 8:42 PM, Uwe Stöhr uwesto...@web.de wrote: Amir Rachum schrieb: 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 I guess the easies solution is to use a normal numbering, see attached. regards Uwe
Algorithms in LyX
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. Thanks, - Amir Rachum
Re: Algorithms in LyX
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
Re: Algorithms in LyX
yes. Thanks, - Amir Rachum On Fri, Jun 5, 2009 at 4:44 PM, rgheck rgh...@bobjweil.com 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
Re: Algorithms in LyX
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 rgh...@bobjweil.com mailto:rgh...@bobjweil.com 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
Re: Algorithms in LyX
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. Thanks, - Amir Rachum On Fri, Jun 5, 2009 at 6:38 PM, rgheck rgh...@bobjweil.com 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 rgh...@bobjweil.com mailto: rgh...@bobjweil.com 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
Re: Algorithms in LyX
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 (InsertTeX 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 InsertProgram 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 rgh...@bobjweil.com mailto:rgh...@bobjweil.com 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 rgh...@bobjweil.com mailto:rgh...@bobjweil.com mailto:rgh...@bobjweil.com mailto:rgh...@bobjweil.com 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
Re: Algorithms in LyX
I would recommend to typeset them in LaTeX boxes (inside LyX) using: - algorithmic, see http://en.wikibooks.org/wiki/LaTeX/Algorithms_and_Pseudocode - clrscode, see http://www.cs.dartmouth.edu/~thc/clrscode/ I have some examples with clrscode, if you wish them ... -- Andrés
Re: Algorithms in LyX
Amir Rachum schrieb: 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 I guess the easies solution is to use a normal numbering, see attached. regards Uwe newfile1.lyx Description: application/lyx newfile1.pdf Description: Adobe PDF document
Re: Algorithms in LyX
This works great! Thanks, - Amir Rachum On Fri, Jun 5, 2009 at 8:42 PM, Uwe Stöhr uwesto...@web.de wrote: Amir Rachum schrieb: 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 I guess the easies solution is to use a normal numbering, see attached. regards Uwe
Algorithms in LyX
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. Thanks, - Amir Rachum
Re: Algorithms in LyX
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
Re: Algorithms in LyX
yes. Thanks, - Amir Rachum On Fri, Jun 5, 2009 at 4:44 PM, rgheck <rgh...@bobjweil.com> 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 > >
Re: Algorithms in LyX
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 <rgh...@bobjweil.com <mailto:rgh...@bobjweil.com>> 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
Re: Algorithms in LyX
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. Thanks, - Amir Rachum On Fri, Jun 5, 2009 at 6:38 PM, rgheck <rgh...@bobjweil.com> 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 <rgh...@bobjweil.com > rgh...@bobjweil.com>> 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 >> >> >> >
Re: Algorithms in LyX
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 <rgh...@bobjweil.com <mailto:rgh...@bobjweil.com>> 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 <rgh...@bobjweil.com <mailto:rgh...@bobjweil.com> <mailto:rgh...@bobjweil.com <mailto:rgh...@bobjweil.com>>> 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
Re: Algorithms in LyX
I would recommend to typeset them in LaTeX boxes (inside LyX) using: - algorithmic, see http://en.wikibooks.org/wiki/LaTeX/Algorithms_and_Pseudocode - clrscode, see http://www.cs.dartmouth.edu/~thc/clrscode/ I have some examples with clrscode, if you wish them ... -- Andrés
Re: Algorithms in LyX
Amir Rachum schrieb: 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 I guess the easies solution is to use a normal numbering, see attached. regards Uwe newfile1.lyx Description: application/lyx newfile1.pdf Description: Adobe PDF document
Re: Algorithms in LyX
This works great! Thanks, - Amir Rachum On Fri, Jun 5, 2009 at 8:42 PM, Uwe Stöhr <uwesto...@web.de> wrote: > Amir Rachum schrieb: > > 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 >> > > I guess the easies solution is to use a normal numbering, see attached. > > regards Uwe >