Welcome to mobileread ....
Have you had a look in
The Workshop ...
Your source file for an ebook would be best in html (which you should be familiar with !
) ... from there you have a number of choices, Sigil and Calibre being just two .....
What's your
final format expected to be ?