Vertical alignment in beamer presentation generated with R markdown - vertical-alignment

When I use R Markdown to create slides for a beamer presentation, the text is vertically centered, which really looks odd if you only want to use 1-2 lines a slide. Is there anyway to align the text to the top of the slide (under the slide caption)?
Looking for answer, I found this post and tried to use it in R Markdown, but nothing I tried worked.
You can change the horizontal text alignment and font size for instance by using these commands
\begin{flushright}
\begin{tiny}
bla..
\end{tiny}
\end{flushright}
is there something similar for vertical text alignment? So far I've tried this:
Attempt 1:
---
title: "Untitled"
author: "Author"
date: "25 Januar 2017"
output: beamer_presentation
---
\documentclass[t]{beamer}
## Caption 1
test
Attempt 2:
---
title: "Untitled"
author: "Author"
date: "25 Januar 2017"
output: beamer_presentation
---
## Caption 1
\begin{frame}[t]
test
\end{frame}
Attempt 3:
---
title: "Untitled"
author: "Author"
date: "25 Januar 2017"
output: beamer_presentation
---
## Caption 1
\begin{flushleft}[t]
test
\end{flushleft}

Include classoption: t with the title, author, etc. For example:
title: "Title"
author: "Author"
date: "Date"
output: beamer_presentation
classoption: t

Related

