How can I write two sentences in the same line on each other?

I think it’s better to give you an picture example:

how can i do this in libreoffice?

You may use a frame anchored as character and formatted to your needs. The frame style may be reused. Under some aspects there will be a certain degree of tinkering needed.
ask70311FractionLikeTextInLine001.odt

Hi

LibreOffice has a feature for this:

  • Check ToolsOptionsLanguage SettingsLanguagesDefault Languages for Documents: Asian
  • Type the concerned text (e.g. 1234), select it
  • FormatAsian phonetic guide▸type abcd in the Ruby text column▸Close

By default, the Rubies character style applies to Ruby text. You can adapt it to your presentation needs.

In the attached example I added the underlined and increased the font size. I also created the RubiesBase characters style to apply the same font size to the 1234 text.

Regards