Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Split the title onto multiple lines?

In an R markdown document (html and presentations), is it possible to manually split the title onto multiple lines? I tried playing with pipes which produces orrendous output.

--- title:  'A title I want to split on two lines' author:  date:  output:   ioslides_presentation --- 
like image 212
Thomas Speidel Avatar asked May 29 '15 19:05

Thomas Speidel


People also ask

How do you split a cell into multiple lines?

Click in a cell, or select multiple cells that you want to split. Under Table Tools, on the Layout tab, in the Merge group, click Split Cells. Enter the number of columns or rows that you want to split the selected cells into.

How do you title multiple lines in Excel?

Type the first line. Press Alt + Enter to add another line to the cell. Tip. Keep pressing Alt + Enter until the cursor is where you would like to type your next line of text.


2 Answers

For an HTML output just us the <br> tag while if your output is a PDF or PDF presentation standard LaTeX code to break line given by \\ should work.

Example

--- title:  'A title I want to <br> split on two lines' author:  date:  output:   ioslides_presentation --- 

For PDF

Just to rule out possibilities, I've tried to put \\ or \newline, both do not split, so for PDF seems to be a little bit tricky. \linebreak stop knitr parsing. Maybe another user can solve this question for knitr PDFs.

like image 184
SabDeM Avatar answered Sep 18 '22 18:09

SabDeM


Examples for adding an abtract show the use of pipes | to break lines and include paragraphs. This works as well for the title and other yaml elements. For an abstract or title:

--- abstract: |     What works for the abstract.      Works for the title, too! title: |     | title      | subtitle output: pdf_document  --- 
like image 20
Philipp R Avatar answered Sep 19 '22 18:09

Philipp R