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

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.

Related

What is the purpose of \summary in tex?

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.

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.

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.

How to print Smalltalk code from Pharo/Squeak?

What is the best way to print - syntax colored and well formatted - code from Pharo/Squeak on paper?
1) Is there a way to print directly from within Pharo/Squeak? (i use it on macosx)
2) Is there a way to export syntax colored, well formatted code from Pharo/Squak?
3) Are there external tools to color and format a filed out piece of code?
For the appendix in my master thesis I used the Pier CMS-to-LaTeX converter in the Pier-Documentation package. However, this plugin only takes class comments and method comments into consideration, it does not print the source code. Pier also provides a package ShoutPier for syntax highlighting of Smalltalk code, so I guess it would require little work to bring the two together. You can find the mentioned extension packages in http://source.lukas-renggli.ch/pieraddons.html.
Pharo browsers seem to use syntax highlighting.
What difficulty are you having reading Smalltalk code using the browsers and senders/implementors ?
Edit: Would something that produces UML give the overview you're looking for? The Dandelion website only shows downloads for old Squeak versions - I don't know if they would work with Pharo.
And perhaps this GSoC project "Generate UML diagrams from Smalltalk code for Pharo" suggests not.
Here's how I did it on my Mac, I think this should work on other platforms too.
Save your categories to a Monticello local folder on your disk -- see the Pharo manual on how to do this: http://book.pharo-project.org/book/PharoTools/Monticello/?_s=hdGOLc_FXsvVY1iR&_k=YYH-Ln8f5mtWZ8z2&_n&148
Browse to this folder, and unzip the .mcz file
You'll see all your code in snapshot/source.st file
You'll need to edit this a bit, to remove the ! characters for e.g., there might be a tool to do this?
-Eric.
There is webdoc project, which allows you navigating code in web browser:
http://ss3.gemstone.com/ss/webdoc.html
(and of course you can print code from your favorite web browser)..
1) Install shout from www.squeaksource.com
2) I don't know. May be you can customize shout.
3) In gnu-smalltalk you have a smalltalk mode for emacs. But I am not pretty sure to understand what you are looking for.

Is there a quick way to get titlesec "simple mode" functionality in memoir class?

Memoir class doesn't play nice with the titlesec package. Memoir has all the functionality of titlesec, but it doesn't seem to have a nice "simple mode" analogue. So in titlesec (with the article document class) I could just use \usepackage[small,compact]{titlesec} and that was that. If I wanted to do the same thing with memoir, it looks like I have to go through redefining all the section heading formatting and spacing itself?
Am I missing a quick way to replicate [small,compact] in memoir?
The point is not that I don't know how to get memoir to do this stuff. The point is that memoir is missing the "quick options" mode that titlesec had. If all I want to do is make all the section headings a little smaller the [small,compact] options when calling the package was fine. To do this in memoir takes a lot more work, going through all the options manually. Is this true or am I missing a memoir version of the quick options?
\usepackage[small,compact]{titlesec} will now work in memoir. I'm sure it didn't always work, but it does now. So the answer to my question is yes, there is a quick way to do it: use the titlesec package.
Please read the memoir documentation. You can do this by opening a command prompt and entering texdoc memman
Specifically, see Chapter 8, which says:
8.1 Introduction In this chapter I first discuss the various kinds of
divisions within a book and the
commands for typesetting these. After
that I describe the class methods for
modifying the appearance of the
chapter and other sectional headings.
The facilities described here provide
roughly the same as you would get if
you used the titlesec [Bez99] and
sectsty [McD98] packages together; the
commands are different, though.
The memoir documentation is very good. You will most likely find everything you need in that document. It hasn't failed me yet.

Resources