Questions tagged [polymode]

Polymode is an emacs package that offers generic support for multiple major modes inside a single emacs buffer.

Polymode provides a framework for editing documents that combine multiple languages in a single file. Typical uses include markdown or LaTeX documents that include source code blocks. Polymode allows the user to edit the markdown or LaTeX text in the appropriate mode (ie., markdown-mode or AucTex), and seamlessly switches to the appropriate programming mode for the source code blocks.

Polymode also provides support for compiling documents, with configurable export functions. This allows the user to export a markdown or LaTeX document, along with its embedded source code, into a pdf or html document that includes the results of running the source code.

Project hompage

34 questions
11
votes
1 answer

Insert code chunk in R Markdown with yasnippet and polymode

I am trying to write a yasnippet to insert code chunks into an R Markdown file. I use polymode to have multiple major modes (markdown, ESS[S]) in a single file. This is my snippet: # -*- mode: snippet -*- # name: chunk # key: chunk # -- \`\`\`{r…
Kara Woo
  • 422
  • 3
  • 9
8
votes
1 answer

Can we get inline results with polymode for Rmd files?

As a new Emacs user, I've recently learned how to use polymode to handle R code in org-mode. I'm happy with it, since I get the same features than those implemented for example in Rstudio for Rmd files (e.g., facilities to execute code chunks and…
Philopolis
  • 1,094
  • 8
  • 14
6
votes
1 answer

ESS freezes on startup with ess-tracebug mode enabled

I am currently running R 3.3.1 in emacs 25.1.1, ESS 16.10, and polymode 20160805.448 installed via MELPA on Mac OS Sierra. Whenever I try to open an interactive R console using M-x R, it freezes immediately upon startup and I have to force quit…
6
votes
2 answers

How to set PDF export in polymode-mode to use xelatex engine?

Consider the below MWE of .Rmd file containing Arabic text which needs xelatex engine to be rendered by pandoc. As the documentation of the latter says putting this option would make it: --latex-engine=xelatex. MWE --- title: "Minimal Working…
doctorate
  • 1,789
  • 16
  • 39
6
votes
1 answer

What is the difference between the knitR and knitR-ESS for polymode?

I have recently setup polymode for use with Rnw and Rmd files. When it came to knit/weave a document I was given the choice of four defaults; knitR-ESS, Sweave, knitR and Sweave-ESS. I usually use knitR outside of emacs but I wondered what is the…
Hantabaru
  • 95
  • 3
4
votes
1 answer

Polymode with python and latex-mode

The polymode manual suggests that creating new polymodes should be very easy: Creating new polymodes typically takes a few lines of code. I wanted to set it up to make emacs to switch to python mode inside of pythontex commands and environments.…
student
  • 1,007
  • 9
  • 29
3
votes
1 answer

Polymode appears in minibuffer but does not weave into a file on Windows, why?

This is a follow-up post to Polymode installation on Windows machine. Accordingly I installed polymode using this code in the init.el file after ESS code: (require 'poly-R) (require 'poly-markdown) (add-to-list 'auto-mode-alist '("\\.Rnw" .…
doctorate
  • 1,789
  • 16
  • 39
3
votes
1 answer

Polymode installation on Windows machine

Polymode is very promising to handle the integration of R chunks using different modes. I went through the documentation and it works well when I am inside .Rmd file but not inside .Rnw. In the .Rnw I found the Noweb mode activated without polymode…
doctorate
  • 1,789
  • 16
  • 39
3
votes
1 answer

Unexpected indentation in python chunks

Already one year ago, I described a problem on github with polymode and unexpected indents. Since there was no answer there so far and the problem is really annoying, I ask here for ideas for a workaround of the problem: I am using polymode like…
student
  • 1,007
  • 9
  • 29
3
votes
1 answer

ESS poly-R issue

I am trying to setup ESS with polymode and poly-markdown I have the following in my myinit.org file which becomes compiled into init.el ;; https://polymode.github.io/installation/ (use-package poly-markdown :ensure t) ;;…
user4687531
  • 143
  • 5
3
votes
1 answer

Symbol's value as variable is void: polymode-mode-map

I define a function ess-rmarkdown to compile RMarkdown documents with polymode. (use-package polymode :ensure t :config (use-package poly-R) (use-package poly-markdown) ;;; MARKDOWN (add-to-list 'auto-mode-alist '("\\.md\\'" .…
Andrej
  • 145
  • 5
2
votes
0 answers

Styled components with polymode

Can I use polymode for styled components inside tsx or jsx files? For example: // MyComponent.tsx const x = 1; const y = 2; const myStyle = css` background-color: red; padding: ${x + y}; margin-left: ${y} `; I want the stuff inside the css…
2
votes
0 answers

Polymode very slow in Rmd files

I am struggling with emacs constantly hanging as soon as I move the cursor into a code chunk in Rmd files. It spends about two seconds moving the cursor after I hit an arrow key. Can you help me get normal response times from Emacs, so I can get…
John Doe
  • 53
  • 2
2
votes
0 answers

Markdown and Latex highlighting (font lock) in R Markdown file

I am using polymode to edit rmarkdown files. Exporting to e.g. pdf is super simple and works very well. R code chunks are also properly highlighted. But: I do quite often use latex code inside (r)markdown. Would it be possible to highlight the latex…
2
votes
1 answer

Polymode changes from ESS-mode to Markdown-mode whenever I press enter

When I am editing .Rmd file within a polymode chunk, the mode switches from ESS to Markdown mode whenever I press enter. However, it switches back to ess-mode whenver I save the file. I will try to demonstrate this: C-hvmajor-modeEnter major-mode…
riley.finn
  • 143
  • 9
1
2 3