2

I'm new to LaTeX and I'm using TeX Writer for iOS and I want to insert a new command "\dotplus" (symbolically: $\dotplus$) on my .text to .pdf. All I did was:

enter image description here

And I got three errors:

enter image description here

I have also saved the symbol's picture to PDF..

Ichixgo
  • 158
  • @Mark Do you have a specific link that can help me ? –  Apr 19 '16 at 16:09
  • there is already a \dotplus symbol command defined if you \usepackage{amssymb} (the symbol is included in amsfonts, which is loaded automatically by amssymb). – barbara beeton Apr 20 '16 at 01:45
  • @barbarabeeton so I type \usepackage{assymb}{\dotplus} and I'm done ? – user180321 Apr 20 '16 at 01:58
  • \usepackage{amssymb} goes in the preamble. then you can use \dotplus (in math) in the body of your document. (a lot of other symbols become available too,) – barbara beeton Apr 20 '16 at 02:01

2 Answers2

4

In order to use \includegraphics you need to add \usepackage{graphicx} in your preamble (at the beginning of your document). And fix the \newcommand{} statement like this:

\documentclass{article}
\usepackage{graphicx}

\newcommand{\dotplus}{\includegraphics[width=0.2in]{/dotplus.jpg}}

\title{}
\author{}
\date{}
\begin{document}

\dotplus

\end{document}
Ichixgo
  • 158
  • Let me try it. I will warn you if that won't work –  Apr 19 '16 at 15:51
  • What is that "{graphicx}" for ? –  Apr 19 '16 at 15:54
  • It tells the TeX engine to include/use the package graphicx which contains the function \includegraphics you want to use. Otherwise the engine won't know what to do with the command \includegraphics. – Ichixgo Apr 19 '16 at 15:56
  • So what I have to type inside {graphicx} ? –  Apr 19 '16 at 15:57
  • Well, I typed: \newcommand*\dotplus{\usepackage{width=0.2in}{\dotplus.jpg}}. I got an error: "can be used only in preamble " –  Apr 19 '16 at 16:05
  • Check out my initial answer, I added your example with corrections. The only thing I can't check is the path to your image, as I don't know where it resides on your phone or in the editor. – Ichixgo Apr 19 '16 at 16:19
  • @user180321 -- your post has been migrated to the tex site, not deleted. you may have to register for the tex site to be able to accept or upvote an answer. – barbara beeton Apr 20 '16 at 02:03
2

there is a \dotplus symbol in the amsfonts collection. insert

\usepackage{amssymb}

in your preamble. then you can use \dotplus (in math) in the body of your document. amssymb loads amsfonts automatically, so you get access to a lot of other math symbols as well.

actually, this question should be considered a duplicate of How to look up a symbol or identify a math alphabet? but since you're coming from a totally non-tex site, i've given a detailed answer.

  • @user180321 -- the "history" of this question shows that you're coming from the apple site. if you're going to be using tex, and think you might have more questions, please register also for this site -- tex.stackexchange.com. – barbara beeton Apr 20 '16 at 02:25