5

I am developing a presentation with the use of R slidify function. In my presentation I use diacritic marks from Polish language (Ą,Ć,Ę,Ł,Ń,Ó,Ś,Ź,Ż). I have noticed that their display (only in case of the presentation title slide) does differ depending on whether I render its html view via Knit HTML button in RStudio or I view the html file output generated by the slifidy function.

This is a screen from a "Knit HTML button view" presentation title slide:

enter image description here

This is a screen from an html file output generated by the slifidy function (in which I additionally marked some of outstandingly displayed marks):

enter image description here

Question: why does such difference in a font type occur and, more important, how to avoid this? (Please note it happens only in the title slide.)

My presentation begins with the structure:

---
title       : Mąlarądóałatrią o (ą,ć,ę,ł,ń,ó,ś,ź,ż ; Ą,Ć,Ę,Ł,Ń,Ó,Ś,Ź,Ż) 
subtitle    : Podtytuł mąlarądóałatrią o (ą,ć,ę,ł,ń,ó,ś,ź,ż ; Ą,Ć,Ę,Ł,Ń,Ó,Ś,Ź,Ż) 
author      : Imię Nazwisko 
job         : Pisanie prezentacji o (ą,ć,ę,ł,ń,ó,ś,ź,ż ; Ą,Ć,Ę,Ł,Ń,Ó,Ś,Ź,Ż) 
framework   : io2012        # {io2012, html5slides, shower, dzslides, ...}
highlighter : highlight.js  # {highlight.js, prettify, highlight}
hitheme     : tomorrow      # 
widgets     : []            # {mathjax, quiz, bootstrap}
mode        : selfcontained # {standalone, draft}
---

## Wstęp o ą,ć,ę,ł,ń,ó,ś,ź,ż ; Ą,Ć,Ę,Ł,Ń,Ó,Ś,Ź,Ż

[...] 
Marta Karas
  • 4,967
  • 10
  • 47
  • 77
  • 1
    I suspect it has to do with the encoding of the document. I believe when you do hit Knit HTML, the document is encoded as UTF-8, which leads it to slidify correctly, while the slidify function does not take care of it automatically. I will investigate and figure out the root cause. – Ramnath Dec 03 '13 at 01:08
  • In RStudio, while saving the Rmd file, can you try Save with Encoding, and ensure that you are saving it as UTF-8? – Ramnath Dec 03 '13 at 01:11
  • **Ramnath**, thank you for your interest! I do have UTF-8 set as *default encoding for source files*. For being 100% sure I just did the 'save with encoding -> UTF-8', and the result after running `slidify` is the same. Would you consider it a good temporary solution to set a font type to the type we can see in the first screen? (As in the second screen the diacritic marks are displayed *correctly*, it is just the font type which is inconsistent...) – Marta Karas Dec 03 '13 at 01:55
  • Ah. I see what you are talking about now. This is puzzling as to why the font type should change. Explicitly setting the font type might be a good idea, but I am not sure how you can do that. – Ramnath Dec 03 '13 at 14:13
  • I would guess it is related to the fonts family definitions in .css documents, that are different in `io2012` framework (which I use) and in the other one .css that is used during *after hitting Knit HTML* rendering. I have just changed the order of the font families in the file `.\mydeck\libraries\frameworks\io2012\css\slidify.css` - set the `Calibri` font as the first one - and now the title slide is displayed ok. – Marta Karas Dec 03 '13 at 23:14
  • @Marciszka I'm having a similar issue and changed the first one but i still get a different font as you show in the first image. I'm using the dev version of both slidify and slidifyLibraries. Could you answer with the content of the css this question? – marbel Dec 17 '13 at 03:03
  • @[Martín Bel], I did so, hope it helps! – Marta Karas Dec 17 '13 at 09:59

1 Answers1

0

As I wrote in the comments below my question, I eventually decided to solve this problem by modifying the .css file: \mydeck\libraries\frameworks\io2012\css\slidify.css.

Here is the default .css file I receive after first slidify over a document, and here you can find customized .css file which deals with the font type inconsistency. (Of course, in the slidify files directory it is going to exist under "old" slidify.css name.) The only changes I applied are these under

/* Styles for Title Slide */

section.

Marta Karas
  • 4,967
  • 10
  • 47
  • 77