BcBob wrote: > > Matlab has a feature called publish to latex that runs code and packages > the code and the output into a latex file. I would like to use it to put > examples into my book but I am having trouble importing the latex code > into Lyx. > > The problem is that comments get mangled in with code during the import > into Lyx. The latex code works fine; I am able to create a dvi file from > it that is OK. > > I am including an example of the latex code and the Lyx file created by > importing it. > > Any ideas of how to fix/workaround? >
After fooling around with this for a day, I worked out the following approach: 1. filter the latex code with a gawk program to set the margins to zero and to get rid of page numbers 2. process the latex code to create a dvi 3. use dvips to create an eps dvips -E -o name.eps name.dvi 4. insert the eps into the Lyx file 5. wrote a matlab function to carry out the steps of creating the eps Now, if I run the matlab function, the eps in the Lyx file will also update. Step #3 is brittle and will almost certainly fail if the dvi output has more than one page If anyone is interested, email me and I will share the scripts. Bob -- View this message in context: http://n2.nabble.com/Import-Latex-code-with-verbatim-tp2399787p2405559.html Sent from the LyX - Users mailing list archive at Nabble.com.