GeneralChanging enumerated lists and citing images

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
NobleMule
Posts: 4
Joined: Thu Oct 09, 2008 10:58 am

Changing enumerated lists and citing images

Post by NobleMule »

I have asked the first question in another post but as I now have another question, it'd probably be best to start a new thread.

Firstly, I have an enumerated list with several enumerated lists nested within. I want my first level to remain as standard (i.e. just the number). I want my second level to be the number of the first level '.' number for the second level and so on. I want the third level to be number of first level '.' number of second level '.' number of third level. Basically, I want the three levels to be numbered like sections, subsections and subsubsections. I've tried to apply the principals this post but I can't get it to work

This is probably completely wrong but I'm a LaTeX n00b so please forgive me.
In my preamble, I have:

Code: Select all

\makeatletter
\renewcommand{\p@enumii}{\theenumi.}
\renewcommand{\theenumii}{\arabic{enumii}}
\renewcommand{\p@enumiii}{\theenumii.}
\renewcommand{\theenumiii}{\arabic{enumiii}}
\makeatother
But the output of my lists appears as:

Code: Select all

1. Item one
    (1) Sub item one
        1. Sub sub item one
    (2) Sub item two
2. Item two
etc.

What am I doing wrong?



The second question... I want a bibliography style reference at the end of my document that allows me to cite the source for all my images. For example, after my bibliography pages, I want another page that looks something like:

[Figure 1] Taken with permission from http://www.url.com/
[Figure 2] Image licensed under the Creative Commons License
[Figure 3] ...
etc

How can I do this?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

NobleMule
Posts: 4
Joined: Thu Oct 09, 2008 10:58 am

Changing enumerated lists and citing images

Post by NobleMule »

Ok, I've managed to fix the first problem. Not sure if it's the 'correct' way to do it but it does what I want. In case anyone has the same problem, here's what I ended up with:

Code: Select all

\renewcommand\theenumi{\arabic{enumi}}
\renewcommand\theenumii{\arabic{enumii}}
\renewcommand\theenumiii{\arabic{enumiii}}
\renewcommand\theenumiv{\arabic{enumiv}}
\renewcommand\labelenumi{\theenumi}
\renewcommand\labelenumii{\theenumi.\theenumii}
\renewcommand\labelenumiii{\theenumi.\theenumii.\theenumiii}
\renewcommand\labelenumiv{\theenumi.\theenumii.\theenumiii.\theenumiv}
(I know the 'theenumi' and 'labelenumi' are kind of redundant but my OCD made me include them)
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Changing enumerated lists and citing images

Post by Juanjo »

NobleMule wrote: The second question... I want a bibliography style reference at the end of my document that allows me to cite the source for all my images. For example, after my bibliography pages, I want another page that looks something like:

[Figure 1] Taken with permission from http://www.url.com/
[Figure 2] Image licensed under the Creative Commons License
[Figure 3] ...
etc

How can I do this?
I attach a zip file containing a tex and a bib files to try to solve your query. You'll find also the resulting pdf file after three LaTeX runs (needed to set cross-references). In this example there are five simulated figures. One can include in the source bibliography any of them (four in the example). Please, look the pdf file and say if this is what you were looking for. In the affirmative case, I would explain the basics of the code. It suffices to know, by now, that it is based on the multibib package. Some posts of this thread contain links to the doc of this package and some relevant information.
Attachments
SourceOfFigures.zip
(39.7 KiB) Downloaded 246 times
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
NobleMule
Posts: 4
Joined: Thu Oct 09, 2008 10:58 am

Re: Changing enumerated lists and citing images

Post by NobleMule »

Thank you so much Juanjo. That was exactly what I wanted. I've had a go and managed to get it working in my documents. You mentioned that you would be willing to explain the basics of the code and, if don't mind, I'd love to know whats going on. Once again, thank you so much. I can't thank you enough :D
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Re: Changing enumerated lists and citing images

Post by Juanjo »

The main idea is to build a secondary bibliography for citing the source of figures. There are several packages to do so. I've chosen multibib. First, we write a bib file. It is called sourcefig.bib, but you can change that by redefining \BibFigFile (second line of the tex file). The bib file is quite simple, with misc registers, one for any interesting figure. The label associated in this file with every figure is exactly the same label that is used later in the tex file to cite the figure.

The first LaTeX run generates the file Fig.aux. Instead of Fig, you can set other name, by redefining \BibSuffix. This file contains information to generate the secondary bibliography and needs to be processed by BibTeX. You could launch BibTeX by yourself, but alternatively it can be launched from the tex file at each LaTeX run. This is done with the \write18 command at the top. Once BibTeX has processed Fig.aux, you get Fig.bbl (and some log files), which is actually the file containing the secondary bibliography. The next LaTeX run will include it in the document through a \bibliography command implicit in the \SourceOfFigures command.

To cite figures we need a special command, called \figlabel. With the default settings, \figlabel{foo} is equivalent to \label{foo}\nociteFig{foo}. The \label command is needed if you want to refer to the figure somewhere (see the abstract) and also to keep track of the figure numbering. The \nociteFig command is like an ordinary \cite command, except that it writes no text and refers to items stored in the secondary bibliography.

The \SourceOfFigures command does the remaining part of the job. It changes how items in the secondary bibliography are labeled (redefinition of \@biblabel) and numbered (redef. of \@bibitem). Observe that numbering in this bibliography should match the ordinary figure numbering. One can take account of such a numbering through the ordinary \label commands issued with \figlabel. The corresponding information is retrieved with the \ref command you see in the definition of \@bibitem.

\SourceOfFigures also calls a \bibliographystyle command (the unsrt style to not change figure numbering) and the \bibliography command that finally inputs the bibliography.

A knowledge of the multibib package also helps to understand the internals of my code.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Post Reply