LaTeX forum ⇒ Text FormattingTrying to typeset basic maths

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
PaulSutton
Posts: 7
Joined: Wed Apr 15, 2020 1:26 pm

Trying to typeset basic maths

Postby PaulSutton » Sun Apr 19, 2020 7:39 pm

Hi

A few years ago, I created a book , which was more of a mini latex project to produce a set of instructions on how to create loops and nested loops in Scratch and Python.

Since then I have developed my LaTeX skills further, I am now trying to re-write this as Scratch 3 is now out, but I can also apply some of what I have learned over the last few years.

You can view the early start here

https://www.overleaf.com/read/tfnygttksnxz

I am trying to typeset the maths to explain the fact that if we are repeating the loop 72 times we need to move the turtle 5 degrees, each time as 360 divided by 5 = 72

I seem to be having issues type setting this,, as line 94 gives me undefined control sequence.,

$360 \div 5 = 72$

I am not too sure what I am doing wrong, I have tried to use the amsmath package but I am sure i don't actually need this.

I am aware also that it is throwing up errors as my images is using explicit placing [h] but I will make a separate post on that issue.

I know the solution is probably something really simple that I am just overlooking but I am not going to learn via trial and error as this will eventually fix it, but I won't understand why.

Thank you for any help

Paul Sutton

Bartman
Posts: 97
Joined: Fri Jan 03, 2020 2:39 pm

Postby Bartman » Sun Apr 19, 2020 8:13 pm

There is a typo in \texfbf, but the command is called \textbf.

Why do you use the \paragraph command at these places? Should the text simply be highlighted in bold?

Some off-topic remarks:

The inputenc package with the utf8 option is no longer necessary since april 2018. You can find out more in ltnews.

In most cases, the hyperref package should be loaded last.

pgf/TikZ loads xcolor and graphicx.

The command \tikzstyle is out of date.

I would like to recommend one of the following replacements in the source code of the flowchart, so that the connection arrow does not overlap the rectangular node:

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. %\draw [arrow] (pro11) -- (pro3);% present
  2. \draw [arrow] (pro11.west) -- (pro3.east);% suggestion 1
  3. %\draw [arrow] (pro11.north west) -- (pro3.south east);% suggestion 2
  4. %\draw [arrow] (pro11) -- ($(pro11-|pro3)!.5!(pro11)$) |- (pro3);% suggestion 3


The third suggestion needs the calc library.

A matrix can set the distance between its nodes, so the yshift option would become unnecessary.

PaulSutton
Posts: 7
Joined: Wed Apr 15, 2020 1:26 pm

Postby PaulSutton » Mon Apr 20, 2020 9:05 am

Thank you for this, I will make the changes when I log back into Overleaf later and good point on drawing the arrows properly too, I was wondering about that.

It does look like the \texfbf command is throwing up the error, I was under the impression it was suggesting my maths formula was badly formatted.

I will remove the paragraph commands and just leave the text as it is, then use \textbf{} where I want to highlight something, which would be better.

Thanks again

Regards

Paul
Last edited by cgnieder on Sun Apr 26, 2020 5:38 pm, edited 1 time in total.
Reason: added inline code formatting


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 2 guests