Nazev obtekaneho obrazku
Jaromir Kuben
kuben at scova.vabo.cz
Mon Mar 22 10:21:00 CET 1999
> Dobry dn,
> mozna to trochu zapadlo, ale prosim jeste jednou o pomoc. Pokusil jsem
> se pouzit \piccaptiontopside, ale vysazi mi to tohle:
>
> \label{kralovec}
> \piccaptiontopside
> \piccaption{K\"onigsbergské mosty}
> \parpic[l]{\input{kralovec.obr}}
> Text text text ...
>
>
> Obrazek 2.12: Konigsbergske mosty
> +--------------+ Text text ... ... text
> | | text text ... ... text
> | obrazek | text text ... ... text
> | | :
> +--------------+ :
>
> Proc ?
>
> Potreboval bych, aby ten popisek obrazku byl nad nim. Jak toho mam
> dosahnout?
>
> JM
>
>
> --
> +--------------------------------------------------------+
> | Jakub Mrázek | Lef ICQ=21597979 |
> | lef at email.cz | http://www.mujweb.cz/www/Lefs |
> +--------------------------------------------------------+
Nezapadlo, ale potreboval jsem si to vyzkouset.
Prikaz \piccaptiontopside dela to, co je popsane v dokumentaci
(bohuzel nemecky), neben je skutecne vedle, ale nad textem.
Variantu nad obrazkem styl neumoznuje. Nezbyva nez tedy udelat
zmenu a predefinovat napr. prikaz \ivparpic.
Kdyz si date do souboru nize uvedenou upravu, budou prikazy
\piccaptioninside (coz je implicitni hodnota) a \piccaptionoutside
delat to, co je popsano v dokumentaci, ale davat popis nad obtekany
material. Zmeny, ktere jsem udelal (jsou dve), jsou oznaceny
%zmena a %konec zmeny. Pripadne jeste muzete zmenit hodnoty u \vskip,
cimz zmenite vertikalni mezerovani.
A ted ten kod:
\usepackage{picins}
\makeatletter
\def\ivparpic(#1,#2)(#3,#4)[#5][#6]#7{%
\let\par=\old at par\par%
\hangindent0pt\hangafter1%
\setbox\@BILD=\hbox{#7}%
\d at breite=#1\d at breite=\the\d at breite%
\ifdim\d at breite=0pt\d at breite=\wd\@BILD\fi%
\c at breite=\d at breite\divide\c at breite by65536%
\multiply\c at piccaption\c at piccaptionpos%
\d at hoehe=#2\d at hoehe=\the\d at hoehe%
\ifdim\d at hoehe=0pt\d at hoehe=\ht\@BILD\advance\d at hoehe by\dp\@BILD\fi%
\c at hoehe=\d at hoehe\divide\c at hoehe by65536%
\d at xoff=#3\c at xoff=\d at xoff\divide\c at xoff by65536%
\d at yoff=\d at hoehe%
\advance\d at yoff by-#4\c at yoff=\d at yoff\divide\c at yoff by65536%
\c at pos=1\unitlength1pt%
\if at offset%
\setbox\@BILD=\hbox{%
\begin{picture}(\c at breite,\c at hoehe)%
\put(0,0){\makebox(\c at breite,\c at hoehe){}}%
\put(\c at xoff,\c at yoff){\box\@BILD}%
\end{picture}%
}%
\else%
\setbox\@BILD=\hbox{%
\begin{picture}(\c at breite,\c at hoehe)%
\put(0,0){\makebox(\c at breite,\c at hoehe)[#6]{\box\@BILD}}%
\end{picture}%
}%
\fi%
\ifnum\c at piccaption=2%
\make at piccaption%
\advance\d at hoehe\ht\@TEXT\advance\d at hoehe\dp\@TEXT%
\c at hoehe=\d at hoehe\divide\c at hoehe by65536%
%zmena
\setbox\@BILD=\vbox{%
\hbox{\hspace{\fboxsep}\box\@TEXT}%
\vspace{5pt%
\box\@BILD}%
\vspace{4pt}}%
\fi%
%konec zmeny
\@tfor\@tempa := #5\do{%
\if\@tempa f\setbox\@BILD=\hbox{\Rahmen(\c at breite,\c at hoehe){\box\@BILD}}\fi%
\if\@tempa s\setbox\@BILD=\hbox{\Schatten(\c at breite,\c at hoehe){\box\@BILD}}\fi%
\if\@tempa o\setbox\@BILD=\hbox{\Oval(\c at breite,\c at hoehe){\box\@BILD}}\fi%
\if\@tempa d\setbox\@BILD=\hbox{\Strich(\c at breite,\c at hoehe){\box\@BILD}}\fi%
\if\@tempa x\setbox\@BILD=\hbox{\Kasten(\c at breite,\c at hoehe){\box\@BILD}}\fi%
\if\@tempa l\c at pos=1\fi%
\if\@tempa r\c at pos=2\fi%
}%
\ifnum\c at piccaption=1%
\make at piccaption%
\advance\d at hoehe\ht\@TEXT\advance\d at hoehe\dp\@TEXT%
\c at hoehe=\d at hoehe\divide\c at hoehe by65536%
%zmena
\setbox\@BILD=\vbox{\hbox{\box\@TEXT}\vspace{5pt}\box\@BILD\vspace{4pt}}%
%konec zmeny
\fi%
\ifodd\count0\c at picpos=0\else\c at picpos=\@changemode\fi%
\pagetotal=\the\pagetotal%
\d at tmp=\pagegoal\advance\d at tmp by-\pagetotal\advance\d at tmp by-\baselineskip%
\ifdim\d at hoehe>\d at tmp%
\vskip 0pt plus\d at hoehe\relax\pagebreak[3]\vskip 0pt plus-\d at hoehe\relax%
\ifnum\c at picpos=1\c at picpos=0\else\c at picpos=\@changemode\fi%
\fi%
\ifnum\c at picpos=1\ifnum\c at pos=1\c at pos=2\else\c at pos=1\fi\fi%
\ifnum\@listdepth>0
\@listtrue\parshape 0%
\advance\hsize -\rightmargin%
\d at leftskip \leftskip%
\leftskip \@totalleftmargin%
\if at inlabel\rule{\linewidth}{0pt}\vskip-\baselineskip\relax\fi%
\else\@listfalse\medskip%
\fi%
\if at list\d at tmpa=\linewidth\else\d at tmpa=\hsize\fi%
\ifnum\c at piccaption=3%
\make at piccaption%
\d at tmp\ht\@TEXT\advance\d at tmp\dp\@TEXT%
\ifdim\d at hoehe>\d at tmp%
\setbox\@TEXT=\vbox to\d at hoehe{\vfill\box\@TEXT\vspace{.2\baselineskip}\vfill}%
\else%
\setbox\@BILD=\vbox to\d at tmp{\vfill\box\@BILD\vfill}%
\d at hoehe\d at tmp%
\fi%
\fi%
\ifnum\c at piccaption=4%
\make at piccaption%
\d at tmp\ht\@TEXT\advance\d at tmp\dp\@TEXT%
\setbox\@TEXT=\vbox to\d at hoehe{\vspace{-10pt}\box\@TEXT\vfil}%
\advance\d at hoehe-\d at tmp%
\fi%
\ifnum\c at pos=1\d at tmpa=0pt%
\ifnum\c at piccaption>2%
\setbox\@BILD=\hbox{\box\@BILD\hspace{\d at pichskip}\hbox{\box\@TEXT}}%
\fi%
\else\advance\d at tmpa by-\wd\@BILD\d at breite=-\d at breite%
\ifnum\c at piccaption>2%
\d at tmpa=0pt%
\setbox\@BILD=\hbox{\hbox{\box\@TEXT}\hspace{\d at pichskip}\box\@BILD}%
\fi%
\fi%
\p at getot@l\the\pagetotal%
\d at bskip\d at hoehe\advance\d at bskip by\parskip\advance\d at bskip by.3\baselineskip%
{\noindent\hspace*{\d at tmpa}\relax%
\box\@BILD\nopagebreak\vskip-\d at bskip\relax\nopagebreak}%
\d at tmp=-\d at hoehe\divide\d at tmp by\baselineskip%
\c at zeilen=\d at tmp\advance\c at zeilen by-1%
\ifdim\d at breite<0pt\advance\d at breite by-\d at pichskip%
\else\advance\d at breite by\d at pichskip%
\fi%
\hangindent=\d at breite%
\hangafter=\c at zeilen%
\let\par=\x at par%
\ifnum\c at piccaption=3%
\hangindent0pt\hangafter1\let\par=\old at par%
\vskip\d at hoehe\vskip.2\baselineskip%
\fi%
\c at piccaption=0%
}
\makeatother
Zdravi
Jaromir Kuben
More information about the csTeX
mailing list