> > With the default value of org-babel-inline-result-wrap I get this > LaTeX > export: > > \section{Export this subtree raw to \LaTeX{}} > \label{sec-1} > Will shell-2 export 2 with a newline? > > Will r-2 export 2 with a newline? > > Will shell-2-raw export 2 with a newline? > > Will r-2-raw export 2 > with a newline? > \section{Export this subtree without raw to \LaTeX{}} > \label{sec-2} > > Will shell-2 export \texttt{2} with a newline? > > Will r-2 export \texttt{2} with a newline? > > Will shell-2-raw export \texttt{2} with a newline? > > \begin{verbatim} > Will r-2-raw export 2 > \end{verbatim} > with a newline? > % Emacs 24.3.1 (Org mode 8.2.5h) > > With org-babel-inline-result-wrap set to "%s" I get this: > > \section{Export this subtree raw to \LaTeX{}} > \label{sec-1} > Will shell-2 export 2 with a newline? > > Will r-2 export 2 with a newline? > > Will shell-2-raw export 2 with a newline? > > Will r-2-raw export 2 > with a newline? > \section{Export this subtree without raw to \LaTeX{}} > \label{sec-2} > > Will shell-2 export 2 with a newline? > > Will r-2 export 2 with a newline? > > Will shell-2-raw export 2 with a newline? > > \begin{verbatim} > Will r-2-raw export 2 > \end{verbatim} > with a newline? > % Emacs 24.3.1 (Org mode 8.2.5h) > > Note that there is no change in the LaTeX export of the R calls. > > I think this is a bug in ob-R.el. From my experiments, it behaves > differently than the other babel languages, including shell. > > For LaTeX export, the workaround is to avoid :results raw with R source > code blocks. Although a spurious newline is inserted into the source, > this is ignored by LaTeX. > I think it is allowable for raw results to include newlines. After if R returns a newline, the purpose of raw results is specifically to *not* change the result. I believe the best approach is to customize the inline results wrap as above, and then use non-raw processed results when inline results without newlines are desired. Does this sound reasonable? Best, > > All the best, > Tom -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D