Giter VIP home page Giter VIP logo

lstbayes's Introduction

Listings language drivers for BUGS, JAGS, and Stan

CTAN CTAN license

Adds support for the following languages to the LaTeX listings package, which pretty-prints source code:

Usage

To use, load the package

\usepackage{lstbayes}

Then use BUGS, JAGS or Stan as a language in one of the listings environments or commands. For example, to format the Stan Eight schools model,

\begin{lstlisting}[language=Stan]
data {
  int<lower=0> J; // number of schools 
  real y[J]; // estimated treatment effects
  real<lower=0> sigma[J]; // s.e. of effect estimates 
}
parameters {
  real mu; 
  real<lower=0> tau;
  real eta[J];
}
transformed parameters {
  real theta[J];
  for (j in 1:J)
    theta[j] <- mu + tau * eta[j];
}
model {
  eta ~ normal(0, 1);
  y ~ normal(theta, sigma);
}
\end{lstlisting}

Also see the examples in examples.tex and examples.pdf files included in this repository. See the listings documentation for more on how to use the listings package.

Issues

Development occurs on github at https://github.com/jrnold/lstbayes.

lstbayes's People

Contributors

jrnold avatar

Stargazers

Hayley Hemme avatar Julius Mehringer avatar Jose Storopoli avatar Brendan Rocks avatar Bruno Nicenboim avatar

Watchers

 avatar James Cloos avatar  avatar

lstbayes's Issues

Add built-in functions / distributions

Add them as new keywords (3rd order?). This would require more maintenance, as I'd have to update this package after every release. However, if I make them a lower order then it won't screw up the highlighting if there is a lag in updating.

Problem in the "generated quantities" section of a Stan program.

I get an incomprehensible error at the end of the typesetting of a Stan program (in the generated quantities section), included in a larger TeX source (itself generated by knitr).

The enclosed zip contains :

  • The .Rnw source (containing R source, executed by knitr, with no problems.)
  • The resulting .tex source
  • The compilation log
  • The Stan program whose listing is required.

I haven't the foggiest idea of the source of the problem.

This problem happens whether or not I use the listingsutf8 package or the code (beginning of the .Rnw file) used to transcode accented characters (I translated my program's comments in English, anyway...)

IRT.zip

Could this be pushed to CTAN ?

Dear Jeffrey,

Thank you for this addition to Stan and listings : this is really useful to Stan users who try to publish their work cleanly.
However, this packages is almost unfindable : I found it by accident by lurking on the stan-dev mailing list (Google group).
Could it be pushed either to the original listings.sty authors and/or CTAN ? This latter being even more important, since it would percolate to the major TeX distributions (TeXLive, MikTeX, etc...), thus making your package discoverable and useable.
Sincerely yours,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.