I haver found a solution. save this code and put it as a makro in Libreoffice writer
`' Erase the "Sub" and "End sub" lines that appear in any new blank macro, and
' paste this macro there. If you leave the original "Sub" and "End sub" you will get
' an error when you try to run the macro. You can rename this macro if you wish.
'
' Pinyin Joe's Tone Mark Macro for Writer
' <<Whole document version>>
' Copyright (c) 2005, 2010, 2011, 2012 pinyinjoe.com
' www.pinyinjoe.com
'
' OOo/LibreOffice ver. released November 2012
' Win/Mac version 1.3, released November 2011
' Win/Mac Version 1.2, released August 2010
' Win/Mac Version 1.1, released September 2005
'
' Version 1.2: u-with-diaresis (umlaut) for German keyboards suggested
' by Shirish Pandit. Other users can continue to use the letter "v".
' The lines with u-with-diaresis are commented out to avoid problems
' when opening this file on Macs and certain other systems. If you need
' this letter, go to the last lines in this macro, make sure the ü is
' displaying OK or fix it if if it has turned into garbabe, then
' remove the apostrophes to the left of those lines
'
' Version 1.3: fixed problem in Word tables. Many thanks to Ervin Tóth for
' reporting!
'
' OpenOffice/LibreOffice StarBasic port by Carlos Frutos,
' https://www.elance.com/s/carlosfrutos/
' FOR TECHNICAL SUPPORT, CONTACT: http://www.pinyinjoe.com/contact.htm
'
Sub aWriterPinyinWholeDoc
' (1) Move number from end-of-word to after-vowels.
DoNotClickReplace("n1","1n")
DoNotClickReplace("n2","2n")
DoNotClickReplace("n3","3n")
DoNotClickReplace("n4","4n")
DoNotClickReplace("ng1","1ng")
DoNotClickReplace("ng2","2ng")
DoNotClickReplace("ng3","3ng")
DoNotClickReplace("ng4","4ng")
DoNotClickReplace("r1","1r")
DoNotClickReplace("r2","2r")
DoNotClickReplace("r3","3r")
DoNotClickReplace("r4","4r")
'
' (2) Move from after-all-vowels to syllable nucleus.
'
DoNotClickReplace("ai1", "a1i")
DoNotClickReplace("ai2", "a2i")
DoNotClickReplace("ai3", "a3i")
DoNotClickReplace("ai4", "a4i")
DoNotClickReplace("ao1", "a1o")
DoNotClickReplace("ao2", "a2o")
DoNotClickReplace("ao3", "a3o")
DoNotClickReplace("ao4", "a4o")
DoNotClickReplace("ei1", "e1i")
DoNotClickReplace("ei2", "e2i")
DoNotClickReplace("ei3", "e3i")
DoNotClickReplace("ei4", "e4i")
DoNotClickReplace("ou1", "o1u")
DoNotClickReplace("ou2", "o2u")
DoNotClickReplace("ou3", "o3u")
DoNotClickReplace("ou4", "o4u")
DoNotClickReplace("Ou1", "O1u")
DoNotClickReplace("Ou2", "O2u")
DoNotClickReplace("Ou3", "O3u")
DoNotClickReplace("Ou4", "O4u")
'
' (3) DoNotClickReplace letter-&-number with Unicode character.
'
DoNotClickReplace("a1", Chr(&H101))
DoNotClickReplace("a2", Chr(&HE1))
DoNotClickReplace("a3", Chr(&H1CE))
DoNotClickReplace("a4", Chr(&HE0))
DoNotClickReplace("e1", Chr(&H113))
DoNotClickReplace("e2", Chr(&HE9))
DoNotClickReplace("e3", Chr(&H11B))
DoNotClickReplace("e4", Chr(&HE8))
DoNotClickReplace("i1", Chr(&H12B))
DoNotClickReplace("i2", Chr(&HED))
DoNotClickReplace("i3", Chr(&H1D0))
DoNotClickReplace("i4", Chr(&HEC))
DoNotClickReplace("o1", Chr(&H14D))
DoNotClickReplace("o2", Chr(&HF3))
DoNotClickReplace("o3", Chr(&H1D2))
DoNotClickReplace("o4", Chr(&HF2))
DoNotClickReplace("u1", Chr(&H16B))
DoNotClickReplace("u2", Chr(&HFA))
DoNotClickReplace("u3", Chr(&H1D4))
DoNotClickReplace("u4", Chr(&HF9))
DoNotClickReplace("v1", Chr(&H1D6))
DoNotClickReplace("v2", Chr(&H1D8))
DoNotClickReplace("v3", Chr(&H1DA))
DoNotClickReplace("v4", Chr(&H1DC))
DoNotClickReplace("ü1", Chr(&H1D6))
DoNotClickReplace("ü2", Chr(&H1D8))
DoNotClickReplace("ü3", Chr(&H1DA))
DoNotClickReplace("ü4", Chr(&H1DC))
End Sub
Function DoNotClickReplace(Search As String, NewPart As String)
oDocument = ThisComponent
oReplace = oDocument.createReplaceDescriptor
oReplace.SearchString = Search
oReplace.ReplaceString = NewPart
oReplace.SearchRegularExpression=True
oDocument.ReplaceAll(oReplace)
End Function
`
Then write yout documents in pinyin with numbers. so 1 for first ton e second for secin ton, like this:
ni1
ni2
ni3
and soon. when you are finished run the macro and al is fine