Source code of books made with TeX/LaTeX to learn [closed] - open-source

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Some time ago, reading this entry I found a nice image and a pointer to a better book entitled "Thinking Forth". To my surprise, the LaTeX sources of the book were ready to download, with pearls like:
%% There's no bold typewriter in Computer Modern.
%% Emulate with printing several times, slightly moving
\newdimen\poormove
\poormove0.0666pt
\newcommand{\poorbf}[1]{%
\llap{\hbox to \poormove{#1\hss}}%
\raise\poormove\rlap{#1\hss}%
\lower\poormove\rlap{#1\hss}%
\rlap{\hbox to \poormove{\hss}\hbox{#1}}%
#1}
%\let\poorbf=\textbf
\renewcommand{\poorbf}[1]{{\fontencoding{OT1}\fontfamily{cmtt}\fontseries{b}\selectfont#1}}
in which it can simulate the bold stroking of a font that doesn't have it. Since reading that, I was unaware of \llap and such, but now I can use them to define boxes, etc.
So, my question is twofold:
Do you know of sites that show that relatively advanced use of TeX/LaTeX in terms of useful recipes, and
Do you know any books that offer their TeX/LaTeX source to inspect and learn (and that are worth doing so.)?

There are two comprehensive reference guides/recipe books for TeX:
TeX by Topic by Victor Eijkhout
TeX for the Impatient by Paul Abrahams, Kathryn Hargreaves, and Karl Berry
In both cases, the sources are also available.
As lindelof mentions, the TeXBook is also available, albeit in a form that prevents compilation (Knuth wished people to look at the source for inspiration but not to reproduce the book freely):
The TeXBook by Donald Knuth
On the LaTeX side of things, resources a little more scarce from the programming point of view. The best free reference that I know of is
Formatting Information by Peter Flynn
Of course there's also
The Not So Short Guide to LaTeX by Tobias Oetiker
but that doesn't cover so much programming "stuff". The LaTeX sources themselves contain some useful nuggets, but the quality of the documentation ranges from excellent to non-existent in parts; this should be available in your distribution with texdoc source2e.
Other large LaTeX packages obviously have the source to their documentation available; a notable example is the memoir class:
The memoir class by Peter Wilson (memman.tex is the documentation)
I'm sure there are many more books with their source available; these are just the first ones that come to mind that happen to also be able TeX and/or LaTeX.

Believe it or not, but the source code to the TeXbook is actually freely downloadable:
TeXbook source code package

Not that I'd recommend it (unless you've got a lot of time and caffeine to spare), but I learned a lot from just reading the latex.ltx file. I learned a lot not only about LaTeX but also of course about TeX. It's a heavy read though and I'd suggest reading a book about TeX first before diving into the latex.ltx file.
I wanted to know about how "optional" parameters actually worked and reading the latex.ltx file really helped me understand.

Another book that would definitely fit part 2 of your question is LaTeX for Complete Novices by TeX.SX member Nicola Talbot.
This later question, posted on TeX.SX, is also relevant for part 2 and worth reading.

I found this book by Allen B. Downey that looks really nice: Computational Modeling and Complexity Science.

Related

How to study the source code of my favorite program? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I've downloaded the source code of my favourite program.
At school they taught us that the entry point is the main.c(pp) and then follow the headers, but I realise that is not always the case. In some cases there isn't a main or It deep buried somewhere where I can find it.
And the documentation in most cases describes only how to compile, what deps you need and etc.
Bottom line, you've downloaded the code, untar'ed it.. now what?
I don't have any particular example to ask (help) for, so if you have any example to help me it's welcome
Reading code is often more cumbersome than writing code. This inquiry does not have a single answer and you should explore multiple opinions and see which works best for you. One practice you shouldn't engage in is reading the code start to finish. This will lead to eye bleeding and mind-numbing frustration. So don't approach it like a book, since reading it like one, cover to cover, is very inefficient. Reading is not learning. Applying what you read is learning. One key point to remember is don't get discouraged. You will be hard pressed to find a programmer that can quickly pick up on a foreign, large base of code quickly.
The best 'book speed readers' skim through something they are about to read a form an outline in their head. They take mental notes of logical sections and paint a thin picture about what to expect. When your brain has seen something before, it is more likely to be engaged with the material. I would skim the header files as a way to form this outline. If there are no header files, then try to skim quickly though class interfaces and take note of which are connected and what is their general purpose.
Make a second pass through the sections of code that interested you. Try to identify a subsystem of the code and make a second, more detailed pass through it. I personally would look for connected components for identifying the subsystems (look at imports). Jot down some of the data structures used and associated algorithms and design patterns. Make associations between them and try to understand why they were used.
Lastly, don't be content with just reading the code. Since you are looking at open source, challenge yourself to add a feature. Take one of the subsystems you were intrigued with and add on to it. If this still intimidates you, take the last bullet a step further. Make a quick flow chart detailing the flow of the code. Bust out your favorite IDE and leverage breakpoints around areas you don't understand the flow. Try to put yourself in the mind of the designer and think why he made certain decisions as your stepping through the breakpoints. Bottom line: It is easy read something and think you understand it. But, doing is where the real learning takes place. You will find yourself asking more questions and researching more into the code when adding a new feature. Having this direction is all it takes sometimes.
If the source code leverages an OOP solution, I would strongly recommend studying a Design Patterns book. I was going to include Design Patterns as a bullet, but I didn't know if the source code you are viewing uses an OOP approach.
Hope this helps! This was the approach I undertook when learning to code a couple years ago.

Tree with 2 parents: Build a family tree HTML/javascript as familyecho do [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I want to display a genealogy tree without flash. In HTML/javascript/css.
I have a big problem displaying my tree because of the:
Difficulty to display the marital link between 2 parents
the children nodes
Do you know any api which can build a family tree as www.familyecho.com does? I am gonna be crazy????
Here an example
Father --- Mother
|
|--------|------------|
Child1 Child2 Child3
Thanks
you may want to take a look at http://www.myheritage.nl as example, familiecho is pale in comparison to that. Is free for op to 500 familimembers but unfortunatly is made in Flash, so no chance of borrowing some code or libraries there.
If you just want to use HTML there is http://www.starkeffect.com/ged2html/ but is a bit oldfashioned.
There are several drawing libraries for javascript bun none that are aimed at genealogy as far as i know, anyone who comes up with one i would be gratefull.
Raphael at http://raphaeljs.com/ being the widest known vector graphics library, see http://javascript.open-libraries.com/utilities/drawing/10-best-javascript-drawing-and-canvas-libraries/ for a comparison and see this Javascript drawing library? question. Basically you will have to make a choice between vector (eg SVG) approach and rendered graphics (eg Canvas), each of them having their own advantages, libraries and followers.
See http://www.outten.org/?id=46
Based largely on the familyecho look which I also liked.
Data is dynamic from MySQL & the dragable page gfx are built locally in javascript. A bit hashed together with tables, but works in a fashion except on mobile devices.
Alex
If you are looking for an API as Familyecho. There is already an API supported by Familyecho.com You can use it, they also provide developer sample code for quick integration. Navigate to their website for more info.
Here is the link: https://www.familyecho.com/?page=api
Wes, the link was to a page that has the code embedded, not just example of output.
The data is pulled from MySQL translated into a js object (here:https://www.outten.org/data.php?id=46).
Else the javascript is self explanatory at the bottom of the document source, otherwise standard JS jQuery etc. used.
There's no licensing for this code only what has been used from others & may be used as you wish. There are many things that could be improved about it.
BTW the link has changed & been updated to:
https://www.outten.org/newTree.html?id=46
I had been looking for a JS module to do this for decades, but none do even Node.js
With regards
Xander (Alex) Lost old stack exchange login :(

How much faster is dreamweaver? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Hey everyone I just bought the master cs5 suite mostly for design purposes, and now I have a lot of peoPle telling me I should start using DW instead of hand coding my HTML/CSS because it will speed up my production and it's what all design shops use and is an industry standard . I was curious if this is accurate and how much would it really speed things up?
I (personally) disagree. I use DW in CS5 for code editing view only (it has the best markup/code highlighting I've found); the generated markup is not great, so I don't use it, nor am I highly trained in the workflow it entails. A lot of designers will not understand hand coding markup, but that's usually because they don't understand how to or don't care to do so because it's not what they get paid to do.
However, if you're working on (a) lower level, you have a better understanding of your markup/styles/code. It may take slightly/significantly more effort (depending on your abilities hand coding), but I personally think it's worth the effort in many cases. However, I am not a piece worker nor am I paid on deadlines.
There are other reasons I use DW (WebDAV support, searching capabilities), but I will likely never use it to author my markup. Also note I don't pay for it.
Used unwisely it won't speed it up at all. You'll spend more time pulling out DW's extraneous code. Use parts of DW that will make you faster like snippets (for storing snippets of code you use frequently) and find and replace (using f&r with regex is a very useful skill). I use it to cram in table markup quickly (for data tables). Dragging files over for internal links is quite nice and the keyboard shortcuts help (you can create custom ones).
That said, I like the product at work. Check in and check out has been very helpful there with multiple coders/designers.
So, there are plenty of parts in DW that will speed up your hand coding. Root them out.
Dreamweaver CS5.5 made a lot of improvements over previous versions. As a designer you may appreciate Live Preview and the design integration's. As a coding IDE, it's still considered sub-standard and many developers choose to go another route. I use PHPdesinger 7 for ~$70, its got in-line xdebug integration and pretty good intellisense for PHP, CI, and jQuery. I use DW5.5 and PHPdesigner and I find it's far less bloated then Dreamweaver for what I use it for, coding with PHP/Jquery and web API's. I also feel that it's closer to how I worked before using advanced IDE's like this, coding on my Macbook with Coda. But if your designing web pages you may like Dreamweaver better.

How to use html for desktop publishing? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Not considering ad-hoc programs (like Adobe Indesign, the open source Scribus or word processors), it seems to me that Latex is the only markup language used for document preparation able to generate beautiful PDF documents.
I thought that HTML + CSS would make a terrific combination for the purpose. HTML can be easily generated from a mid-layer format (like markdown), a bit of programming based on classes can generate indexes and notes (and so on) and CSS can really style a page with ease. Preparing a document would turn out to be way easier than using Latex that is incredibly powerful but making something "out of the standard" is really hard.
The hard part would be getting the PDF. While there are a number of programs (also free)
to get a PDF out of HTML, I can't see how to retain the concept of "page". One would write the document as a single, long HTML page and let the program split it into pages, apply footnotes, headers, page numbers...
Is there already such a program? Has anyone any idea on how to implement it? Thanks.
Summary: Prince is the best option if you're serious about a high quality HTML-to-PDF pipeline. If you don't want to pay for Prince, you will probably need to compromise on either document quality or your choice of pipeline.
There is an excellent article on A List Apart about this. They used Prince and CSS2 paged media (as suggested by widyakumara) to produce pages with correctly-formatted numbers and the like. Prince is free for noncommercial use; commercial use licenses start at $3800 per server, which isn't so expensive when you consider how damn awesome Prince is.
A few cheaper alternatives were suggested in an earlier Stack Overflow question about converting HTML/CSS3 with generated content/paged media into PDF. I've tried a few of those, and I have to conclude that Prince is the only tool I've seen that can produce a paged PDF using features like generated page numbers from HTML and CSS. Prince also supports many print-specific features like footnotes.
That said, I'd suggest that this is a solution in search of a problem. HTML and CSS are proably not the best choice for documents that are intended to finish up as "beautiful PDF documents." LaTeX is not just a markup language; it is a mature, intelligent typesetting system whose goal is to produce attractive printed documents. In comparison, HTML and CSS are plainly not the best tools for the job.
there's css print media type & paged media section
Have you considered XSL-FO? Apache FOP is free and may suit your needs.

What's a good natural language library to use for paraphrasing? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm looking for an existing library to summarize or paraphrase content (I'm aiming at blog posts) - any experience with existing natural language processing libraries?
I'm open to a variety of languages, so I'm more interested in the abilities & accuracy.
There was some discussion of Grok. This is now supported as OpenCCG, and will be reimplemented in OpenNLP as well.
You can find OpenCCG at http://openccg.sourceforge.net/. I would also suggest the Curran and Clark CCG parser available here: http://svn.ask.it.usyd.edu.au/trac/candc/wiki
Basically, for paraphrase, what you're going to need to do is write up something that first parses sentences of blog posts, extracts the semantic meaning of these posts, and then searches through the space of vocab words which will compositionally create the same semantic meaning, and then pick one that doesn't match the current sentence. This will take a long time and it might not make a lot of sense. Don't forget that in order to do this, you're going to need near-perfect anaphora resolution and the ability to pick up discourse-level inferences.
If you're just looking to make blog posts that don't have machine-identifiable duplicate content, you can always just use topic and focus transformations and WordNet synonyms. There have definitely been sites which have made money off of AdWords that have done this before.
I think he wants to generate blog posts by automatically paraphrasing whatever was it the blogs this system is monitoring.
This would be really interesting if you could combine 2 to 10 blog posts that are similar, but from different sources and then do a paraphrased "real" summary automatically (the size of 1 blog post).
It could also be great for Homeworks. Unfortunately it's not that easy to do.
The only way I could see is to be able to decompose every sentence into "meaning", and then randomly change the sentence structure and some words retaining the meaning.
These sentences mean the same:
I hate this guy, he is so dumb.
This guy is stupid, I hate him.
I despise this dumb guy.
He is dumb, I hate him.
It would be nontrivial to write a program to transform one of these sentences to the others, and these are simple sentences, real sentences from blogs are much more complicated.
Your getting into really far out AI type domain. I have done extensive work in text transformation into machine knowledge mainly using Attempto Controlled English (see: http://attempto.ifi.uzh.ch/site/), it is a natural language (english) that is completely computer processable into several different ontologies, such as OWLDL.
Seems like that would we way overkill though...
Is there a reason for not just taking the first few sentences of your blog post and then appending an ellipse for your summary?
Thanks for those links. Looks like GROK is dead - but it may work still for my purposes.
2 more links:
http://classifier4j.sourceforge.net/
http://www.corporasoftware.com/products/summarize.aspx
The Attempto Controlled English is an interesting concept: as it's a completely reverse way of looking at the problem. Not really practical for what I am trying to do.
#mmattax As for the suggestion of taking a few sentences - I'm not trying to present a summary: otherwise that would be a nice judo solution. I'm looking to actually summarize the content to use for other evaluation purposes.