1

I am running ubuntu 16.04 (it is on an OLD laptop). I am using 'pic | eqn -Tpdf -d@@ | groff -mm -Tpdf' software as per the ubuntu release. I need some symbols which are not in the standard groff TIMES font for the release. I have found the symbols I need in STIX and FreeMono that come with the ubuntu release. I have created the relevant font files for groff as per https://www.schaffter.ca/mom/momdoc/appendices.html.

It is almost working but there is extraneous spacing between characters / glyphs. See attached image. I have tried both STIX and FreeMono and they produce the same problem.

PDF output from groff eqn showing extraneous spacing: PDF output from groff eqn showing extraneous spacing

The groff, eqn mark up for the imaged example above is:

.EQ
gsize +2
.EN
.EQ
xi ( tau ) = sigma sub { C ( tau ) } size -4 \[u2A1D] sub { f \[mo] Facts ( tau ) } f
.EN
.sp 1
.special STIXGeneralR
.EQ
xi ( tau ) = sigma sub { C ( tau ) } size -4 \[u2A1D] sub { f \[mo] Facts ( tau ) } f
.EN
.special
.sp 1
.EQ
xi ( tau ) = sigma sub { C ( tau ) } size -4 \[u2A1D] sub { f \[mo] Facts ( tau ) } f
.EN
.sp 1
.fam STIXGeneral
.EQ
xi ( tau ) = sigma sub { C ( tau ) } size -4 \[u2A1D] sub { f \[mo] Facts ( tau ) } f
.EN

How to I get rid of the extraneous spacing?

The first line does produce a [u2A1D] character not found message.

SecretAgentMan
  • 2,856
  • 7
  • 21
  • 41
petern0691
  • 868
  • 4
  • 11
  • See `man groff_font` for the format of the font files that were created. Look for the entry for the wanted character and check whether the metrics given there (width,...) seem reasonable. – meuh May 24 '21 at 19:51
  • Thanks. It has sort of fixed the problem. I have reduced the width from 1270 down to 100 for the one symbol. Any ideas on how to work out the size it should be? And I may have to do the entire font! However, even more puzzling now is that if I take out the .EQ.EN between the two .specials then the spacing in the third line in the example gets a bit bigger again, but not as much as it was !? I would prefer not to have a "sacrificial" equation somewhere. Any ideas? – petern0691 May 25 '21 at 00:42
  • The minimum needed in the sacrificial equation is xi. An ordinary character results in the extra space. \\[u2A1D] also results in extra space. How can the content of an equation affect the spacing in a later equation? – petern0691 May 25 '21 at 00:57
  • More strangeness. If I change the 'sub { f \[mo] Facts ( tau ) }' to 'from { f \[mo] Facts ( tau ) }' in the small test file listed above the spacing seems to be correct. However, if I do the same in the much bigger document I want to use eqn in, while the sub seems to have the "correct" spacing, the 'from' version has the extraneous spacing again!? In the much bigger document there is no eqn material other than what is in the mark up above. – petern0691 May 25 '21 at 09:58
  • I'm just reading more of the `groff_font` man page, and I see the metrics also include an *italic-correction* and so on. Eqn switches between italic and roman a lot, so these values, if wrong, may be what is producing the effect. Also, the `DESC` file contains `unitwidth` and `sizescale` factors that affect how the metrics are used. – meuh May 25 '21 at 10:15
  • Thanks. But I feel like it is entering a jungle trying to work out what is affecting what. I would have thought that since this software has been around for decades such strangeness would have been ironed out a long time ago. I am still presuming there is some simple fix to all this, rather than having to tweak hundreds of glyphs and combinations of glyphs? I am not the first to try to mark up equations ... And eqn seems to be messing with pic too, changing .po and .PS width ... – petern0691 May 26 '21 at 08:03
  • Yes, it should all be much simpler, but I think most technical Maths typesetting is probably being done with LaTeX these days; they even have their own stackexchange [website](https://tex.stackexchange.com/). There have been similar questions on the [unix](https://unix.stackexchange.com/) stackexchange site, which is probably where you should be posing your question, but you may not get any better answers. – meuh May 26 '21 at 12:57
  • Thanks. Yes I was hoping not to have to go LateX. I have a library of pic routines I built 30 years ago ... It just so happens I now need to mix them in with math as well ... I think you have essentially answered my question as posed here. How do I close this off as answered without an actual answer, or can you post a dummy answer for me to accept? – petern0691 May 26 '21 at 15:09

2 Answers2

0

As per comments per meuh. Might need to go to different software, ie, LaTeX.

petern0691
  • 868
  • 4
  • 11
0

I think I have a workaround for you. I finally setup a test on my Fedora 25 with the STIX fonts and found that if you target for PostScript output instead of PDF, the eqn looks correctly spaced (to me), including the "join" bow-tie. You can then separately use ps2pdf (which comes with ghostscript) to convert to a good pdf. So try

pic <input | eqn -d@@ | groff -mm -Tps >text.ps
ps2pdf text.ps text.pdf
meuh
  • 11,500
  • 2
  • 29
  • 45
  • Many thanks @meuh. Yes it works as far as I can tell too. It adds a bit of time to processing. I have some documents which are not small. Bonus too, your work around has also fixed another problem I had with vertical spacing! So great suggestion. – petern0691 Jun 01 '21 at 11:16