1

I had written this in texniccenter, and when I did ctrl+F7 it gave me error as "undefined control sequence". I don't understand what I am doing wrong. Is there something wrong in my code? I also downloaded the package "bbm" and added it in the beginning but nothing is working. Can someone help me? Hope this is not too silly for this forum.

\documentclass{article}
\usepackage{amsmath}
\usepackage{bbm}
\begin{document}
\section{Problems}
\label{sec:Problems}
\begin{flushleft}
This approach helps a lot since equality cases can be easily obtained.
The left side's >equality case is $r = 1$.
The right side's equality case occur when $y = rx$ passes
through the interior of exactly $n$ squares.
Such cases occur when $r$ is either an
integer, reciprocal of an integer, $r \geq n$ or $0 < r \leq 1/n$.
  $\blacksquare$
\end{flushleft}

2.Determine all functions $f : \mathbb{R} \to \mathbb{R}$ such that
\[f(xy+f(x))=f(x)f(y)+x , \ \ \ \forall x,y \in  \mathbb{R}.\] 
\end{document}

This is what I wrote down. My alignment is pretty ugly here, and I apologise for that, but ugliness is better than incorrect code. Also, this is my first time using an editor. Usually I write on \LaTeX\ enabled platforms, such as math SE, MO etc. Also the part from "This approach..." is the ending of another problem, I omitted everything but kept this part so it might be clear about the errors. Also, I want to give a black square when the solution ends, I tried to give it, and that also gives "Undefined control sequence:. Please help me, thanks a lot.

David Carlisle
  • 757,742
shadow10
  • 111
  • 1
    Welcome to TeX.SX!](http://meta.tex.stackexchange.com/q/1436) Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Sean Allred Sep 28 '14 at 13:42
  • \mathbb is defined in amsfonts package – David Carlisle Sep 28 '14 at 13:43
  • Note that the editor used to create the file (texniccenter here) is not really relevant to the error message which comes from the underlying TeX system, I retagged the question removing the texniccenter tag – David Carlisle Sep 28 '14 at 13:50
  • I am writing a document and it came in between, should I post the whole code? I thought it would be too long. – shadow10 Sep 28 '14 at 13:55
  • No, you should reduce your code to the minimum that still demonstrates the issue, and post that. But to repeat what others have said: have you got \usepackage{amsfonts} or \usepackage{amssymb}? – Torbjørn T. Sep 28 '14 at 14:00
  • No, I have \usepackage{amsmath} and \usepackage{bbm} only. See the edit there. :) – shadow10 Sep 28 '14 at 14:12
  • Well, you need one of those. (http://tex.stackexchange.com/questions/38769) – Torbjørn T. Sep 28 '14 at 14:34
  • note you can mark code sections with {} button (which indents by 4 spaces) – David Carlisle Sep 28 '14 at 14:34

1 Answers1

1

If you want to use the package bbm, the correct command would be \mathbbm{R} here. But as you will need some more package for your \blacksquare I would recommend the package amssymb which is often used and contains the package amsfonts. The latter contains the command (\mathbb{R}) you are using at the moment.

I would recommend to use the following MWE:

% arara: pdflatex

\documentclass{article}
\usepackage{amssymb}
\usepackage{mathtools} % not needed here, but it loads most of the stuff you will need. E.g. `amsmath`

\begin{document}
\section{Problems}
\label{sec:Problems}
\begin{flushleft}
This approach helps a lot since equality cases can be easily obtained.
The left side's equality case is $r = 1$.
The right side's equality case occurs when $y = rx$ passes
through the interior of exactly $n$ squares.
Such cases occur when $r$ is either an
integer, reciprocal of an integer, $r \geq n$ or $0 < r \leq 1/n$.
 $\blacksquare$
\end{flushleft}

2. Determine all functions $f : \mathbb{R} \to \mathbb{R}$ such that
\[f(xy+f(x))=f(x)f(y)+x , \quad \forall x,y \in  \mathbb{R}.\] 
\end{document}

enter image description here

LaRiFaRi
  • 43,807
  • Thank you for your help, but when I do this, I still get errors, three errors are given {LaTeX error : File mathtools.sty not found.}, {Emergency stop}, {==> Fatal error occurred, no output PDF file produced!}, what should I do now? Please help me. – shadow10 Sep 28 '14 at 15:04
  • @shadow10 Are you using MiKTeX or TexLive? You should update your TeX distribution and search this site for "how to install packages". For my example you can leave mathtools away or you just load amsmath instead. – LaRiFaRi Sep 28 '14 at 15:07
  • I am using MikTeX. So mathtools package is not there in MikTeX? OK thanks a lot for that. – shadow10 Sep 28 '14 at 15:13
  • @shadow10 Open MiKTeX--Maintenance--Package Manager and search for mathtools. Then install it. – LaRiFaRi Sep 29 '14 at 08:46
  • OK, I seem to have another problem. See, I did install MikTeX but the shortcut is named "TeXmaker" there is another one I had installed, which is named "TeXworks", and I couldn't find the maintenance option anywhere. What am I doing wrong? Thanks. – shadow10 Sep 30 '14 at 10:49
  • @shadow10 Well, TeXmaker and TeXworks are both editors and thus not the right thing you are searching. There should be a folder MiKTeX in your start menu. You can search the MiKTeX installation itself on your hard drive. For me, the package manager can be found under D:\MiKTeX\miktex\bin\mpm.exe – LaRiFaRi Sep 30 '14 at 10:56