Reputation: 1491
Is it possible to create "shortcuts" to sections, subsection etc. in the Tex part of RStudio? Similar to the R part where wrapping a "title" in ##### Title ##### creates a drop down curtain right above the console window.
Upvotes: 1
Views: 522
Reputation: 5958
You can use an empty code block. It will create the generation of the jump menu entries allowing the quick jumping and enable folding without altering output.
Here's the toy contents...
\documentclass{article}
\usepackage{Sweave}
\SweaveOpts{concordance=TRUE}
\title{Sample Sweave Document}
\author{Thell Fowler}
\begin{document}
\maketitle
\section*{Introduction}
<<\section*{Introduction}>>=
@
Some actual content.
\section{Concept}
<<\section{Concept}>>=
@
Some other content.
\subsection*{Algorithm}
<<\subsection*{Algorithm}>>=
@
<<HelperFunctions>>=
HelperFunction1 <- function() {
print( "That helped!")
}
HelperFunction2 <- function() {
print( "Oh, that helped too!")
}
@
<<MainFunction>>=
main <- function() {
print( "I need some help!")
HelperFunction1()
cat( "\tbut not enough! Let's get more help...\n")
HelperFunction2()
cat( "That's much better!\n")
}
@
\subsection*{Example}
<<\subsection*{Example}>>=
@
<<Example>>=
# We can get help.
main()
@
\subsubsection*{Pros}
<<\subsubsection*{Pros}>>=
@
\subsubsection*{Cons}
<<\subsubsection*{Cons}>>=
@
\end{document}
It may look like a pain, but it's pretty direct and simple.
Followed by VIM Mode Keys
Upvotes: 2
Reputation: 8061
Sorry, no, this is not implemented in RStudio for Sweave/TeX docs.
Upvotes: 0