# How to convert source code from LaTeX to LyX?

I have difficulties to make a document in LyX. I have create my document in TexMaker (LaTeX) and I want to put this codes in LyX editor and see the result as a PDF or DVI. but it seem some errors while the compilation in LyX. The package is already complete. No missing package. Any suggestions?

-
Which errors are you getting? – Martin Scharrer Apr 26 '11 at 9:39
There are a lot of snafus in converting Latex to Lyx: seeing the whole document would be helpful. – Charles Stewart Apr 26 '11 at 10:11
but when I try to compile at TeXMaker there is an error "! LaTeX Error: Cannot determine size of graphic in pics/logo.png (no BoundingBo x). but the result .PDF appear and I see my result is beautiful PDF document (hehe :p) when I try to compile it in Lyx the .PDF documen doesn't appear and I got the erros thanks for your help sir with please ^-^, this is for my graduation – Verly Apr 29 '11 at 16:57

Correct me if I'm wrong, but it seems you just want to get a PDF for your LaTeX document. If so, I would skip LyX altogether and just use pdflatex. As Charles pointed out, converting from LaTeX to LyX is tricky under the best circumstances. You seem to have a fairly complicated document, so I'm not surprised that this failed. What is your motivation for moving to LyX?

If you really want to convert to LyX, try removing the child documents before the conversion, and adding the \include tex afterwards from within Lyx. Can you give us more info about the actual error?

-
my motivation for moving to Lyx is I would like to give my document template to my friends (all of my friens at my campus) to help theiy to write their final task. but they're unable to use LaTeX with MikTeX, they need GUI based editor tex. I think LyX is the best choise. – Verly Apr 30 '11 at 2:55
I get an error when I try to insert this code : \renewcommand\section{\@startsection {section}{1}{\z@}% {-3.5ex \@plus -1ex \@minus -.2ex}% {2.3ex \@plus.2ex}% {\large\bfseries}} – Verly May 1 '11 at 6:41
I use this this for insert child document (I put it in my .sty): \newcommand{\addChapter}[1]{\phantomsection \addcontentsline{toc}{chapter}{#1}} , and I insert this one in the child document : \chapter*{chapterName} and for main document I insert : \addChapter{\chapterName). all of this is running well in TeXMaker. but doesn't work in Lyx – Verly May 1 '11 at 6:47