I have a function defined in LaTeX, and I want to use this function inside other one, in this way:
Code: Select all
\def\A{...}
\ded\B{A<0}
Thank you so much!

Code: Select all
\def\A{...}
\ded\B{A<0}
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Hi Stefan, thanks for the reply.Stefan_K wrote:The etoolbox package provides such tests, have a look at section 3.6.4 Arithmetic Tests in theetoolbox documentation.
What do you plan to do? You said negative side of a function, would you like to plot functions, or what is the plan?
Stefan
Code: Select all
\documentclass[11pt,a4paper,spanish]{article}
\usepackage[T1]{fontenc}
\usepackage{selinput}
\usepackage{babel}
\usepackage{geometry}
\usepackage{tikz}
\usepackage{textcomp}
\usepackage{pgfplots}
\usepgfplotslibrary{polar}
\usepgfplotslibrary[polar]
\usetikzlibrary{pgfplots.polar}
\usetikzlibrary[pgfplots.polar]
\begin{document}
\begin{center}
\pgfplotsset{width=15cm,compat=1.5.1}
\begin{tikzpicture}
%%%%%%%%%%% CARTESIAN COORDINATES
%\begin{axis}
%\addplot+[red,domain=0:360,samples=360] {sin(\x)};
%\end{axis}
%%%%%%%%%%%
\begin{polaraxis}[title=\large\bfseries{Polar coordinates}]
\addplot+[red,domain=0:360,samples=360] {sin(\x)};
\end{polaraxis}
\end{tikzpicture}
\end{center}
\end{document}
Code: Select all
\addplot {<expr>} ;
Code: Select all
<if> ? <then> : <else>
Code: Select all
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[mark=none]
\addplot[red,samples=100] { x^2 } ;
\addplot[green,samples=300] { x^2 > 4 ? -x^2+8 : x^2 } ;
\end{axis}
\end{tikzpicture}
\end{document}
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis