tables printed via kable()
: double negative signs --
are transformed into symbol endash (–
), being barely differentiable from -
. Why/How can I force a representation of --
?
#10384
-
DescriptionHello, I am a bit confused, and I do not know how this happens. Take the repo at https://github.com/Gewerd-Strauss/quarto-cli-10384 for a reprex. The function > df <- create_Experiments_instructions_DF(variants, repeats, parameter, unit, "degrees off of normal", "n","Variants/Filenames")
> df
degrees off of normal [°] n Variants/Filenames
1 -10 7 y-axis-tilt-gfa--10-1
2 NA NA y-axis-tilt-gfa--10-2
3 NA NA y-axis-tilt-gfa--10-3
4 NA NA y-axis-tilt-gfa--10-4
5 NA NA y-axis-tilt-gfa--10-5
6 NA NA y-axis-tilt-gfa--10-6
7 NA NA y-axis-tilt-gfa--10-7
8 -5 7 y-axis-tilt-gfa--5-1
9 NA NA y-axis-tilt-gfa--5-2
10 NA NA y-axis-tilt-gfa--5-3
11 NA NA y-axis-tilt-gfa--5-4
12 NA NA y-axis-tilt-gfa--5-5
13 NA NA y-axis-tilt-gfa--5-6
14 NA NA y-axis-tilt-gfa--5-7
15 0 7 y-axis-tilt-gfa-0-1
16 NA NA y-axis-tilt-gfa-0-2
17 NA NA y-axis-tilt-gfa-0-3
18 NA NA y-axis-tilt-gfa-0-4
19 NA NA y-axis-tilt-gfa-0-5
20 NA NA y-axis-tilt-gfa-0-6
21 NA NA y-axis-tilt-gfa-0-7
22 5 7 y-axis-tilt-gfa-5-1
23 NA NA y-axis-tilt-gfa-5-2
24 NA NA y-axis-tilt-gfa-5-3
25 NA NA y-axis-tilt-gfa-5-4
26 NA NA y-axis-tilt-gfa-5-5
27 NA NA y-axis-tilt-gfa-5-6
28 NA NA y-axis-tilt-gfa-5-7
29 10 7 y-axis-tilt-gfa-10-1
30 NA NA y-axis-tilt-gfa-10-2
31 NA NA y-axis-tilt-gfa-10-3
32 NA NA y-axis-tilt-gfa-10-4
33 NA NA y-axis-tilt-gfa-10-5
34 NA NA y-axis-tilt-gfa-10-6
35 NA NA y-axis-tilt-gfa-10-7 You notice that the column Unfortunately, if I render this to html, I get this table: Notice that the dash before the This will most definitely cause issues when names appear to map to two replicates of two completely different variants. So the question is how I can force For direct comparison:
I am currently on 1.5.54 Any suggestions on how to resolve this issue? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is again another occurence of the smart extension. It is already discussed for other use case
In your situation, this is probably because The way you create the table right now is not protected against any markdown parsing. If you had So you need to account for that when you have special content in your table. Some solution
You could also use Markdown table, but process your data for visualization by escaping any character in your columns data that should escape for all markdown processing. Same things that is need sometimes for HTML tables, or LaTeX tables with special character. In Quarto know that we parse HTML table, so output HTML tables is usually a good solution Hope it helps |
Beta Was this translation helpful? Give feedback.
This is again another occurence of the smart extension. It is already discussed for other use case
In your situation, this is probably because
kable()
will output Markdown table, and then Markdown is parsed by Pandoc with this extension activated which will conside--
as en-dashes.The way you create the table right now is not protected against any markdown parsing. If you had
y-axis-tilt-gfa-5-*1*
for example the*1*
, the output would have<em>
for emphasize, as*
means someting in Markdown.So you need to account for that when you have special content in your table. Some solution