Sogou IME (on Ubuntu): How to output pinyin with tone marks?
I struggled for many months to work out how produce Pinyin with the tone marks.  Eventually I managed it by installing the Ubuntu ibus (Intelligent Input Bus - core) currently using version 1.5.11.  I also have ibus-pinyin installed but to get the Latin alphabet with the tone marks including ǖ ǘ ǚ ǜ as well as the normal ū ú ǔ ù and of course all the other vowels just by typing the tone number you also need to install ibus-m17n .  This has the input method Chinese Hanyu Pinyin(m17n) as just described and also tonepy(m17n) which gives you a nice trimmed down list of the simplified Chinese characters filtered by the tone number you type when you want to type the characters instead of the Pinyin.  Probably too late for the original questioner but this information is so difficult to find on-line I thought it was worth adding for future reference.