One way—like this—is to use em dashes without surrounding spaces, to denote a pause.
The other way – like this – is to use en dashes with surrounding spaces. This functions like an em dash, but is technically an en dash. The linked article has dashes like this throughout. (Then you still use an en dash for numbers like 11–13, but without the spaces.)
It's just two different typographical conventions.
Edit: to be clear, these are both still different from hyphens. In typesetting, don't ever do this-or this - as hyphens are for, well, hyphenation.
What most people think of as a hyphen (the key at the top-right of the keyboard) is actually a hyphen-minus (-, U+002D). Unicode has separate hyphen (‐, U+2010) and minus (−, U+2212) symbols, as well as a couple of others.
(If you want negative numbers to look right at small font sizes use a minus sign instead of hyphen-minus.)
This is the way that I’ve been writing for years, mainly because I was too lazy to use the key or shortcut for em dash. But also because in school no one ever made a big deal about the length of the dash when writing - or I just wasn’t paying enough attention.
Actually you can, and it's relatively common.
One way—like this—is to use em dashes without surrounding spaces, to denote a pause.
The other way – like this – is to use en dashes with surrounding spaces. This functions like an em dash, but is technically an en dash. The linked article has dashes like this throughout. (Then you still use an en dash for numbers like 11–13, but without the spaces.)
It's just two different typographical conventions.
Edit: to be clear, these are both still different from hyphens. In typesetting, don't ever do this-or this - as hyphens are for, well, hyphenation.