Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Highlight spacing #26

Merged
merged 4 commits into from Apr 29, 2011

Conversation

Projects
None yet
3 participants

lq commented Apr 28, 2011

Is this OK? I am new to github.

Qiang Li added some commits Apr 18, 2011

R/pgfSweaveDriver.R: Generates Hinput environments instead of Houtput.
Houtput seemed strange. It surrounds both input and output, so customization
would also affect the results. I made it a inner environment of Schunk just
like Sinput, and renamed it to Hinput accordingly.
R/pgfSweaveDriver.R: Removed newline_latex() at the beginning of Sinput.
The {Sinput} environment should ensure the newline and determine the
surrounding space.
R/pgfSweaveDriver.R: cancel out the effect of hard newline at the end…
… of Hinput

Now we can define Schunk and Hinput based on trivlist, and Soutput based on
Verbatim, so that vertical spaces between text/chunk/text and code/output can
be individually set with \topsep, e.g.

\renewenvironment{Schunk}{\begin{trivlist}\item}{\end{trivlist}}
\RequirePackage{fancyvrb}
\renewenvironment{Hinput}{\setlength{\topsep}{0pt}\begin{trivlist}\item}
{\vspace{-\baselineskip}\end{trivlist}}
\RecustomVerbatimEnvironment{Soutput}{Verbatim}{listparameters={\setlength{\topsep}{\smallskipamount}}}
Removed hard newline_latex at the end of {Sinput}
Now the ugly hack \vspace{-\baselineskip} is avoided.

This is a nice set of commits! The highlight environment was obviously having some spacing problems and this fixes them nicely!

Owner

lq replied Apr 26, 2011

I am very happy to see this. Thank you very much for making this awesome package!

Hi I am happy to have these changes in pgfSweave, would you mind submitting a pull request for these commits?

cameronbracken added a commit that referenced this pull request Apr 29, 2011

@cameronbracken cameronbracken merged commit 0cdf578 into cameronbracken:master Apr 29, 2011

Owner

cameronbracken commented Apr 29, 2011

Perfect thanks!

Contributor

yihui commented Apr 30, 2011

Looks like a feature I've been longing for as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment