ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \dogetobject and pdf
@ 2004-06-09 15:57 Peter Münster
  2004-06-10  7:26 ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Münster @ 2004-06-09 15:57 UTC (permalink / raw)


[-- Attachment #1: Type: TEXT/PLAIN, Size: 555 bytes --]

Hello Hans,
I'm sorry, your patch of the May 17 works well for dvi, but not for pdf:
the figure is again shifted down and to the left.

Here an example:
\setupoutput[pdftex]
\starttext
X\externalfigure[example][width=5cm]X
\stoptext

example.pdf is attached, also the resulting pdf.


Concerning the issus with \useencoding[ffr] and FitBH:
Do you think, you could solve the problems? If not, I'll go on trying to
find solutions.

Greeting, Peter

-- 
http://pmrb.free.fr/contact/
_____________________________________
FilmSearch engine: http://f-s.sf.net/

[-- Attachment #2: Type: APPLICATION/pdf, Size: 832 bytes --]

[-- Attachment #3: Type: APPLICATION/pdf, Size: 5150 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: \dogetobject and pdf
  2004-06-09 15:57 \dogetobject and pdf Peter Münster
@ 2004-06-10  7:26 ` Hans Hagen
  2004-06-10 16:54   ` Peter Münster
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2004-06-10  7:26 UTC (permalink / raw)


Peter Münster wrote:

>Hello Hans,
>I'm sorry, your patch of the May 17 works well for dvi, but not for pdf:
>the figure is again shifted down and to the left.
>
>Here an example:
>\setupoutput[pdftex]
>\starttext
>X\externalfigure[example][width=5cm]X
>\stoptext
>
>example.pdf is attached, also the resulting pdf.
>
>
>Concerning the issus with \useencoding[ffr] and FitBH:
>Do you think, you could solve the problems? If not, I'll go on trying to
>find solutions.
>  
>
i ran into that last week as well -)

can you try:

\def\dogetobject#1#2#3#4#5#6#7%
  {\initializepaper
   \forgetall
   \dontshowcomposition
   \setbox\scratchbox\vbox
     {\doinsertobject{#1}{#2}}%
   \setbox\scratchbox#3%
     {\vbox to #5\scaledpoint
        {\ifdim\ht\scratchbox>#5\scaledpoint
           \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss
         \else\ifdim\wd\scratchbox>#4\scaledpoint
           \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss
         \else
           \vss\box\scratchbox
         \fi\fi}}%
   \box\scratchbox
   \elabelgroup}

if this does not work i 'll do an upload

Hans

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: \dogetobject and pdf
  2004-06-10  7:26 ` Hans Hagen
@ 2004-06-10 16:54   ` Peter Münster
  2004-06-11  8:16     ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Münster @ 2004-06-10 16:54 UTC (permalink / raw)


On Thu, 10 Jun 2004, Hans Hagen wrote:

> Peter Münster wrote:
> 
> >Hello Hans,
> >I'm sorry, your patch of the May 17 works well for dvi, but not for pdf:
> >the figure is again shifted down and to the left.
> >
> >Here an example:
> >\setupoutput[pdftex]
> >\starttext
> >X\externalfigure[example][width=5cm]X
> >\stoptext
> >
> >example.pdf is attached, also the resulting pdf.
> >
> >
> >Concerning the issus with \useencoding[ffr] and FitBH:
> >Do you think, you could solve the problems? If not, I'll go on trying to
> >find solutions.
> >  
> >
> i ran into that last week as well -)
> 
> can you try:
> 
> \def\dogetobject#1#2#3#4#5#6#7%
>   {\initializepaper
>    \forgetall
>    \dontshowcomposition
>    \setbox\scratchbox\vbox
>      {\doinsertobject{#1}{#2}}%
>    \setbox\scratchbox#3%
>      {\vbox to #5\scaledpoint
>         {\ifdim\ht\scratchbox>#5\scaledpoint
>            \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss
>          \else\ifdim\wd\scratchbox>#4\scaledpoint
>            \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss
>          \else
>            \vss\box\scratchbox
>          \fi\fi}}%
>    \box\scratchbox
>    \elabelgroup}
> 
> if this does not work i 'll do an upload

pdf ok now, but the dvi is shifted up and to the right... :(

Now I use a workaround in form of an environment:

\startenvironment pdf-figures
\input ifpdf.sty
\ifpdf
\def\dogetobject#1#2#3#4#5#6#7%
  {\initializepaper
   \forgetall
   \dontshowcomposition
   \setbox\scratchbox\vbox
     {\doinsertobject{#1}{#2}}%
   \setbox\scratchbox#3%
     {\vbox to #5\scaledpoint
        {\ifdim\ht\scratchbox>#5\scaledpoint
           \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss
         \else\ifdim\wd\scratchbox>#4\scaledpoint
           \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss
         \else
           \vss\box\scratchbox
         \fi\fi}}%
   \box\scratchbox
   \elabelgroup}
\fi
\stopenvironment

Greetings, Peter

-- 
http://pmrb.free.fr/contact/
_____________________________________
FilmSearch engine: http://f-s.sf.net/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: \dogetobject and pdf
  2004-06-10 16:54   ` Peter Münster
@ 2004-06-11  8:16     ` Hans Hagen
  2004-06-11 15:23       ` Peter Münster
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2004-06-11  8:16 UTC (permalink / raw)


[-- 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: \dogetobject and pdf
  2004-06-11  8:16     ` Hans Hagen
@ 2004-06-11 15:23       ` Peter Münster
  2004-06-11 16:17         ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Münster @ 2004-06-11 15:23 UTC (permalink / raw)


On Fri, 11 Jun 2004, Hans Hagen wrote:

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

Yes, dvi and pdf ok, after deleting the \dogetobject definition in
cont-new.tex.

Thank you!
Peter

-- 
http://pmrb.free.fr/contact/
_____________________________________
FilmSearch engine: http://f-s.sf.net/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: \dogetobject and pdf
  2004-06-11 15:23       ` Peter Münster
@ 2004-06-11 16:17         ` Hans Hagen
  2004-06-11 16:56           ` Peter Münster
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2004-06-11 16:17 UTC (permalink / raw)


Peter Münster wrote:

>Yes, dvi and pdf ok, after deleting the \dogetobject definition in
>cont-new.tex.
>  
>
you mean that the dogetobject i send last fails? 

Hans 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: \dogetobject and pdf
  2004-06-11 16:17         ` Hans Hagen
@ 2004-06-11 16:56           ` Peter Münster
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Münster @ 2004-06-11 16:56 UTC (permalink / raw)


On Fri, 11 Jun 2004, Hans Hagen wrote:

> Peter Münster wrote:
> 
> >Yes, dvi and pdf ok, after deleting the \dogetobject definition in
> >cont-new.tex.
> >  
> >
> you mean that the dogetobject i send last fails? 

Oh, excuse me. It was the old one, that fails. The new one is ok. But
without any \dogetobject in cont-new.tex it is ok too.

Peter

-- 
http://pmrb.free.fr/contact/
_____________________________________
FilmSearch engine: http://f-s.sf.net/

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-06-11 16:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-09 15:57 \dogetobject and pdf 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
2004-06-11 15:23       ` Peter Münster
2004-06-11 16:17         ` Hans Hagen
2004-06-11 16:56           ` Peter Münster

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).