i have problem in writing text in 16pt title along with 12pt text throughout the section in overleaf??/

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb} \usepackage[square,numbers]{natbib} \usepackage{graphicx} \usepackage{hyphenat} \usepackage{mathptmx} \usepackage{tgtermes} \usepackage{parskip} \usepackage[arrowdel]{physics} \usepackage{multicol} \usepackage{fontspec} \usepackage{tocloft} \usepackage{ragged2e} \usepackage[english]{babel} \usepackage{geometry} \setmainfont{Times New Roman} \newgeometry{top=2.5cm, right=2.5cm, bottom=2.5cm, left=3.5cm} \setlength{\columnsep}{1cm} \renewcommand\cftloftitlefont{\Large} \renewcommand\cftfigfont{\Large} \renewcommand\cftfigpagefont{\Large} \linespread{1.25} \pagenumbering{roman} \date{} \title{\textbf{\Large ELECTRONIC AND MAGNETIC PROPERTIES OF HALF HEUSLER ALLOY CoMnSb}}`
I want title of my all pages to be 16pt (here \Large with \documentclass[12pt] gives me 17pt title fontsize for ELECTRONIC AND MAGENTIC PROPERTIES OF HALF HEUSLER ALLOY CoMnSb)

Change font and time aixis labels in DyagrammeR>mermaid>gantt chart

I made this gantt chart in R using diagrammer::mermaid (reproducible code below):
It is nice, but I would like to:
Increase font size (I suppose this will make each line wider, making the current very long rectangle slightly more "square". I am fine with that)
Make the t-aixis labels more standard. The weeks for some, months for others seem very strange. I want to be able to tell the months and years apart in a concise way)
How can I implement these changes?
I am an R user with no knowledge of node.js, css, etc. I managed to find code snippets on the internet to create this, but do not understand anything about the style_widget or how to change it.
devtools::install_github('rich-iannone/DiagrammeR')
library(DiagrammeR)
library(tidyverse) #just for the pipe operator
style_widget <- function(hw=NULL, style="", addl_selector="") {
stopifnot(!is.null(hw), inherits(hw, "htmlwidget"))
# use current id of htmlwidget if already specified
elementId <- hw$elementId
if(is.null(elementId)) {
# borrow htmlwidgets unique id creator
elementId <- sprintf(
'htmlwidget-%s',
htmlwidgets:::createWidgetId()
)
hw$elementId <- elementId
}
htmlwidgets::prependContent(
hw,
htmltools::tags$style(
sprintf(
"#%s %s {%s}",
elementId,
addl_selector,
style
)
)
)
}
flx_BmP <- mermaid("
gantt
dateFormat YYYY-MM-DD
section Common
Application (1230 plants) :done, first_1, 2018-05-15, 2018-07-30
Elegible (1003) :done, first_1, 2018-06-15, 45d
Plants accept (576) :done, first_1, 2018-08-01, 2d
Q0 - Baseline (576) :done, first_1, 2018-08-02, 15d
Lottery (576) :done, first_1, 2018-09-10, 2d
section ITT (288)
Treated (223 77%) :done, first_2, 2018-09-20, 2018-12-15
Q1 :done, first_3, 2018-12-16, 2019-01-05
Q2 : first_3, 2019-06-01, 2019-06-15
section Control (288)
Q1 :done, first_3, 2018-12-16, 2019-01-05
Q2 : first_3, 2019-06-01, 2019-06-15
Treated (263) : first_3, 2019-06-16, 2019-09-15
") %>%
style_widget("display:none", "line.today")
flx_BmP
For axis format (question 1.), maybe your search for this :
axisFormat %d/%m
Doc : https://mermaidjs.github.io/gantt.html
Example :
gantt
title Gantt
dateFormat DD-MM-YYYY
axisFormat %d/%m
section One
Task One : 07-05-2019, 7d
Task Two : 09-05-2019, 7d
I don't know for the font size.
Link to a demo with your code : https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjo...

Unable to render footer using Asciidoctor pdf

I'm trying to render a document with asciidoctor-pdf which has a footer with chapter title/page number. From the examples found so far I have come with this:
= Title of the book
:notitle:
:toc: left
:toclevels: 8
:sectnums:
:sectnumlevels: 8
:source-highlighter: coderay
:icons: font
:front-cover-image: pic.jpg
footer:
height: 0.5in
line_height: 1
recto_content:
right: '{chapter-title} | *{page-number}*'
verso_content:
left: '*{page-number}* | {chapter-title}
== Chapter 1
However it does not produce the footer. I've tried both using the footer and the :footer top directive.
Any help what could be wrong?
If you want to style your pdfs you can not put your settings in the adoc-file. You have to use pdf-theming. You find a long explanation here
A very short summary looks like
create a file basic-theme.yml in directory themes (example for basic-theme.yml)
put your footer settings basic-theme.yml
use your styles asciidoctor-pdf -a pdf-stylesdir=themes -a pdf-style=basic Details

Show flot timeline ticks on both top and bottom

I have been using flot for a couple days and its great, but I can't seem to find an answer to this:
Is it possible to display the xaxis/timeline ticks on both the top and bottom of my chart?
My chart has a large height and it's hard for the user to know which date the points are on when scrolling away from the top where the time ticks are currently displayed.
I searched around and all I found was this one issue on github which appears to have never been implemented:
https://github.com/flot/flot/issues/1040
Thanks in advance!
You can't do that with the default options, but it is possible with a workaround:
Duplicate your data series, use the normal options plus xaxis: 1 for the first one while making the second one invisble with this options:
points: {
show: false
},
lines: {
show: false
},
xaxis: 2
Use this options for the x axes:
xaxes: [{
position: "top"
}, {
position: "bottom",
alignTicksWithAxis: 1
}],
See this fiddle for a full example.

Flot Chart - Custom coloring of the graphic content for defining different ranges

I have 2 ranges on the graph, so called ; green and red zones.
You can see it in the fiddle.
What I am out after is to have a graph where the green range should be between 2-4 (y-axis) specifically for the 11-13 values of x axis. Basically I would like to have 2 different ranges .
Anyone knows how to do it ?
Edit :
To make it more clear with Michel's solution; I basically would like to add another green zone that is located in up-right of the previously located green zone (let it be in x(13,16) and y(4,6) ).
Please check the newer version ;
http://jsfiddle.net/shamaleyte/4zmgrpwz/
I've created a simple plugin for Flot to use in order to get shamaleyte his desired result.
Either create a new file and copy-paste the contents in it or download the plugin
Refer to it just as every other javascript file
<script type="text/javascript" src="path/to/file.js"></script>
And add areaMarkings to the grid object in the options.
You were on the right track!
The way Flot draws the markings of the chart is simply to overlap everything! Layer upon layer upon layer.
What I've done to accomplish it is the following:
#1: First of I drew the xaxis between x=11 and x=13 for the green area. It's a giant area that spans from the y=0 all the way to y=12 on the yaxis.
#2: Then I filled in the entire yaxis between y=0 and y=2, this overlapped the green area on the yaxis to create a red area spanning from left(x=10) to right(x=15)
#3: With the bottom yaxis row being red now, I then did the exact same for the top yaxis. Once again from left(x=10) to right(x=15) I filled in the entire y=4 to y=12 with a red area.
#4: I was now left with 2 white areas on the left and right side of the green area and between the red areas. All I had to do was fill those with red aswell. I did the same as I did with the green area, draw the red areas from the bottom to top. From x=0 to x=2 and from x=13 to x=15.
....
markings: [{
xaxis: {
from: 11,
to: 13
},
color: "#D7EEE1" // Green
}, {
yaxis: {
from: 0,
to: 2
},
color: "#F2CDEA" // Red - Bottom Row
}, {
yaxis: {
from: 4,
to: 12
},
color: "#F2CDEA" // Red - Top Row
}, {
xaxis: {
from: 10,
to: 11
},
color: "#F2CDEA" // Red - Left Column
},{
xaxis: {
from: 13,
to: 15
},
color: "#F2CDEA" // Red - Right Column
}]
....
Here's an updated fiddle that I think comes close to your expectations.

Resources