What is the purpose of \summary in tex? - latex

I have to write a report using LaTeX for my final year project at university. Having been given some example documents to learn to use it, a common command, \summary, keeps appearing. However, what's written inside the summary doesn't appear anywhere in the produced document. Is it some kind of internal documentation?

With a quick google, it is likely that /summary is used as a shortcut to reuse the abstract in one place.
Looking at a few templates : ucl thesis template, book template and stackoverflow it tends to be a custom command used for repeated style. Look through the different files for "summary" to see if appears in the preamble somewhere.

Related

Use clang to extract documentation comments as XML

I've seen this presentation from 2012 on clang features to handle C++ documentation comments (eg. for doxygen). Slide 20 mentions a new feature to export comments as XML as being part of libclang.
I'd like to try that feature out. More specifically, I want to test producing an XML like shown on slide 31.
But I don't know how. Which tool of libclang is this part of? Was the tool removed in the meantime? Or is this just an extra compiler flag?
They might just be referring to…
CXString clang_FullComment_getAsXML( CXComment Comment)
… which returns an XML document for the given comment. You still need to traverse the node trees yourself.
It would be spectacular to have an option for dropping an XML file containing the extracted documentation during a regular compile, but it doesn't seem to be in the cards.

Making multiple PDFs from 1 TEX file in LaTeX?

I'd like to create multiple documents (output as PDFs after running pdflatex) whose source is from one file.
Example:
\documentclass{article}
\begin{document}
This text will appear in the first PDF.
\end{document}
\begin{document}
This text will appear in the second PDF.
\end{document}
This would be particularly useful because:
I could keep everything in 1 file, with a single, consistent preamble.
I could use ifthen or other loops to automatically generate various alternative forms of a document.
AFAIK this is not possible without some preprocessing of your file, i.e. using a scripting language to produce two separate documents then compiling them separately. Even then I don't think it's a good idea.
The first reason you think this would be useful is handled by putting your preamble in a separate document that is included in as many documents as you want using \include. The second aspect can be handled by using Makefiles and putting the conditional branching to build particular versions of a document in there.
I wrote a really simple preprocessor for LaTeX that embeds Ruby code directly into .tex files for this purpose and use the ERB template engine. Here's the source code on Google Code, if you want to take a look. There's not much to it, though I regularly use it from a Ant/latexmk-based build script and it has proved very useful for generating multiple version of my résumé. It works equally well on Linux/Mac OS X/Windows, assuming you have a working LaTex and Ruby installation.

Markdown parser for markItUp editor or stable WMD-showdown release

A bit of a long-winded question(s)...
Is anyone aware of a markdown parser for markItUp editor? I tried showdown.js but it appears there is no way to integrate it with markItUp. This is despite makrItUp having a configuration API that allows you to specify a custom parser path and variable using previewParserVar and previewParserPath arguments.
In reality I prefer using WMD Editor, but when I tried using the SO version on gitHub I found it to be very buggy. There are so many forks but I'm unable to find a stable one.
I eventually found this fork, jquery-markedit, which is really cool, but when the form is posted, unlike the original wmd-fork, the form does not post the parsed text. The textarea data is posted as plain text. The text is parsed fine for preview, but it seems odd that it's not parsed for submission.
So I decided to resort to markItUp which has a markdown set but does not have a parser.
The version of WMD that SO currently uses is different from that on gitHub wmd-fork - is anyone aware of the current version SO is using and if it is available as open source?
Yes I'm aware of markitup!. I recently (today) tested markitup! and WMD. What strikes me is markitup! seems to have no undo functionality. And the header (h1 - h6) functionality in markitup! requires 6 buttons, but only 1 button in WMD.
Among all WMD repos, I've downloaded and tested these 2 repos, and I think they seem promising (I've tested them only 30 seconds each so I might be very incorrect).
umamo, which (says its commit messages) adds LaTeX math.
klipstein, which fixes buggs and makes | separators visible.
Both are based on the Open Library repo, which I need because it makes it possible to have many editors open at once. However, that fork did lots of refactoring; I don't know if that'll make it messy to merge changes from other branches.
I have no idea which repo Stack Overflow uses.
By the way, here is an interesting showdown.js repo (showdown is the JavaScript implementation of Markdown used by WMD), which implements support for RTL languages (according to its readme file). I'm considering including those changes in yet another WMD repo :-)
https://github.com/hasenj/showdown/tree/
Hope this helps,
Magnus

How to integrate Sphinx-generated Latex code in existing Latex documents?

I've used Sphinx to document a Python library. So far this works great, I get nice HTML and LaTeX output. Concerning Latex, Sphinx generates a complete standalone document with lots of special packages and configurations.
But, I would like to integrate the generated Latex files within an already existing Latex project (more precise: in the appendix of a book). In particular I want the Sphinx-generated documentation pages to have the header, footer and section heading styles of the parent document. I guess I could somehow transfer the relevant parts by manually removing unneeded stuff and adjusting various options in the tex files generated by Sphinx. However, probably this is going to be a very tedious fiddling taking too much of my time (thinking of conflicting packages and options I have to detect and fix).
Does Sphinx' Latex-Builder support such a use case? If not, is there a more general approach how to merge independent Latex-documents?
Thanks for any hints!
It seems there is no generally valid answer to this question. I've asked this question on the sphinx mailing list and received an answer which basically says one has to manually extract and partly convert the relevant parts of the latex code generated by sphinx - a less expensive solution does not yet exist.

Getting "longnamesfirst" option to work with natbib in LaTeX - custom .bst

I'm writing an MSc dissertation and I'm having difficulty getting the longnamesfirst option working in natbib.
My University has a very specific referencing style a little like APA, but not quite the same. I've used the docstrip utility to build a basic framework and then edited it to fit the requirements of my University.
Having tested it with the simplest possible document; applying my bst then trying it again with one of the defaults (\bibliographystyle{apacite}) I can see than natbib works as intended with apacite. It doesn't however produce correct results with my bst.
So my question:
How does the .bst file link with natbib to enforce the "longnamesfirst" option?
I've come to a solution. Looks like my bst file wasn't correctly written to take advantage of natbib's longnamesfirst option. In particular, there are a few functions like format.full.names I didn't have. It appears natbib needs these to generate those crucial first few references.
A regeneration from latex makebst and a merge later and I'm good to go.

Resources