Hello, We have a situation where hyphenation is an issue, due to a 2-column layout where the columns are not very wide. We've done a lot of tweaking of settings for hyphenation and interword spacing, and the result seems pretty good. In particular, there are not many cases of consecutive lines that end with hyphens, and not many cases where a hyphenation occurs over a right-hand page break. The few cases that exist, we have been fixing manually by using \hbox{...} to prevent hyphenation at the trouble spot. But the hyphenation is by nature somewhat volatile, so whenever we change something we would like to be able to easily recheck the hyphenation. And our book is over 1200 pages, so it would be very helpful to have tools to make the checking more efficient. One tool we found was the "evince" PDF viewer in Linux, which highlights all search results at once. So you can search for "-", and it will highlight all hyphens, which makes it easier to scan the PDF visually for hyphenation problems. Still, this approach has its limitations... our layout domain experts don't have Linux machines, and I haven't found a PDF viewer for Windows that can highlight all search results at once. Another approach we wondered about was having TeX highlight the hyphenations... e.g. changed the background color to yellow or red, when outputting a word that's dynamically broken/hyphenated. (Rather like we have TeX output red grid lines to help with debugging layout.) I think we would also want to highlight static hyphens that occur at the end of a line, as in "Niger- Congo," because they have a similar visual impact. Possibly using a different color. This would be an ideal solution, I think, but we don't know how to have TeX detect when a word gets dynamically hyphenated. Another possibility we've looked into is using javascript in Adobe Reader to find and highlight end-of-line (and end-of-page) hyphens. But this approach has proved more difficult than expected... the API and the DOM are complex, and I haven't figured out yet how to access the text of the document to search for hyphens. (The "search" method seems to just go to the first or next occurence, and highlight only one occurrence at a time.) Thanks for any help, Lars
Lars Huttar wrote:
But the hyphenation is by nature somewhat volatile, so whenever we change something we would like to be able to easily recheck the hyphenation. And our book is over 1200 pages, so it would be very helpful to have tools to make the checking more efficient.
so, you only want to highlight hyphens? Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 2/3/2009 1:29 PM, Hans Hagen wrote:
Lars Huttar wrote:
But the hyphenation is by nature somewhat volatile, so whenever we change something we would like to be able to easily recheck the hyphenation. And our book is over 1200 pages, so it would be very helpful to have tools to make the checking more efficient.
so, you only want to highlight hyphens?
Yes. Especially hyphens introduced by TeX for line-breaking. Lars
Lars Huttar wrote:
On 2/3/2009 1:29 PM, Hans Hagen wrote:
Lars Huttar wrote:
But the hyphenation is by nature somewhat volatile, so whenever we change something we would like to be able to easily recheck the hyphenation. And our book is over 1200 pages, so it would be very helpful to have tools to make the checking more efficient. so, you only want to highlight hyphens?
Yes. Especially hyphens introduced by TeX for line-breaking.
in mkiv it probably takes me a couple of hours to implement such a feature Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 2/3/2009 2:22 PM, Hans Hagen wrote:
Lars Huttar wrote:
On 2/3/2009 1:29 PM, Hans Hagen wrote:
Lars Huttar wrote:
But the hyphenation is by nature somewhat volatile, so whenever we change something we would like to be able to easily recheck the hyphenation. And our book is over 1200 pages, so it would be very helpful to have tools to make the checking more efficient. so, you only want to highlight hyphens?
Yes. Especially hyphens introduced by TeX for line-breaking.
in mkiv it probably takes me a couple of hours to implement such a feature
Hans
Unfortunately at this point I believe we are restricted to mkii. However, I have made progress implementing a tool like this in Adobe javascript. The obstacle I am facing now is that the PDF (produced by xdvipdfmx) is not configured to allow Adobe Reader users to manipulate comments; thus my js code to add highlighting throws an exception. If we had an Adobe Acrobat license it probably would not be a problem; but our current reality is that we don't. Does anyone know how to tell xdvipdfmx to enable commenting rights in the PDF it creates? Or how to add these rights afterwards, without Adobe Acrobat? Thanks, Lars
2009/2/3 Lars Huttar
Does anyone know how to tell xdvipdfmx to enable commenting rights in the PDF it creates? Or how to add these rights afterwards, without Adobe Acrobat?
This is not (legally) possible. http://en.wikipedia.org/wiki/Adobe_LiveCycle_Reader_Extensions Best Martin
On 2/3/2009 3:53 PM, Martin Schröder wrote:
2009/2/3 Lars Huttar
: Does anyone know how to tell xdvipdfmx to enable commenting rights in the PDF it creates? Or how to add these rights afterwards, without Adobe Acrobat?
This is not (legally) possible. http://en.wikipedia.org/wiki/Adobe_LiveCycle_Reader_Extensions
Best Martin
OK, thanks for this explanation. Since what I want to do is really not about modifying the document but about displaying it differently, I wonder if there is a way to highlight parts of the document without requiring the right to manipulate comments. Maybe there's another PDF manipulation API I should be looking at. But that's probably beyond the scope of this list. Cheers, Lars
Lars Huttar wrote:
On 2/3/2009 3:53 PM, Martin Schröder wrote:
2009/2/3 Lars Huttar
: Does anyone know how to tell xdvipdfmx to enable commenting rights in the PDF it creates? Or how to add these rights afterwards, without Adobe Acrobat? This is not (legally) possible. http://en.wikipedia.org/wiki/Adobe_LiveCycle_Reader_Extensions
Best Martin
OK, thanks for this explanation.
Since what I want to do is really not about modifying the document but about displaying it differently, I wonder if there is a way to highlight parts of the document without requiring the right to manipulate comments. Maybe there's another PDF manipulation API I should be looking at. But that's probably beyond the scope of this list.
i'm not talking of commenting, just processing it with non intrusive some option that will color the hyphens Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 2/3/2009 4:27 PM, Hans Hagen wrote:
Lars Huttar wrote:
On 2/3/2009 3:53 PM, Martin Schröder wrote:
2009/2/3 Lars Huttar
: Does anyone know how to tell xdvipdfmx to enable commenting rights in the PDF it creates? Or how to add these rights afterwards, without Adobe Acrobat? This is not (legally) possible. http://en.wikipedia.org/wiki/Adobe_LiveCycle_Reader_Extensions
Best Martin
OK, thanks for this explanation.
Since what I want to do is really not about modifying the document but about displaying it differently, I wonder if there is a way to highlight parts of the document without requiring the right to manipulate comments. Maybe there's another PDF manipulation API I should be looking at. But that's probably beyond the scope of this list.
i'm not talking of commenting, just processing it with non intrusive some option that will color the hyphens
Hans
That sounds good! If it doesn't require us to move from mkii to mkiv... We're in production, very close to being finished, and I don't think I could convince the production manager that mkiv would be guaranteed to produce exactly the same layout as mkii. Lars
Lars Huttar wrote:
On 2/3/2009 4:27 PM, Hans Hagen wrote:
Lars Huttar wrote:
On 2/3/2009 3:53 PM, Martin Schröder wrote:
2009/2/3 Lars Huttar
: Does anyone know how to tell xdvipdfmx to enable commenting rights in the PDF it creates? Or how to add these rights afterwards, without Adobe Acrobat? This is not (legally) possible. http://en.wikipedia.org/wiki/Adobe_LiveCycle_Reader_Extensions
Best Martin OK, thanks for this explanation.
Since what I want to do is really not about modifying the document but about displaying it differently, I wonder if there is a way to highlight parts of the document without requiring the right to manipulate comments. Maybe there's another PDF manipulation API I should be looking at. But that's probably beyond the scope of this list. i'm not talking of commenting, just processing it with non intrusive some option that will color the hyphens
Hans
That sounds good! If it doesn't require us to move from mkii to mkiv...
only for mkiv, apart from it being impossible in mkii, i'm not going to waste time on mkii hackery any more Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Tuesday 03 February 2009 22:53:08 Martin Schröder wrote:
2009/2/3 Lars Huttar
: Does anyone know how to tell xdvipdfmx to enable commenting rights in the PDF it creates? Or how to add these rights afterwards, without Adobe Acrobat?
This is not (legally) possible. http://en.wikipedia.org/wiki/Adobe_LiveCycle_Reader_Extensions
Welcome to the world of proprietary software. Some pdf viewers (such as okular on KDE, now also available on Windows and MacOS) allow annotations, but the data is saved in an auxiliary file. This can be exchanged with collegues, but is specific to the reader employed, thus limiting the portability ("p"df). The advantage, however, is that all formats handled by the document viewer can be annotated, in principle...
On 2/4/2009 3:10 AM, Alan BRASLAU wrote:
On Tuesday 03 February 2009 22:53:08 Martin Schröder wrote:
2009/2/3 Lars Huttar
: Does anyone know how to tell xdvipdfmx to enable commenting rights in the PDF it creates? Or how to add these rights afterwards, without Adobe Acrobat? This is not (legally) possible. http://en.wikipedia.org/wiki/Adobe_LiveCycle_Reader_Extensions
Welcome to the world of proprietary software.
Some pdf viewers (such as okular on KDE, now also available on Windows and MacOS) allow annotations, but the data is saved in an auxiliary file.
Can you tell me where to find Okular for Windows? I read some rumors that it was available, but http://okular.kde.org/download.php only gives instructions for compiling Okular, using a bunch of Linux packages.
This can be exchanged with collegues, but is specific to the reader employed, thus limiting the portability ("p"df).
The advantage, however, is that all formats handled by the document viewer can be annotated, in principle...
Sounds good... is the annotation mechanism available via an API? Or do I have to go through and highlight each hyphen by hand? Thanks, Lars
On Wednesday 04 February 2009 17:16:12 Lars Huttar wrote:
Can you tell me where to find Okular for Windows? I read some rumors that it was available, but http://okular.kde.org/download.php only gives instructions for compiling Okular, using a bunch of Linux packages.
http://windows.kde.org "KDE on Windows is not in the final state, so applications can be unsuitable for day to day use yet." I installed it without any problems and it appears to work. Alan
On 2/4/2009 12:08 PM, Alan BRASLAU wrote:
On Wednesday 04 February 2009 17:16:12 Lars Huttar wrote:
Can you tell me where to find Okular for Windows? I read some rumors that it was available, but http://okular.kde.org/download.php only gives instructions for compiling Okular, using a bunch of Linux packages.
"KDE on Windows is not in the final state, so applications can be unsuitable for day to day use yet."
I installed it without any problems and it appears to work.
Alan
Thanks for the pointer. I look forward to trying this out. In the meantime, I downloaded Adobe Acrobat Pro Trial version so that I could test my javascript function that adds annotations. I'm happy to report that it works... pretty well. It highlights only words hyphenated over line breaks, not just all hyphens, and makes them very visible. But you do need Acrobat Pro (or a PDF that's comment-enabled via LiveCycle) to run it. I'll try to post the javascript to the wiki, as it may be useful to others, within its limitations. The wiki page will be called http://wiki.contextgarden.net/Reviewing_Hyphenation Lars
On Tue, Feb 3, 2009 at 8:42 PM, Lars Huttar wrote:
On 2/3/2009 1:29 PM, Hans Hagen wrote:
Lars Huttar wrote:
But the hyphenation is by nature somewhat volatile, so whenever we change something we would like to be able to easily recheck the hyphenation. And our book is over 1200 pages, so it would be very helpful to have tools to make the checking more efficient.
so, you only want to highlight hyphens?
Yes. Especially hyphens introduced by TeX for line-breaking.
Which font do you use in the document? I have an idea how to do it, but it may require changing the font. You can either: a) set hyphenchar to be whatever other character in the font (but it has to be a numeric value between 0 and 255) b) modify the font, so that hyphenchar becomes a big black box that you can spot easily (even if it remains black; you can extend it to become even bigger, you just need to make sure that the original declared bounding box remains the same) a) would be easiest to do, but only if you already have a suitable character in the font for that purpose; which is most probably not the case. I would most probably try to make a duplicate of the font and try to change the hyphen character, though it's not necessary easy if you don't have the right tools. Maybe this will inspire someone else to propose some easier solution, for example figureing out a way to make such constructs work: \definefontcharacter 23 {\vrule width.5em} :) :) :) Mojca
Mojca Miklavec wrote:
Maybe this will inspire someone else to propose some easier solution, for example figureing out a way to make such constructs work: \definefontcharacter 23 {\vrule width.5em} :) :) :)
ah, interesting trick ... well, just change the encoding vector (enc file) and remap hyphen to something else then Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Wed, Feb 4, 2009 at 10:03 AM, Hans Hagen wrote:
Mojca Miklavec wrote:
Maybe this will inspire someone else to propose some easier solution, for example figureing out a way to make such constructs work: \definefontcharacter 23 {\vrule width.5em} :) :) :)
ah, interesting trick ... well, just change the encoding vector (enc file) and remap hyphen to something else then
The main question being: does something else (suitable enough) exist in the font? The width probably needs to be the same, but I'm thinking about a way to circumvent that. If you're using hz (or if you start using hz), it might be possible to adjust hanging of hyphen, so maybe it's possible to compensate different width of some blackbox character in the font with different hanging. Mojca
participants (5)
-
Alan BRASLAU
-
Hans Hagen
-
Lars Huttar
-
Martin Schröder
-
Mojca Miklavec