joaotavora / darkroom

Simple distraction-free editing
147 stars 12 forks source link

doesn't work with ess-auctex files #3

Open pank opened 9 years ago

pank commented 9 years ago

hi,

In Rnw files when ESS is plugged into AUCTeX, darkoom-mode will be disabeled when you move from an R block to a LaTeX block.

Example move from the LaTeX part to the sweave part with darkoom-mode on:

end{center}
\begin{center}
\captionof{table}{Quantiles of value of payments\label{tab:quant}}
<<qunatile_transfer_types, echo=FALSE, results='asis'>>=
kable(quantile(report_year, report_month), digits=2, 
       booktabs=TRUE)
@ 
\end{center}

Rasmus

joaotavora commented 9 years ago

Do you have any idea how I can reproduce this, i.e. "plug" ESS into AUCTeX? Do I need any packages not in Emacs 24.5? Is the sample you posted enough to form such a Rnw file?

pank commented 9 years ago

It also resets the font size so I would assume the bug is in ESS/AUCTeX...

kguidonimartins commented 3 years ago

Hey @pank

Have you ever tried to apply the darkroom inside an ess-auctex block? I noticed something similar when using polymode for RMarkdown files (markdown-mode and ess-mode in the same buffer). When I apply the darkroom to markdown text, the buffer changes to the darkroom specification as expected. When I move the cursor to an ess chunk, the buffer maintains the font size and resets the margins. It can be resolved by applying the darkroom again within the ess chunk, and the entire buffer and all modes within it respect the darkroom margins. However, this last command doubles the font size. After a few adjustments to the font size, I'm good to go.

Thanks @joaotavora! I have tried other minor modes, and the darkroom is the best so far.