quarto yaml to render qmd files that start with _ - rstudio

I'm playing around with two different models for my website in quarto, one includes all the chapters in the index.qmd file so I have to name each chapter with an underscore in front.
When I try to render the chapters separately, they aren't rendered as they start with _, e.g. "chapters/_02-Intro_to_analysis_software.qmd".
I've tried explicitly telling quarto to render these chapters using _quarto.yml
project:
type: website
render:
- index.qmd
- about.qmd
- "chapters/_01-Intro_to_quant_methods.qmd"
- chapters/_02-Intro_to_analysis_software.qmd
But when I run quarto render it only renders the about and index qmd files.
[...]
label: unnamed-chunk-1
|......................................................................| 100%
ordinary text without R code
?[31moutput file: index.knit.md
?[39m←[1m←[34m[2/2] about.qmd←[39m←[22m
Output created: _site\index.html
How do I get quarto to render files that start with an underscore?

Related

Quarto: Pagebreak before all level 1 headings

I am new to Quarto and I don't know yet how to apply global styles for PDF documents. Obviously I can't use CSS to render PDFs. So what is the equivalent for PDF?
How can I, for example, add a pagebreak automatically before each level 1 heading?
Thank you!
winnewoerp
Have a look at this section in the quarto documentation. You could for instance use the include-in-header functionality and this answer, e.g.
---
format:
pdf:
include-in-header:
text: |
\let\oldsection\section
\renewcommand\section{\clearpage\oldsection}
---
# First Section
## First Subsection
# Second section

Using fancyhdr in YAML metadata produces multiple page numbers with Pandoc

I'm using Pandoc to generate a PDF from markdown. When specifying header/footer information in the YAML metadata (as below), I continue to get a page number in the center of my footer (with the text of \fancyfoot[L] written overtop), in addition to the page number in footer on the right that I've specified with \fancyfoot[R].
How can I remove the default page number in the footer at center? If I use \pagenumbering{gobble} it just removes all page numbers, at center and on right.
---
title: Test Title
author: Author Name
header-includes:
- \usepackage{fancyhdr}
- \pagestyle{fancy}
- \fancyhead[L]{Author Name}
- \fancyhead[R]{Test Title}
- \fancyfoot[L]{Extra text here}
- \fancyfoot[R]{\thepage}
---
Currently using Pandoc 1.17.2 on OSX 10.11.6.
Well, I think this should work if you just give the center field an empty content field. That is at least one way in which it works in Latex and hopefully the same for pandoc.
\fancyfoot[C]{}

My `pdf` generated through RTD is having all articles of content in the heading content Why?

I have just recently (yesterday) started using sphinx and read the docs for my project.
Till now I am happy with the Html documentation but the pdf version includes all the articles That appear in the index within the Contents heading. And the Documents orignal content/index is simply comprised of two links.
Please help.
The documentation is at http://todx.rtfd.io and the pdf is here.
When generating the PDF, Sphinx is always adding the content that is referenced via a .. toctree:: directive exactly where the directive is placed.
In contrast, when generating HTML, Sphinx is placing the content after the file that contains the toctree.
In this aspect, PDF generation and HTML generation are simply inconsistent.
Thus, you should place all content of the index page before the table of contents.
In case you want to provide an overview of the most important sections inline, you can use a list of references. Then, you might want to hide the toctree using the hidden property, for example like this:
Contents
--------
- :ref:`quickstart`
- :ref:`userguide`
Features
--------
- Fast
- Simple
- Inituitive
- Easy to Use
- Offline
- Open Source
.. toctree::
:hidden:
quickstart
userguide

How can I specify a collection as data within a page, rather than pages within a subfolder?

As I understand it, docpad utilizes collections in order to easily group and list files that are slated to be rendered (ex. posts, pages). I have a large list of pdf documents (publications from a journal) that I want to specify as a collection so I can write a script that will collect and post them all onto a single page. As far as I can tell, you can only define metadata once on a collection page, and I don't really want to create 50+ pages for each individual publication.
I'm more familiar with the functionality backbone itself uses to specify collections, but I'm not sure how the two (docpad & backbone) interact.
Docpad uses collections to manage the files within a project, not just those that are slated to be rendered. Files in the "document" directory are those that need to be rendered. Those in the "files" directory are those that do not need to be rendered. Those files are simply copied to the "out" dir. What this means is that you can simply place your pdfs in the files dir. This will add your pdfs to the docpad collection and can be accessed in the docpad.coffee file like this:
collections:
# Create a collection called posts
# That contains all the documents that will be going to the out path posts
posts: ->
#getCollection('documents').findAllLive({relativeOutDirPath: 'posts'},[{date:-1}])
# Create a collection called pdfs
# That contains all the files in the pdf directory that originate in the source
# file directory
pdfs: ->
#getCollection('files').findAllLive({relativeOutDirPath: 'pdfs'})
Then create an eco template page to list the pdf files (I would stick this in the pdf folder under documents).
---
layout: 'default'
title: 'My PDF collection'
---
<ul>
<%pdfcollection = #getCollection('pdfs').toJSON()%>
<%for pdf in pdfcollection:%>
<li><%-pdf.url%></li>
<%end%>
</ul>
If you don't want to have the actual pdf files in your website - just display a list - then you could simply type/copy the list into a document and format it as markdown. Something like this:
---
layout: 'default'
title: 'My PDF collection'
---
* [MyPdf](http://pdf.org/) - Pdf about pdfs
* [MyPdf](http://pdf.org/) - Pdf about pdfs
* [MyPdf](http://pdf.org/) - Pdf about pdfs
* [MyPdf](http://pdf.org/) - Pdf about pdfs
Third possibility, which I haven't tested, if you have a list in a text file and really must convert its contents to a collection within Docpad, I would manually create a collection that is seperate from the docpad file collection and assign it as a property of templateData within the docpad.coffee file. This will make the collection available to any page within your site. In the events section of docpad.coffee create a handler for the renderBefore event and open your list text file, loop through it and add the values in each line to your collection.
fs= require('fs')
renderBefore: (opts,next) ->
fs.readFile file, (err,data) ->
arr = data.split('\r\n')
for line in arr
#add to collection etc...

drupal: how to assign the presets imagecache to different outputs of the modules?

I have a drupal site to continue from another programmer, What I recently can't figure out what to do is where it is assigning the presets from imagecache to the blocks for example I have last news posted - uses a preset from the image posted on the article then on the front page i have a gallery with some articles that uses other preset , and so on.. I just can't figure out where are assigned..
In Drupal they are defined in numerous places.
In configuration: Admin › Content › MyContentType › Display Fields.
In the theme functions. e.g. a function called theme_mymodule_someblock() would return rendered HTML. Inside that function, imagecache can be called to generate an img-tag. Search for theme('imagecache',...).
In template preprocessors: e.g. many themes will override the user-picture preprocessor to build their own. Aquia has an example of such a preprocessor. In those processors you will then see imagecache being called trough theme('imagecache', ...) to build an img tag.
In the template files often themers decide to ignore all above, ignore all settings and preprocessed and defaults and simply print a theme('imagecache', ...) result in one of the many tpl.php.

Resources