1

How can I draw like this picture in TeX?

How can I draw like this picture in TeX? Help me! Please!

Thank you so much. I found a solution in How to draw/fill half-open intervals on a ray of numbers? (tikz; incl. minimal ex.) However I can not make /////////////// in line.

Mr. C
  • 25
  • 1
    Welcome to TeX.SE? be so kind and show what you try so far! – Zarko Aug 16 '16 at 18:44
  • Well, i mean, this is a fairly straightforward thing to do in TikZ I'm sure. You could probably do it in LaTeX's picture environment, even, if you really wanted. But if you're not comfortable enough with TikZ and you've already got the picture, I don't understand why you wouldn't just include it as an image, or draw it in a program like inkscape if it must be a vector image. Also I edited your post a bit "Help me!" comes across as a bit demanding towards a volunteer community and does not fit so well with the tone of this particular site :) – Au101 Aug 16 '16 at 18:53
  • My homework like this picture. But it is not a picture. I have to write it by code tex. And I think it is too difficult. Wonderful if we have the way to draw auto it easily by a software or short step in tex. Thank you so much! – Mr. C Aug 16 '16 at 19:13
  • Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – samcarter_is_at_topanswers.xyz Sep 25 '17 at 18:39

2 Answers2

4

You can use this as a template for decoration

\documentclass[tikz]{standalone}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[mystyle/.style={decoration={
markings,% switch on markings
mark=% actually add a mark
between positions 0 and 1 step 1mm with {\draw (-1pt,-3pt) -- (1pt,3pt);},
pre length=3mm,post length=3mm}
}
]
\draw[postaction=decorate,mystyle,] (0,0) -- (3,0);
\end{tikzpicture}
\end{document}

enter image description here

percusse
  • 157,807
0

Well, you really don't need to draw it, though you certainly could, using TikZ. However, I assumed that wasn't necessary, and created a simple solution. Since you have the image you want, I uploaded it, and used it in the document.

My code is

\documentclass{article}
\usepackage{graphicx}

\begin{document}

\centering
\includegraphics{AWCME}

\end{document}

For a quick explanation, at the top, it says that we want a specific class of document, an article. This is the standard document class. The next line says we want to use a specific package, the graphicx package. This package allows us to include images. The next line begins the document. The line after that centers the image, and the next line includes the image. Finally, the document is ended.

I personally use sharelatex, and to upload an image in sharelatex, you click the button that has an up arrow, in the menu shown below

enter image description here

This code produces the result

enter image description here

just like you wanted.

Hope this helps!

auden
  • 1,458