I created a website using bookdown package and I have a nice table of content on the left, which is fine.
But now I would like to add the same table of content in a separate chapter (while keeping the toc on the left). I am looking to something somehow similar to what I can do in Latex when using \tableofcontent and be able to put the table of content whenever I want in any section. Is there a simple way to do so, without having to manually copy paste content from the html output?
Maybe I am not using the right keywords but I can't find any suggestions on how to do it.
Related
I am trying to add a custom header to a pdf via markdown. This page has been very helpfull. My working solution is below.
\addtolength{\headheight}{1cm}
\fancypagestyle{plain}{}
\rhead{\center\includegraphics[height=3cm]{path}}
\renewcommand{\headrulewidth}{0pt}
While this provides the desired solution on the title page with the correctly sized logo and space between the header and the text, there is extra blank space on the following pages. How can I remove (or control) the header spacing on pages > 1?
In your current working solution, you are using some LaTeX commands to build a custom header. If you want a custom header to exist only on the title page, then you could use the LaTeX commands that control the title page. Specifically, \begin{titlepage} \end{titlepage} and nest your header within. For more information on title pages, see this overleaf post.
For directly solving issues with spacing on all pages, you can use the geometry package in LaTeX. Here are some resources describing how it works: rmarkdown - set margins, overleaf geometry package. This will allow you more direct control over the spacing on every page.
I am trying to make a "accessible" or 508 compliant PDF using R markdown. To do this I need to have pdf tags attached to figure that provide alternative text. I also need to be able to add tags to section headers etc.
The idea is if you open the pdf in a pdf viewer that then the tags are read in in the "table of context" and allow a user to move between sections.
If you use a markdown header like
# header
R markdown seems to add a label to this so it appear in the table of context. I would like to be able to add these kind of labels manually as well.
Does anyone have any ideas of how to do this?
You should be able to achieve this using pandoc formatting (see http://pandoc.org/MANUAL.html), for example the alt text for an image can be specified as ![alt text or image title](path/to/image)
When I create plots within a single chunk of an R-Studio markdown file, they appear in a nice array with clickable thumbnails:
However, when I publish as an HTML file, these figures are simply displayed vertically, one after the other. Is there any way to achieve the way that it originally looks in RStudio?
Unfortunately there's no way to output what RStudio shows you, but you can do this and a lot of other HTML formatting yourself using the knitrBootstrap package.
Check out the end of this example for a clickable-thumbnail example.
When an RMarkdown document is knit to Word, the Table of Contents (if there is one) always appears at the beginning of the document. If I want to, say, make the Table of Contents appear on the second page of the document, how do I do so?
If I was knitting to HTML I could use this method, but it doesn't seem to work for Word. Meaning, I create a Word template to be used in the reference_docx YAML argument and put the Table of Contents at the bottom of this template, but when I knit a report the Table of Contents appears at the front of the document.
Preferably, I'd like to use a solution that doesn't rely on VBA/VBS and instead uses RMarkdown and (if necessary) a reference_docx file only.
As explained here, based on this and this, you could change the style of the date in the Word document to add a page break after it.
Of course, that only separates the title page from the table of contents and if you want to insert other pages between those two, it wouldn't work.
But at least that's an idea to start from.
I've just been playing around with this issue myself. Unfortunately, I don't think Word allows you to modify a style to insert a break after a style, only before.
However, the TOC header is a style that is created when a TOC is included and can be modified. If you change the TOC header style to include a page break before, save this as your reference style document and run it forces the TOC onto a new page when knit.
As #Ben notes though this only allow you to move the TOC off the title page, not insert it where you want within the document.
I was searching for a solution to this today and came across Garrick Aden‑Buie's blog post and render_toc() function.
Full details of which can be found here or his gist
This function allowed me to move the TOC later in to the document.
I am writing documentation for a notebook-based framework. When referring to important cells in a demo-notebook, can I point to a particular cell by using some sort of anchor?
For example if I have the demo-notebook at 127.0.0.1/mydemo, is it possible to refer to the input cell In[10] by some anchor tag like 127.0.0.1/mydemo#In10
Creating internal links within Markdown works quite well in practice for me. For example, you can make a table of contents by making a list in a markdown cell at the top of the page.
*[jump to code cell 2](#cell2)
*[jump to code cell 3](#cell3)
*[jump to code cell 4](#cell4)
Then you just insert a markdown cell right above the code cell you want to link to (say code cell 2). Just add one line of code:
<a id="cell2"></a>
See this tutorial for more explanation: http://nbviewer.ipython.org/github/rasbt/python_reference/blob/master/tutorials/table_of_contents_ipython.ipynb
I like to use headers to organize my notebooks, such as
#My title
in a markdown cell. In another location, I can then refer to this cell using
[Link to my title](#My-title)
in markdown (looks like you should replace spaces with hyphens).
I got this from a more complete answer here.
Not on stable, and only on Header(1-6) cell on master. Just click on the header cell and it will put the right anchor in the url bar, wich is usually #header_title_sanitized
Using the prompt number is not a good idea as it might change. It will be supported on nbviewer as well, we are working on it.