Inserting/escaping special characters in text #1182
-
I'm having issues inserting special characters in text or tables when rendering as What is the recommended approach to insert or escape such characters?
Tested with Quarto v. 0.9.577 on RStudio v. 4.2.0, running on macOS Monterey. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Special character needs to be considered depending how you insert them. When you are writing between When you are writing in body, you are writing Markdown syntax. So if you want to use LaTeX directly to insert some symbol, you need to tell Pandoc to parse the content as raw LaTeX. For example, inserting Unicode character in LaTeX can work using XeLaTeX engine and special So inserted unicode by there hexadecimal would work using ``\symbol{"0394} Regarding tables, your example work for me. So not sure why not for you, maybe a difference in version. I just know that using raw LaTeX in tables may require you to specificy cat("\u0394T")
#> ΔT So there is unfortunately not one way to escape a special character as:
This
give me this Hope it helps |
Beta Was this translation helpful? Give feedback.
-
I did a bit more testing to get my head around the different ways to insert special characters and noticed that table captions don't behave the same depending on the package used to produce the table. In the example below, Quarto interprets the caption of I know that
|
Beta Was this translation helpful? Give feedback.
Special character needs to be considered depending how you insert them.
When you are writing between
$ $
, you'll right them in an inline math environment where\geq
is defined. If you want to add the mathematical symbol greater than or equal, it seems the right play. You could also write$4 \geq 2$
. with4$\geq$2
this is not identified as an equation, and\geq
is not recognized. hence not shown in output.When you are writing in body, you are writing Markdown syntax. So if you want to use LaTeX directly to insert some symbol, you need to tell Pandoc to parse the content as raw LaTeX. For example, inserting Unicode character in LaTeX can work using XeLaTeX engine and special
\char
comment …