1

As usual I have a problem with LaTeX code; this time is to show the results of domains interval for example when I have a rational function and I have to split domains into the Numerator one and the Denominator one and take the common range.

Like in photo below. I, again, searched for that on the internet but I found nothing :(

This is what I would get

Clearly other symbols hold well too!

By now, this is what I created (for example)

\begin{center}
\begin{tabular}{c|cccccc}
& & & & $\textcolor{red}{0}$   & & \\
 \hline 
  \\\textsf{N} & & & & & $\longrightarrow$ $\longrightarrow$  $\longrightarrow$  \\
  \\\textsf{D} & &$\longleftarrow$ $\longleftarrow$  $\longleftarrow$ & & & $\longrightarrow$ $\longrightarrow$  $\longrightarrow$   \\\\
  \hline 
\\ \textsf{Result}& & & & & $\longrightarrow$ $\longrightarrow$  $\longrightarrow$  
\end{tabular}
\end{center}
13
  • 1
    Welcome to TeX SX! I'm not too sure what you exactly want: reproduce these symbols (wavy line and cross)? What about the values $-2$ and $1$. Is the rational function defined?
    – Bernard
    Oct 31, 2015 at 16:08
  • @Bernard yes exactly! I would like to have such a table in my LaTeX document. But I cannot find any help with the code. :(
    – Henry
    Oct 31, 2015 at 16:20
  • Oh and thank you so much for the welcome :))
    – Henry
    Oct 31, 2015 at 16:20
  • P.s. Clearly, once I got a code for that, I can modify the code for everything similar that I might need!
    – Henry
    Oct 31, 2015 at 16:21
  • Welcome to TeX.SX! On this site, a question should typically revolve around an abstract issue (e.g. "How do I get a double horizontal line in a table?") rather than a concrete application (e.g. "How do I make this table?"). Questions that look like "Please do this complicated thing for me" tend to get closed because they are either "off topic", "too broad", or "unclear". Please try to make your question clear and simple by giving a minimal working example (MWE): you'll stand a greater chance of getting help. Oct 31, 2015 at 19:12

1 Answer 1

2

Here is a simple solution with pstricks. It can be compiled with pdflatex if you launch it with the --enable-write18 switch (MiKTeX) or shell-escape (TeX Live, MacTeX):

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}%
\usepackage{lmodern}
\usepackage{mathtools}
\usepackage{ pstricks-add}
\usepackage{auto-pst-pdf}
\pagestyle{empty}
\newcommand\undef{\psline(0,-0.1)(1.25,0.25)\psline(0,0.25)(1.25,-0.1)}
\newcommand{\mydef}[1][1.3]{\psplot[algebraic, plotpoints=100, plotstyle=curve]{0}{#1}{0.12*SIN(24*x) + 0.1}}
\usepackage{array, booktabs}

\begin{document}

\begin{postscript}
    \psset{linewidth=0.5pt, dotsize=2.25pt}
    \setlength\tabcolsep{2pt}
    \begin{tabular}{r@{\quad}*{3}{m{1.3cm}c}}
          & & $\mathclap{-2} \dotnode(0,-5.5pt){I1}$ & & $\mathclap{1} \dotnode(0,-5.5pt){J1}$ & & \\
        \midrule
        N & \undef & & \mydef[2.9] \\
        \midrule
        D & \mydef & & \undef & & \mydef \\
        \midrule
        Result & \undef & \pnode(0,-5.5pt){I4} & \undef & \pnode(0,-5.5pt){J4} & \mydef
    \end{tabular}
    \ncline{I1}{I4}
    \ncline{J1}{J4}
\end{postscript}

\end{document}

enter image description here

6
  • wow that's huge! I tried it but it doesn't work :( I mean : no errors, but empty output
    – Henry
    Nov 1, 2015 at 15:10
  • Did you compile this very code? And did you enable the switch I mentioned?
    – Bernard
    Nov 1, 2015 at 16:01
  • Oh sorry, such a dumb -.- I use TeXPad for Mac, so I had to check in the option to find the shell-escape! Now it works!! :)) Thank you really much, I think I can modify it for the future. Oh a stupid question: how can I make the table larger? I mean bigger, to see it better!
    – Henry
    Nov 1, 2015 at 16:09
  • Change the value m{1.3cm} in the table preamble to whatever value you want, and set the unit to another value in the postscript part: the default value is 1cm, so the default 1.3for the sine function is indeed 1.3cm. Writing \psset{unit=2cm} at the beginning of the postscript environment should do the trick to have a length of 2.6cm, for instance.
    – Bernard
    Nov 1, 2015 at 16:21
  • Thank you to the infinite. I will definitely have to learn PsTricks..
    – Henry
    Nov 1, 2015 at 16:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .