1

I would like to draw the picture attached using TikZ. Red lines are not needed. I only need to draw the squared root of s. I use the code below, however, don't know how to insert the "s" in it. In addition, how can I change the linewidth of the first line ? it should be wider than the other lines.

\begin{tikzpicture}
\draw (0,4) -- (1,1) -- (2,6) -- (6,6);
\end{tikzpicture}

Attached

picture

  • I would recommend you check out the options on page 7 and 16 of the "Minimal Introduction to TikZ" available from CTAN – darthbith Aug 4 '14 at 15:48
  • Is there a special reason, to "draw" this root? Why do you not use: \node[scale=5.3] {$\sqrt{s}$}; – cis Aug 4 '14 at 15:59
  • yes I need this or something similar to this one. – rask Aug 4 '14 at 17:59
  • I check the document, Minimal int. to TikZ, but still having problems to do it:( – rask Aug 4 '14 at 18:00
  • Aha, the way setting text on drawed things is using "nodes". For example: \draw (0,4) -- (1,1) node[green, right, xshift=2mm]{some text} -- (2,6) -- (6,6); – cis Aug 4 '14 at 18:35
1

A simple approach:

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[xscale=1.25]
\draw[red]
  (0,0) grid (5,6);
\draw[line width=8pt]
  (0,4) -- (1,0);
\draw[thick]
  (1.08,0.1) -- (1.5,6) -- (5,6);
\node[scale=22,font=\sffamily] at (3,2)
  {s};    
\end{tikzpicture}
\end{document}

enter image description here

1

I think you are after upright square root symbol and trying to make it with tikz. If so, the following may be useful.

\documentclass{article}
\usepackage{tikz}
\newcommand{\upsqrt}[1]{%
\begin{tikzpicture}[baseline={(a.base)}]
  \node[inner sep=2pt] (a) {\hspace*{0.5ex}$#1$};
  \draw[line cap=round] ([yshift=0.5ex]a.west) -- +(-1pt,-0.7pt);
  \draw[thick] ([yshift=0.5ex]a.west) -- ([xshift=0.7ex]a.south west);
  \draw[line cap=round] ([xshift=0.7ex]a.south west) -- ([xshift=0.7ex]a.north west) -- (a.north east);
\end{tikzpicture}%
}

\begin{document}
This is up right square root $\upsqrt{S}$ and this too $\upsqrt{x}$ and this is normal $\sqrt{x}$ $\sqrt{S}$
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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