What's a good way to wrap every section in org-mode inside a LaTeX environment when exporting from org to LaTeX?
For example, say, I want to wrap each section in a minipage so that the width is smaller than a line that has been drawn over it.
For this .org file,
* Section 1
- S1 item 1
- S1 item 2
* Section 2
- S2 item 1
- S2 item 2
I want the export to produce this LaTeX:
\section{Section 1}
\hfill
\begin{minipage}{0.95\textwidth}
\begin{itemize}
\item S1 item 1
\item S1 item 2
\end{itemize}
\end{minipage}
\section{Section 2}
\hfill
\begin{minipage}{0.95\textwidth}
\begin{itemize}
\item S2 item 1
\item S2 item 2
\end{itemize}
\end{minipage}
Updated to say every section, instead of just one section.
command
(i.e. an interactive function) that wraps a region with the desired markup. That could be bound to a key so that you could conveniently execute it: mark a region, press key. That might be enough on its own, but it could also be used later on with something likeorg-map-entries
to step through the headlines and apply the function to each one.