- MacTeX : MacTeX-2015

- TeXworks : TeXworks-Mac-0.4.5-r1280-MountainLion

When I am trying to typeset my TeX file with pdflatex, I get the following error:

The program "pdflatex" was not found.

You need a TeX distribution like MacTeX installed on your system to typeset your document.

When a TeX distribution is installed you may need to tell TeXworks where to find it in Edit -> Preferences -> Typesetting.

This is the mistake I need to fix for every big update in the operating system. And, everytime, I am losing myself in web to find the answer. This time, I am giving the answer for the fix. We need to locate the tex distribution for TeXworks:

TeXworks -> Preferences -> Typesetting]]>

Click the + button for the first box `Paths for TeX and related programs.` and choose the following folder:

/usr/local/texlive/2015/bin/x86_64-darwin

First we start with writing integral without any extra code. As you can see from the image, the integral sign will have nearly the text size, the limits will be very close to the function, and d for the derivative will be italic and will be seen as a variable.

"\, " will seperate the function and the derivative part; and "\mathrm{d}" will enlight that d is not a variable, but the notation for differantial.

Next we keep the integral line same, but added "\limits" to move the limits of the integral to the top/bottom of the integral sign.

Now, we will add these two lines of code before the "\begin{document}". Sadly, I cannot remember the source that I took this code from; but, still, thanks to the original writer.

If we write the integral in a normal way; the sign of the integral will be larger than the text size.

Again we keep these two lines of code before the "\begin{document}".

If we write the integral with the "limits".

Finally, I will give you an example of how I write an integral expression with evaluation part. I create the evaluate sign with "\bigg|".

**| **\let\normalint\

**|** \def\int{\displaystyle\normalint}

Again we keep these two lines of code before the "\begin{document}".

**|** $\int\limits_a^b f(x)\, \mathrm{d}x = \bigg|_a^b F(x)$

]]>Again we keep these two lines of code before the "\begin{document}".

\newcommand{\NAME}[NUMBER]{DEFINITION}

- NAME: Name of the new command,
- NUMBER: How many parameters new command,
- DEFINITION: What this new command does. If you have parameters you are using, you can refer to them by #1, #2 where numbers indicate the sequence of parameters given.

Now we will continue with examples:

- \newcommand{\be}{\beta}

...

Let $\be$ be a number.

Outcome: Let*β*be a solution. - \newcommand{\name}{Murat}

...

They call me \name{}.

Outcome: They call me Murat.

Note: When you are using newcommand for text only without any parameters, then do not forget to use {} at the end. For example; "\name is" will be compiled into "Muratis" but not "Murat is". - \newcommand{\fct}[1]{f(#1)}

...

Let $\fct{x}$ be a function.

Outcome: Let*f(x)*be a function. - \newcommand{\dis}[2]{||#1- #2||}

...

The distance between x and y is $\dis{x}{y}$.

Outcome: The distance between x and y is ||*x*−*y*||.

Note: The reason of this post to show how helpfull newcommand function can be. For example, you wrote a document and started using Euclidean distance like this example. But then, you wanted to change your distance from Euclidean to any distance function. Then all you need to do is changing the definition of \newcommand{\dis}[2]{||#1- #2||}. For example: \newcommand{\dis}[2]{|#1- #2|}, \newcommand{\dis}[2]{dis(#1,#2)}. So, you don't need to go over all of you document and change them one by one.

- Sumatra PDF updates the file when you change it. So you don't need to close the pdf file everytime before editing your LaTeX file and compiling it again.
- Sumatra PDF works very well with the backwards search option of LaTeX. If it is installed properly, when you double click on anything in your pdf file, backwards search highlights the corresponding area in your LaTeX file.

Sumatra PDF website]]>