ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: \dogetobject and pdf
Date: Fri, 11 Jun 2004 10:16:52 +0200	[thread overview]
Message-ID: <40C96A74.4040104@wxs.nl> (raw)
In-Reply-To: <Pine.LNX.4.58.0406101851090.19779@gaston.free.fr>

[-- Attachment #1: Type: text/plain, Size: 130 bytes --]

Hi,

>pdf ok now, but the dvi is shifted up and to the right... :(
>  
>
Can you try this? You need to remake the format 

Hans 


[-- Attachment #2: spec-dvi.tex --]
[-- Type: text/plain, Size: 3462 bytes --]

%D \module
%D   [       file=spec-dvi,
%D        version=1996.01.25,
%D          title=\CONTEXT\ Special Macros,
%D       subtitle=Generic \TEX\ Solutions,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\unprotect

%D \macros
%D   {dostartobject,
%D    dostopobject,
%D    doinsertobject}
%D
%D Reuse of object is not supported by the \DVI\ format. We
%D therefore just duplicate them using boxes.

\startspecials[tex]

\newbox\DVIobjects \newcounter\DVIobjectcounter

\definespecial\dostartobject#1#2#3#4#5%
  {\setbox\nextbox\vbox\bgroup
     \def\dodostopobject
       {\egroup
        \doglobal\increment\DVIobjectcounter
        \global\setbox\DVIobjects\vbox
          {\offinterlineskip
           \forgetall
           \unvbox\DVIobjects
           \setbox\nextbox\hbox{\box\nextbox}%
           \wd\nextbox\zeropoint
           \dp\nextbox\zeropoint
           \ht\nextbox\onepoint
           \allowbreak
           \box\nextbox}%
        \dosetobjectreference{#1}{#2}{\DVIobjectcounter}}}

\definespecial\dostopobject
  {\dodostopobject}

\definespecial\doinsertobject#1#2%
  {\bgroup
   \dogetobjectreference{#1}{#2}\DVIobjectreference
   \splittopskip\zeropoint
   \setbox0=\copy\DVIobjects
   \dimen0=\DVIobjectreference\onepoint
   \advance\dimen0 -\onepoint
   \setbox2\vsplit0 to \dimen0
   \ifdim\ht0>\onepoint
     \setbox0\vsplit0 to \onepoint
   \fi
   \unvbox0
   \setbox0\lastbox
   \hbox{\unhbox0}% the \hbox is really needed!
   \egroup}


%D \macros
%D   {dosetposition,
%D    dosetpositionwhd,
%D    dosetpositionplus}
%D
%D The next specials only identify a position. It is up to
%D a \DVI\ postprocessing utility to merge the right commands
%D into the utility file. Since in \CONTEXT, we only deal
%D with relative positions, the reference point is not so
%D important.
%D
%D The postprocessor should translate the specials into
%D commands and append these to \type {jobname.tuo} using the
%D format:
%D
%D \starttypen
%D \pospxy    {identifier}{page}{x}{y}
%D \pospxywhd {identifier}{page}{x}{y}{w}{h}{d}
%D \pospxyplus{identifier}{page}{x}{y}{w}{h}{d}{list}
%D \stoptypen
%D
%D The postprocessor should, of course, provide the \type
%D {page}, \type {x}, and \type {y} values.

\definespecial\dosetposition#1%
  {\special{pos:pxy "#1"}}

\definespecial\dosetpositionwhd#1#2#3#4%
  {\special{pos:pxywhd "#1" #2 #3 #4}}

\definespecial\dosetpositionplus#1#2#3#4#5%
  {\special{pos:pxyplus "#1" #2 #3 #4 #5}}

%D The next special tells the position postprocessor what
%D page dimensions were used.

\let\flushDVIpositionpapersize\relax

% \definespecial\dosetpositionpapersize#1#2%
%   {\xdef\flushDVIpositionpapersize%
%      {\special{pos:papersize #1 #2}%
%       \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}}
%
% \appendtoksonce
%   \ifspecialbasedsettings
%     \ifpositioning\installprogram{dvipos \jobname}\fi
%   \fi
% \to \everystoptext
%
% less tokens:

\definespecial\dosetpositionpapersize#1#2%
  {\xdef\flushDVIpositionpapersize%
     {\special{pos:papersize #1 #2}%
      \noexpand\installprogram{dvipos --outfile=\jobname.tuo}%
      \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}}

\prependtoksonce \flushDVIpositionpapersize \to \everyshipout

\stopspecials

\protect \endinput

  reply	other threads:[~2004-06-11  8:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-09 15:57 Peter Münster
2004-06-10  7:26 ` Hans Hagen
2004-06-10 16:54   ` Peter Münster
2004-06-11  8:16     ` Hans Hagen [this message]
2004-06-11 15:23       ` Peter Münster
2004-06-11 16:17         ` Hans Hagen
2004-06-11 16:56           ` Peter Münster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40C96A74.4040104@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).