Questions tagged [literate-programming]

A literate program embeds source code in an essay documenting the program.

Literate programming was introduced by Donald Knuth as an alternative to the structured programming. Literate programming encourages programmers to structure their programs by the flow of their thoughts, i.e., in a way that makes it easy to present and document.

158 questions
3
votes
1 answer

F# FSharp.Literate formatted code snippet does not display correctly (.css & .js?)

I'm trying to use FSharp.Literate to produce html pages. I'm working in Xamarin using Mono 4.5. I want to turn basic *.fsx scripts into html. I am using the simple script example from the documentation for tests. The script I wish to turn into html…
Andre P.
  • 613
  • 1
  • 7
  • 21
3
votes
3 answers

org-mode with code example as html

I'm trying to embed a literate code example as HTML in Emacs org-mode. The idea is that I can use something like #+BEGIN_SRC html :noweb-ref content :exports source some content #+END_SRC #+BEGIN_HTML :noweb…
JoelKuiper
  • 4,362
  • 2
  • 22
  • 33
3
votes
3 answers

Marginalia / Docco / etc for Java Maven projects?

Is it possible to run Marginalia on a Java (multi-module) project which uses Maven? Or is there any other alternative that's similar to Marginalia or Docco that can do this? What's important to me is to be able to add it as a dependency from some…
Martin Spa
  • 1,494
  • 1
  • 24
  • 44
2
votes
1 answer

Cryptic error message in emacs org-mode following attempted export of file containing image-generating block of R code

I have an R code block that generates an image (see below). Executing the code is no problem (i.e., C-c C-c from within the block generates an image temp.png as expected). However, on export to PDF via LaTeX, there is an error…
John Horton
  • 4,122
  • 6
  • 31
  • 45
2
votes
2 answers

Can Pweave play nice with Ruffus?

I am interested in developing self-documenting pipelines. Can I wrap Ruffus tasks in Pweave chunks? Pweave and Ruffus ============================================================== **Let's see if Pweave and ruffus can play…
Jeremy Leipzig
  • 1,914
  • 3
  • 21
  • 26
2
votes
1 answer

Problem with spec block in literate haskell file

I have this block of code on my literate haskell file \end{code} \paragraph{Valorização} Codigo em C \begin{spec} double co(double x, int n){ double a = 1; double b = -1 * x * x / 2; double c = 12; double d = 18; for(; n > 0; n--){ …
Pedro Fernandes
  • 216
  • 1
  • 12
2
votes
0 answers

Literate Programming in Visual Studio

What possible solutions are there for using Visual Studio with literate programming? Are there ready plugins or built-in solutions or integrations? (This is not about general discussions about literate programming or visual studio alternatives)
sirjofri
  • 183
  • 5
2
votes
1 answer

Customizing Literate Haskell + LaTeX mode

I'm having a hard time forcing literate-haskell-mode to produce PDFlatex output by default. When I use C-c C-t C-f it just parses the lhs file with latex binary producing dvi. I know I can always use the shell to manually run pdflatex whatever.lhs,…
pkazmierczak
  • 853
  • 2
  • 11
  • 13
2
votes
1 answer

Failed to show calculation steps with sympy and markdown

Question I want to show the steps of calculation (for example, in text book) in markdown file which is created by a python code. here is what I need in original python code from sympy import * angle = 60 # this will be changed to created…
oyster
  • 537
  • 3
  • 15
2
votes
1 answer

R: iterate a function over two lists simultaneously using lapply?

I have multiple factors dividing my data. By one factor (uniqueGroup), I would like to subset my data, by another factor (distance), I want to first classify my data by "moving threshold", and then test statistical difference between groups. I…
maycca
  • 3,848
  • 5
  • 36
  • 67
2
votes
2 answers

Where can I find the graph of TeX's error log?

In Donald Knuth's Literate Programming, there was if I remember correctly a graph showing the evolution of TeX's number of bugs over time. This graph has remained flat for the past decade or so, suggesting that TeX might now be bug-free. I would…
lindelof
  • 34,556
  • 31
  • 99
  • 140
2
votes
0 answers

lhs2Tex produces invalid .tex file

I ran lhs2Tex on my f.lhs file ($ lhs2Tex f.lhs > f.tex). It completed successfully, creating f.tex and producing no errors. However, when I then run $ pdflatex f.tex, I get (some output followed by) the following error: Runaway…
mherzl
  • 5,624
  • 6
  • 34
  • 75
2
votes
2 answers

How do I iterate through a directory stopping at a folder that excludes a specific character?

I would like to iterate through a directory and stop at the first folder that doesn't end in "@" This is what I tried so far (based on another question from this site): string rootPath = "D:\\Pending\\Engineering\\Parts\\3"; string targetPattern =…
Jordan Smith
  • 91
  • 1
  • 8
2
votes
1 answer

In what languages can you redefine methods/functions in terms of themselves?

I'm interested in trying literate programming. However, I often that the requirements are stated in a general but then exceptions are given much later. For example in one section it will say something like Students are not allowed in the hallways…
Sled
  • 18,541
  • 27
  • 119
  • 168
2
votes
3 answers

Non-exhaustive pattern in function-Haskell

I've written a function, that Inserts an Element into a binary Tree, but every time I try to run it, I get the a non-exhaustive pattern in function. type Eintrag = (Person, Anschrift, SozNr) data Tree = Nil | Node Eintrag Tree Tree deriving (Eq,…