How to print an asterisk ('*') in R Markdown
Asked Answered
B

4

44

I am trying to write in my R Markdown "3 times 6:10 and (3 times 6):10" all in complete letters (I am using times instead of *. My purpose is to put * instead of word times without any problem). However, it keeps giving me italic syntax for the part "6:10 and (3". How can I write my *s in R Markdown straight into the document without evoking * syntax which is make letters italic in the middle?

Belita answered 21/1, 2021 at 21:52 Comment(1)
very. _very_ related. https://mcmap.net/q/127937/-how-to-show-underscores-symbol-in-markdown/7941188Tumbrel
S
45

Escape '*' by using '\*' instead

Alternatively, you could use $\times$ to get the '×' symbol

Symbiosis answered 21/1, 2021 at 22:5 Comment(0)
M
22

On the web use *

That's one of it's HTML codes. (Only mention it because google brought me here when I didn't search about the R language and figure others will end up here as well.)

Manassas answered 30/9, 2021 at 17:7 Comment(2)
For clarity, this also works in RmarkdownSymbiosis
Wild. Revisiting this and there's 4 distinct ways to do it. (1) spaces around it ` * ` (2) escape with \* (3) use/set LaTeX times symbol instead with $\times$ (4) html code *Manassas
S
11

Markdown is quite sensitive to whitespace. If you don't put spaces around the * (line 3 below) you get the problem you're describing (markdown assumes the *s are italic-delimiters).

Some possible solutions

  • line 5: add spaces, no problem (except you might not want that spacing)
  • line 7 (@CaptainHat): set times as a LaTeX times symbol
  • line 9: set in code format
  • line 11 (@CaptainHat): protect *s with backslashes

Also tried @CaptainHat's suggestions as well as type-setting in code format ...) enter image description here

Other possibilities are to use the letter "x" for multiplication, or (if available on your keyboard/via compose-key) to use the × symbol (Unicode 00D7: instructions here).

Straightout answered 21/1, 2021 at 22:15 Comment(0)
N
1

Use Asterisk '*' in Markdown:

First Solution:

In markdown, print the asterisk symbol '*' with the help of the backslash symbol '\'.

Example: \*

Second Solution:

In markdown, print the asterisk symbol '*' with the help of the backtick symbol ( ` )

Print asterisk using quote with the backtick symbol

Nuncupative answered 31/12, 2023 at 5:19 Comment(1)
`*` is a good & simple advice, thanksLias

© 2022 - 2025 — McMap. All rights reserved.