Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to qualitatively describe an equation and would like to do so by using little pictures of the functions involved.

Therefore, I am looking for glyphs or a way of drawing cute little pictures of a sine wave, a gaussian, a logistic (or sigmoid) function, and a step function.

Any thoughts?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You can plot these functions in a separate document like this:

\documentclass{article}

\usepackage{tikz}

\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}

\begin{document}

\begin{tikzpicture}[scale=0.1]
    \draw plot [domain=0:2*pi](\x, {sin(\x r)});
\end{tikzpicture}

\end{document}

I would use a naming scheme like img_sin.tex. Then you can include them easily as:

\documentclass{article}

\usepackage{graphicx}
\newcommand\splot[1]{\includegraphics{img_#1}}

\begin{document}

The sinus looks like \splot{sin}.

\end{document}

example output

Of course you can make the plots as fancy as you like.

Note that I chose a fixed scaling factor of 0.1 which looked good for me. It might be possible to scale the image to the current font height on inclusion, but I'm not sure how to do that.

share|improve this answer
    
This worked quite well, thank you. –  Richard Nov 24 '12 at 18:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.