[Tutkielma-TeX] taulukkoon tekstiä sarakkeiden väliin =?iso-8859-1?Q?(yl= F6s?=)

Matthieu Weber mweber at mit.jyu.fi
Thu Nov 30 17:11:05 EET 2006


On Wed 29.11.2006 at 05:11:29PM +0200, Mikko Rautiainen wrote:
> Hep.
> 
> Tiedän, että on olemassa paketteja melkein mihin tahansa. Ei tarvitse
> muistuttaa siitä. Saa kertoa paketin nimen ja linkittää, jos tietää
> vastauksen kysymykseeni: Miten voi latoa taulukkoon sarakkeiden väliin
> ylös tavaraa?
> 
> Teen siis kulkukaaviota funktiolle / merkkikaaviota derivaatalle ja sinne
> yritän tunkea nollakohtia näkyviin. \searrow ja \nearrow toimivat funktion
> kulkua selvittävinä nuolina, saa ehdottaa tyylikkäämpiä.
> 
> Tämmöinen on tämä tekele toistaiseksi.
> 
> \begin{tabular}
> {|l|c|c|c|} \(f'\) & + & - & +  \\ \hline \(f\) & \(\nearrow\) &
> \(\searrow\) & \(\nearrow\) \\
> \end{tabular}

\newsavebox{\foobox}
\newlength{\foolen}
\newcommand{\foo}[1]{%
  \sbox{\foobox}{\(\nearrow\)}%
  \setlength{\foolen}{.5\wd\foobox}%
  \sbox{\foobox}{\(+\)}%
  \addtolength{\foolen}{-.5\wd\foobox}%
  \addtolength{\foolen}{\tabcolsep}%
  \addtolength{\foolen}{-.5\arrayrulewidth}%
  \sbox{\foobox}{#1}%
  \addtolength{\foolen}{-.5\wd\foobox}%
  \raisebox{15pt}[0pt]{\parbox{0pt}{\hspace*{\foolen}\usebox{\foobox}}}}

and then 

\begin{tabular}{|l|c|c|c|}
\(f'\) & $+$\foo{-1} & $-$\foo{1} & $+$  \\
\hline \(f\) & \(\nearrow\) & \(\searrow\) & \(\nearrow\) \\
\end{tabular}

USAGE:

- \foo can contain almost anything. You can change the name to your
liking (first argument of \newcommand, and optionally the prefix of
\foobox and \foolen)

- You can change the height of the symbol displayed by \foo by changing
the first parameter of \raisebox (15pt by default is fine for a 12pt
fonti except if you want to use \frac in which case you should increase
it by a couple of points).

LIMITATIONS:

- You must use ``$-$'' and ``$+$'' instead of ``-'' and ``+''
respectively (and it is typographically more correct anyway).

- You must not put anything else than \nearrow or \searrow in the cells
of the the second line (the important point here is the width of the
symbol, you can actually replace them with any symbol which have the
same width).

- You must not use any other symbol than $+$ and $-$ in the first line
(the problem is again the width of the symbol, as above).

I hope it helps.

Matthieu
-- 
 (~._.~)        Matthieu Weber - Université de Jyväskylä         (~._.~)
  ( ? )                email : mweber at mit.jyu.fi                  ( ? ) 
 ()- -()               public key id : 452AE0AD                  ()- -()
 (_)-(_)  "Humor ist, wenn man trotzdem lacht (Germain Muller)"  (_)-(_)




More information about the Tutkielma-TeX mailing list