As a tangent from my original task of finding out how to underline text when posting on Stack Exchange sites, I came across this answer. I've followed the same set of formatting conventions for a little more than a decade professionally speaking, but I can't recall whether I had arbitrarily established said convention or if I had referenced some formal standard somewhere. Is there a more suitable (or commonly adopted) format for this use case?
I cannot think of anything you would need to talk about here that would ever need something other than capitalization, italics, or quotation marks.
Documents are typically referenced by being set in roman under the normal casing rules of English titles: the Magna Carta, the Mayflower Compact, the Stamp Act, the Declaration of Independence, the Gettysburg Address, the Emancipation Proclamation, the Treaty of Guadalupe Hidalgo, the Treaty of Versailles, the Maastricht Treaty, the Paris Agreement.
However, a few documents such as papal bulls are set not in roman but in italic: Inter gravissimas, Pastor aeternus, Misericordiae vultus. Then again, those are also in Latin which might well be the cause of the italic use. Notice these use sentence case, not title case.
When it comes to titles of books, plays, long epic poems like Beowulf or The Iliad, films like Star Wars, television series, periodicals, and the like, these are all supposed to be set in italic under the capitalization rules for English titles. The only time you would underline these is when you are writing something out in longhand rather than mechanically, or when italic is not available to you.
Short works like short poems and individual sections of full works should be set in roman but placed in quotation marks. This includes names of chapters from a book or of a particular episode from a serial of some sort.
These are simply the normal typesetting conventions of English.
You virtually never see anything underlined when reading history books, novels, or newspaper articles. Underlining is mostly a handwriting thing, where people are not used to using two different hands to correspond to what we use roman and italic for when setting words in type.