Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am programmatically creating LaTeX documents. Now, what I wish to do is to have a table in which a file path wraps. I expected I'd be able to do this by defining that column of the table as a paragraph.

The issue is that LaTeX can't work out where to text wrap. Given the text

/Users/me/documents/long/long/long/path

there are no spaces, so it just overlaps, with irritating consequences.

My first solution was just to insert a new line every 30 characters in my Java (ugly but does the job). The issue appears in full when you try to print Windows paths, since there are the backslashes, and escaping them is a massive pain in the neck.

So, is there a package that will make file paths wrap easily? This is a massive pain for me, and since I have been working on this for what seems like a horrible amount of time.

share|improve this question

closed as too localized by Matthew Leingang, Werner, Marco Daniel, Stefan Kottwitz Apr 28 '12 at 6:08

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. –  Matthew Leingang Apr 18 '12 at 18:19
    
Are you using tt font for the path? I think How to get long \texttt sections to break might be the solution. In short: use the \path macro from the url package. Please confirm if this solves your problem, so we can close this as a duplicate question (no problem). Thanks. –  Martin Scharrer Apr 18 '12 at 18:26

Browse other questions tagged or ask your own question.