path.expand
on all platforms. On Windows,
transform it to a short path name if it contains spaces, and then convert
forward slashes to back slashes (as required by pandoc for some path
references)
pandoc_path_arg(path, backslash = TRUE)
path
with
backslashes on Windows