From b5fd701a37c8cfeadc3d03eea8b86c1ebd2ea85e Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Thu, 26 Oct 2017 09:49:02 +0330 Subject: [PATCH] tmac.ps: support eps file names and link destinations with spaces --- tmac/tmac.eps | 4 ++-- tmac/tmac.ps | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tmac/tmac.eps b/tmac/tmac.eps index 10c84e3..214d6bd 100644 --- a/tmac/tmac.eps +++ b/tmac/tmac.eps @@ -5,7 +5,7 @@ . ds eps.tmp /tmp/.eps.\n($$ . \" obtaing the bounding box . ec @ -. sy cat @$1 | sed -n '/%%BoundingBox: \([-0123456789]\{1,10\}\) \([-0123456789]\{1,10\}\) \([-0123456789]\{1,10\}\) \([-0123456789]\{1,10\}\)/{s//.nr llx 0+\1p,.nr lly 0+\2p,.nr urx 0+\3p,.nr ury 0+\4p/p; q; }' | tr ',' '\\n' >@*[eps.tmp] +. sy cat "@$1" | sed -n '/%%BoundingBox: \([-0123456789]\{1,10\}\) \([-0123456789]\{1,10\}\) \([-0123456789]\{1,10\}\) \([-0123456789]\{1,10\}\)/{s//.nr llx 0+\1p,.nr lly 0+\2p,.nr urx 0+\3p,.nr ury 0+\4p/p; q; }' | tr ',' '\\n' >@*[eps.tmp] . ec . so \\*[eps.tmp] . sy rm \\*[eps.tmp] @@ -26,6 +26,6 @@ . br . ne \\n[eps.h]u . sp \\n[eps.h]u -\h'|\\n[eps.in]u'\\X'eps \\$1 \\n[eps.w]'\h'\\n[eps.w]u' +\h'|\\n[eps.in]u'\\X'eps "\\$1" \\n[eps.w]'\h'\\n[eps.w]u' . br .. diff --git a/tmac/tmac.ps b/tmac/tmac.ps index da6364f..64c001e 100644 --- a/tmac/tmac.ps +++ b/tmac/tmac.ps @@ -28,18 +28,16 @@ .\" pdfmark link .\" .ps.link destination width height .de ps.link -. br . nr ps._linkh \\$1 . nr ps._linkv \\$2 -\X'link \\$1 \\n[ps._linkh] -\\n[ps._linkv]' -. sp -1 +\X'link "\\$1" \\n[ps._linkh] -\\n[ps._linkv]' .. .\" Inline URL .\" \*[ps.ref url/page text] .de ps.url \R'ps._linkh \\w'\\?'\\n(.$>1@\\$2@\\$1'''\ \R'ps._linkv \\n(.sp'\ -\v'+\\n(.sp*2u/10u'\X'link \\$1 \\n[ps._linkh] -\\n[ps._linkv]'\v'-\\n(.sp*2u/10u'\ +\v'+\\n(.sp*2u/10u'\X'link "\\$1" \\n[ps._linkh] -\\n[ps._linkv]'\v'-\\n(.sp*2u/10u'\ \\?'\\n(.$>1@\\$2@\\$1' .. .chop ps.url -- 2.11.4.GIT