Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code output does not work when using a seperate boilerplate / setup file #765

Closed
stephlocke opened this issue Apr 29, 2014 · 3 comments
Closed
Milestone

Comments

@stephlocke
Copy link

I like to have my styles for document in a separate file that can be accessed by any document I produce. Unfortunately, this seems to interfere with knitr's ability to add the correct LaTeX packages to the .tex file to then be converted to PDF when trying to output the source code.

I have produced a MWE at https://github.com/stephlocke/knitrhighlighting which shows how using an off file setup doc (rootdoc.Rnw) errors whilst including the content (rootdoc2.Rnw) does not.

Ideally, knitr should add any package setup after an \include{} or \input{} statement if it appears before \begin{document}

@yihui
Copy link
Owner

yihui commented May 1, 2014

knitr needs the \documentclass{} line so that it can add the required LaTeX preamble.

@stephlocke
Copy link
Author

I can confirm that adding the \documentclass{} statement, whilst not ideal, does work 👍

Thanks for getting back to me

@yihui yihui added this to the v1.6 milestone May 15, 2014
@yihui yihui closed this as completed May 15, 2014
@github-actions
Copy link

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants