1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
|
% whizzytex.sty --- WhizzyTeX, a wysiwyg environment for TeX
%
% Copyright (C) 2001, 2002 Didier Rmy
%
% Author : Didier Remy <Didier.Remy@inria.fr>
% Version : 1.1
% Bug Reports : whizzytex-bugs@pauillac.inria.fr
% Web Site : http://pauillac.inria.fr/whizzytex
%
% WhizzyTeX is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2, or (at your option)
% any later version.
%
% WhizzyTeX is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details
% (enclosed in the file GPL).
%
% See the file COPYING enclosed with the distribution.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% File whizzedit.sty (LaTeX macros)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% This example requires the a version of advi later than May 7
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage {advi}
\@ifundefined {whizzy@curfile}{}
{\def \advi@edit@file {\whizzy@curfile}}
\@ifundefined {whizzy@thelineno}{}
{\let \advi@edit@line \whizzy@thelineno}
%\def \advi@edit@line {\the \inputlineno}
\newdimen \wed@dim
\def \wed@id #1{#1}
\newcommand{\wedbox}[3][]{%
\hbox \bgroup
\advi@edit{\wedbox}{#1}{#2}[unit=1em]
{}{}
{\hbox {\kern \advi@edit@x\advi@edit@unit
\vbox
{\vss
\hbox {\hsize \advi@edit@w\advi@edit@unit
{\vbox to \advi@edit@h\advi@edit@unit {#3}}}%
\vskip \advi@edit@y\advi@edit@unit}}}%
\egroup}
\def\wed@vbox #1#2#3#4#5#6{%
\hbox \bgroup
\advi@edit{#1}{#4}{#5}[#3]
{\setbox0 \hbox{#6}%
\wed@dim \ht0 \advance \wed@dim by \dp0
\adviseth{\wed@dim}}
{}
{\hbox {\kern \advi@edit@x\advi@edit@unit
\vbox to \wed@dim {\vss #2{\box0}\vskip \advi@edit@y\advi@edit@unit}}}%
\egroup
}
\newcommand{\wedvbox}[3][]%
{\wed@vbox{\wedvbox}{\wed@id}{unit=1em}{#1}{#2}{#3}}
\newcommand {\wedvspace}[2][]{%
\advi@edit{\wedspace}{#1}{#2}[unit=1em]
{\def \advi@edit@x{0}\def \advi@edit@y{0}%
\def \advi@edit@w{1}}%
{}%
{\vspace {\advi@edit@h\advi@edit@unit}}}
\newcommand {\wedhspace}[2][]{%
\advi@edit{\wedspace}{#1}{#2}[unit=1em]
{\def \advi@edit@x{0}\def \advi@edit@y{0}%
\def \advi@edit@h{1}}
{}
{\hspace {\advi@edit@w\advi@edit@unit}}}
\newcommand{\wedannot}[4][]{%
\advi@edit{\wedannot}{#1}{#2,w=1,h=1,unit=\bbb@unit}{}{}
{\adviannot{#3}(\advi@edit@x,\advi@edit@y){#4}}
}
\newcommand{\wedoval}[2][]{%
\hbox \bgroup
\def \advi@edit@x{0}\def \advi@edit@y{0}%
\def \wed@@oval{\advi@edit{\wedoval}{#1}{#2}[unit=1em]{}{}}%
\wed@oval}
\newcommand{\wed@oval}[3][]{%
\wed@@oval
{\hbox {\kern \advi@edit@x\advi@edit@unit
\vbox %to \advi@edit@h\advi@edit@unit
{\vss
\hbox {\hsize \advi@edit@w\advi@edit@unit
{\vbox to \advi@edit@h\advi@edit@unit
{\vss \setbox0 \vbox to \advi@edit@h\advi@edit@unit {#3}%
\centerline {\ovalnode[#1]{#2}{\box0}}\vss}}}%
\vskip \advi@edit@y\advi@edit@unit}}}%
\egroup}
\newcommand{\wedput}[3][]{%
\setbox0 \hbox {#3}%
\advi@edit{\wedput}{#1}{#2}[unit=\psunit]
{\wed@dim \ht0 \advance \wed@dim by \dp0 \adviseth{\wed@dim}%
\advisetw{0.5\wd0}%
\edef \advi@edit@tmp {\advi@edit@x}%
\wed@dim \advi@edit@x\advi@edit@unit \advance \wed@dim by -0.5\wd0
\advisetx {\wed@dim}%
\edef \advi@edit@x {\advi@edit@tmp}%
}
{}
{\rput (\advi@edit@x,\advi@edit@y){\box0}}%
}
|