Lumir wrote:

> I am using Docbook. I already figure out how to do this. I forgot to manually 
> add <colspec> and set the column width manually. In case that I don't set the 
> <colspec> for every column, I got the result as you can see in attached 
> broken_table image. That's in case that I have text that's not easily wrapped 
> (long text server.customer1.com in my case). With <colspec> it's OK.
>
> Is there better solution in cases?

Widening the column will help you in some cases. But if your text contains 
*very* long URLs or file paths - or any kind of very long spaceless string - it 
won't be enough (and it will squeeze the other columns). In those cases, you 
can insert spaces, zero-width spaces and/or hyphens in the string.

In individual cases, you can do this in the DocBook source, but this approach 
has two drawbacks:

1) You invalidate the source string. This may or may not be a problem, but it's 
never "nice", especially if you later reformat the table and your inserted 
spaces and/or hyphens wind up in the wrong places.

2) You have to do this separately every time your text contains an overly long 
spaceless string.

So, if you encounter this problem more often, it's better to use a general 
solution. Create custom XSLT templates for <ulink>, <filename> etc., that 
insert ZWSP characters (&#x200B;) at appropriate (or at least not too 
inappropriate) places in the string, e.g. after slashes, before ampersands, and 
so on. This leaves the source string intact and only affects the generated .fo 
file (and therefore the PDF).

This solution has the additional advantage that it also works outside of 
tables, so it will format normal paragraphs with long URLs more nicely as well.

Of course, it requires you to wrap these strings in the appropriate DocBook XML 
elements, but that's good practice anyway!

It also requires some familiarity with XSLT, and several hours of work.


Kind regards,
Paul Vinkenoog

--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to