I would like to properly typeset a file path, e.g.
C:\Program Files\Some program\bin\executable.exe
The first problem I encountered was that LaTeX tries to treat \Program
as a command. I tried escaping it with another backslash which created a linebreak.
Then I found this package menukeys but I am not really happy because it typesets system-specific delimiters (i.e. \
for Windows and /
for Unix-like) as some weird arrows.
Which leads to my question: what is the preferred way of typesetting a file path in LaTeX?
Best Answer
You could load the package
url
with the optionobeyspaces
and encase the fully qualified file name in a\url
instruction:Addendum: If you need or wish to allow line breaks at the spaces, choose the
spaces
option as well: