You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We aren't testing code that goes into the manual thoroughly and automatically enough. We need a framework where code citations in the manual are automatically extracted from running code and then pasted into the manual.
It looks like there are two main packages that are being used now. There's the listings and minted. I tried with minted because it does some useful things.
With minted, I was able to change the existing code blocks to be processed by minted.
Pros:
full syntax highlighting; I think @jrnold was behind it!
will be easy to include from files and specify start lines and end lines
will be able to remove blank spaces up front easily
there are options for syntax highlighting. Colors for keywords, etc.
Cons:
relies on python and the Pygments package, which is straightforward to install
it's slow. The manual currently builds in ~20 secs. With the minted package, it builds in ~2:20. That's without including files, etc. If we use a simpler lexer (just text instead of Stan), it still builds in ~2:00.
You mean it builds end to end from clean-all in 2 mins, or that each run of pdflatex takes 2 mins, so the whole thing takes like 10 mins+?
I'm not keen on dependencies, but then I added the fonts,
so I can hardly object if someone else thinks we need code
highlighting.
I really don't want too much highlighting---otherwise the code looks like an Xmas tree and I find it hard to read. Also, it might not print well if the colors aren't dark and high-contrast (not that I ever print anything). Also, the highlighting has to be correct. Inconsistent or incomplete highlighting is worse than none at all.
You mean it builds end to end from clean-all in 2 mins, or that each run
of pdflatex takes 2 mins, so the whole thing takes like 10 mins+?
I'm not keen on dependencies, but then I added the fonts,
so I can hardly object if someone else thinks we need code
highlighting.
I really don't want too much highlighting---otherwise the code looks like
an Xmas tree and I find it hard to read. Also, it might not print well if
the colors aren't dark and high-contrast (not that I ever print anything).
Also, the highlighting has to be correct. Inconsistent or incomplete
highlighting is worse than none at all.
You committed a verison with \usemintedstyle{friendly}.
This is way too slow. It takes over 1s/page on my machine,
and it needs multiple pass, so I estimated over half an hour
and got bored waiting and gave up.
Maybe we could do this for release version, but for
work-in-progress this is going to be a huge drag on my
working on the manual.
I wrote this entire email between pages 110 and 297.
You mean it builds end to end from clean-all in 2 mins, or that each run
of pdflatex takes 2 mins, so the whole thing takes like 10 mins+?
I'm not keen on dependencies, but then I added the fonts,
so I can hardly object if someone else thinks we need code
highlighting.
I really don't want too much highlighting---otherwise the code looks like
an Xmas tree and I find it hard to read. Also, it might not print well if
the colors aren't dark and high-contrast (not that I ever print anything).
Also, the highlighting has to be correct. Inconsistent or incomplete
highlighting is worse than none at all.
You mean it builds end to end from clean-all in 2 mins, or that each run
of pdflatex takes 2 mins, so the whole thing takes like 10 mins+?
I'm not keen on dependencies, but then I added the fonts,
so I can hardly object if someone else thinks we need code
highlighting.
I really don't want too much highlighting---otherwise the code looks like
an Xmas tree and I find it hard to read. Also, it might not print well if
the colors aren't dark and high-contrast (not that I ever print anything).
Also, the highlighting has to be correct. Inconsistent or incomplete
highlighting is worse than none at all.
I really hate that output. Maybe if all the colors
were darker and less opposite each other and there was
no bold to mess up weight I might be able to learn to
accept it if everyone else really really wants highlighting.
Seems to have failed somehow at the end, but the real problem
is that it takes a long long time.
> make clean-all
> time make manual
...
make[1]: *** No rule to make target `stan-reference.w18'. Stop.
Latexmk: All targets (stan-reference.pdf) are up-to-date
building src/docs/stan-reference/stan-functions.txt
cp src/docs/stan-reference/stan-reference.pdf doc/stan-reference-2.11.0.pdf; cp src/docs/stan-reference/stan-functions.txt doc/stan-functions-2.11.0.txt;
real 17m16.612s
user 15m28.673s
sys 1m39.578s
Running with make -j4 doesn't seem to be any faster.
I really hate that output. Maybe if all the colors
were darker and less opposite each other and there was
no bold to mess up weight I might be able to learn to
accept it if everyone else really really wants highlighting.
Seems to have failed somehow at the end, but the real problem
is that it takes a long long time.
> make clean-all
> time make manual
...
make[1]: *** No rule to make target `stan-reference.w18'. Stop.
Latexmk: All targets (stan-reference.pdf) are up-to-date
building src/docs/stan-reference/stan-functions.txt
cp src/docs/stan-reference/stan-reference.pdf doc/stan-reference-2.11.0.pdf; cp src/docs/stan-reference/stan-functions.txt doc/stan-functions-2.11.0.txt;
real 17m16.612s
user 15m28.673s
sys 1m39.578s
Running with make -j4 doesn't seem to be any faster.
Bob
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
Why do you want to do this? Is it that people want syntax
highlighting? If it's not subtle (by which I mean you can
barely see it at arm's length), I'm going to object.
I really hate that output. Maybe if all the colors
were darker and less opposite each other and there was
no bold to mess up weight I might be able to learn to
accept it if everyone else really really wants highlighting.
Seems to have failed somehow at the end, but the real problem
is that it takes a long long time.
> make clean-all
> time make manual
...
make[1]: *** No rule to make target `stan-reference.w18'. Stop.
Latexmk: All targets (stan-reference.pdf) are up-to-date
building src/docs/stan-reference/stan-functions.txt
cp src/docs/stan-reference/stan-reference.pdf doc/stan-reference-2.11.0.pdf; cp src/docs/stan-reference/stan-functions.txt doc/stan-functions-2.11.0.txt;
real 17m16.612s
user 15m28.673s
sys 1m39.578s
Running with make -j4 doesn't seem to be any faster.
Bob
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
I want to split out the Stan code chunks into valid Stan programs. We can
include bits of it in the manual. Then, we'd be able to test that the
chunks in the manual compile and we can generate output for the manual so
we can keep up to date with output.
Why do you want to do this? Is it that people want syntax
highlighting? If it's not subtle (by which I mean you can
barely see it at arm's length), I'm going to object.
I really hate that output. Maybe if all the colors
were darker and less opposite each other and there was
no bold to mess up weight I might be able to learn to
accept it if everyone else really really wants highlighting.
Seems to have failed somehow at the end, but the real problem
is that it takes a long long time.
> make clean-all
> time make manual
...
make[1]: *** No rule to make target `stan-reference.w18'. Stop.
Latexmk: All targets (stan-reference.pdf) are up-to-date
building src/docs/stan-reference/stan-functions.txt
cp src/docs/stan-reference/stan-reference.pdf
doc/stan-reference-2.11.0.pdf; cp src/docs/stan-reference/stan-functions.txt
doc/stan-functions-2.11.0.txt;
real 17m16.612s
user 15m28.673s
sys 1m39.578s
Running with make -j4 doesn't seem to be any faster.
Bob
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
I want to split out the Stan code chunks into valid Stan programs. We can
include bits of it in the manual. Then, we'd be able to test that the
chunks in the manual compile and we can generate output for the manual so
we can keep up to date with output.
Why do you want to do this? Is it that people want syntax
highlighting? If it's not subtle (by which I mean you can
barely see it at arm's length), I'm going to object.
I really hate that output. Maybe if all the colors
were darker and less opposite each other and there was
no bold to mess up weight I might be able to learn to
accept it if everyone else really really wants highlighting.
Seems to have failed somehow at the end, but the real problem
is that it takes a long long time.
> make clean-all
> time make manual
...
make[1]: *** No rule to make target `stan-reference.w18'. Stop.
Latexmk: All targets (stan-reference.pdf) are up-to-date
building src/docs/stan-reference/stan-functions.txt
cp src/docs/stan-reference/stan-reference.pdf
doc/stan-reference-2.11.0.pdf; cp src/docs/stan-reference/stan-functions.txt
doc/stan-functions-2.11.0.txt;
real 17m16.612s
user 15m28.673s
sys 1m39.578s
Running with make -j4 doesn't seem to be any faster.
Bob
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or mute the thread.
Activity
betanalpha commentedon Nov 21, 2013
Extend this to example I/O. The introduction is riddled with references to stan_major=1, etc.
syclik commentedon Apr 4, 2015
I'll try to create a branch that uses the listings latex package.
syclik commentedon Sep 2, 2016
It looks like there are two main packages that are being used now. There's the
listingsandminted. I tried withmintedbecause it does some useful things.With
minted, I was able to change the existing code blocks to be processed by minted.Pros:
Cons:
pythonand thePygmentspackage, which is straightforward to installThoughts?
I'm going to try
listingsas a comparison.syclik commentedon Sep 2, 2016
If anyone wants to try minted, use this branch: feature/issue-319-manual-testing.
To change the style of how the code is rendered, change line 211 of stan-manuals.sty:
\usemintedstyle{friendly}I tried with
\usemintedstyle{bw}and it'll generate the Stan code like it is in the manual now.bob-carpenter commentedon Sep 2, 2016
What's the output look like?
You mean it builds end to end from clean-all in 2 mins, or that each run of pdflatex takes 2 mins, so the whole thing takes like 10 mins+?
I'm not keen on dependencies, but then I added the fonts,
so I can hardly object if someone else thinks we need code
highlighting.
I really don't want too much highlighting---otherwise the code looks like an Xmas tree and I find it hard to read. Also, it might not print well if the colors aren't dark and high-contrast (not that I ever print anything). Also, the highlighting has to be correct. Inconsistent or incomplete highlighting is worse than none at all.
syclik commentedon Sep 2, 2016
With the
bwstyle, it looks like the existing manual.I checked in a version that'll make it look like a Christmas tree. (I just
did that to demonstrate that we could.)
It builds end to end from clean-all in 2 minutes and change.
On Fri, Sep 2, 2016 at 12:57 PM, Bob Carpenter notifications@github.com
wrote:
bob-carpenter commentedon Sep 2, 2016
You committed a verison with \usemintedstyle{friendly}.
This is way too slow. It takes over 1s/page on my machine,
and it needs multiple pass, so I estimated over half an hour
and got bored waiting and gave up.
Maybe we could do this for release version, but for
work-in-progress this is going to be a huge drag on my
working on the manual.
I wrote this entire email between pages 110 and 297.
bob-carpenter commentedon Sep 2, 2016
What are you running on? Did you have to do something
to juice Python?
syclik commentedon Sep 2, 2016
No idea. I'm using python 2.7.10 and I just installed Pygments today.
bob-carpenter commentedon Sep 2, 2016
I really hate that output. Maybe if all the colors
were darker and less opposite each other and there was
no bold to mess up weight I might be able to learn to
accept it if everyone else really really wants highlighting.
Seems to have failed somehow at the end, but the real problem
is that it takes a long long time.
Running with make -j4 doesn't seem to be any faster.
syclik commentedon Sep 2, 2016
I saw that error too.
Changing the style to bw helps, but yes, the time is a killer. I'll try the listings package out. Less dependencies is better.
bob-carpenter commentedon Sep 2, 2016
Why do you want to do this? Is it that people want syntax
highlighting? If it's not subtle (by which I mean you can
barely see it at arm's length), I'm going to object.
syclik commentedon Sep 2, 2016
I want to split out the Stan code chunks into valid Stan programs. We can
include bits of it in the manual. Then, we'd be able to test that the
chunks in the manual compile and we can generate output for the manual so
we can keep up to date with output.
On Fri, Sep 2, 2016 at 2:00 PM, Bob Carpenter notifications@github.com
wrote:
bob-carpenter commentedon Sep 2, 2016
OK. I could live with runtime for that functionality.
But the style has to be beter.
How would we markup the files that get included?
Also, this seems like a very low priority compared to all
the bugfixes and critical refactoring issues we have to do.