4

Forgive me for asking what I'm sure is such a simple question, but I haven't been able to dredge up an answer off Google.

I'm working on a document which contains a series of topic descriptions followed by short bibliographies. I'm entering the bibliographies as short lists. I'd like to reformat all of the unordered lists in the document to have no bullet, start flush left, and have a quarter-inch or so hanging indent. In other words, I'd like these all to look like bibliographies. Is there a way to redefine the list format at the start of the document so that they all take this form?

In case there's some special way of formatting bibliographies internal to LaTeX, I should say that I'm not actually working in LaTeX; I'm working in Markdown and using pandoc to convert to PDF through pdfTeX. So I want to leave this as a simple unordered list.

Thanks for any help!

5

As mbork said, you can use the enumitem package. In the following example I creted a new list-like environment (which I called biblist) having the desired behaviour and then used this environment to define (in a very simplistic way) the secbib environment to write the word "References" in bold-faced \large font and using the biblist environment to write the entries:

\documentclass{article}
\usepackage{enumitem}

\newlist{biblist}{itemize}{10}
\setlist[biblist,1]{label=,leftmargin=0.25in,itemindent=-0.25in}

\newcommand*\TestText{text text text text text text text text text text text text text text text text text  text text text text text text  text text text text text text}

\newenvironment{secbib}
  {\textbf{\large References}\begin{biblist}}
  {\end{biblist}}

\begin{document}

\section{Test section one}
\begin{secbib}
\item \TestText
\item \TestText
\end{secbib}

\section{Test section two}
\begin{secbib}
\item \TestText
\item \TestText
\end{secbib}

\end{document}

The result:

enter image description here

Notice that you will still have a lot of work to do: manually formatting the bibliographical entries can be really time consuming. I would suggest you to consider a different approach: let the bibliographical entries be formatted automatically for you. This can be done in (at least) two ways:

1) Using BiBTeX and the chapterbib package, or

2) Using biblatex and its refsection environment. Here's a minimal working example showing this last alternative:

\begin{filecontents*}{mybib.bib}
@book{goossens93,
    author = "Michel Goossens and Frank Mittlebach and Alexander Samarin",
    title = "The Latex Companion",
    year = "1993",
    publisher = "Addison-Wesley",
    address = "Reading, Massachusetts"
}

@book{knuth79,
    author = "Donald E. Knuth",
    title = "Tex and Metafont, New Directions in Typesetting",
    year = "1979",
    publisher = "American Mathematical Society and Digital Press",
    address = "Stanford"
}

@book{lamport94,
    author = "Leslie Lamport",
    title = "Latex: A Document Preparation System",
    year = "1994",
    edition = "Second",
    publisher = "Addison-Wesley",
    address = "Reading, Massachusetts"
}

@misc{patashnik88,
    author = "Oren Patashnik",
    title = "{B}ib{T}e{X}ing.  Documentation for General {B}ib{T}e{X} users",
    year = "1988",
    howpublished = "Electronic document accompanying BibTeX
distribution"
}
\end{filecontents*}

\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\addbibresource{mybib.bib}

\begin{document}
\section{Test section one}

\begin{refsection}
\nocite{goossens93,lamport94}
\printbibliography[heading=subbibliography]
\end{refsection}

\section{Test section two}

\begin{refsection}
\nocite{patashnik88,knuth79}
\printbibliography[heading=subbibliography]
\end{refsection}

\end{document}

You will get the following output:

enter image description here

  • Ok, I could definitely be persuaded to use your second method, but I'm still having a few problems. Right now, in the document I'm using, the \printbibliography command only prints what has been explicitly cited in-text--which in this case is nothing. This would work if I were able to use \printbibliography[keyword=topic1] and have it draw from my larger bibtex bibliography (which I'm already maintaining). Is there a way to change that? – Brian Hamilton Aug 1 '11 at 3:56
  • 1
    Try the amsrefs package (you could also use \nocite, but amsrefs is sooo much better than bibtex...). – mbork Aug 1 '11 at 8:51
  • @Brian Hamilton-Vise:using biblatex you can create bibliographies subdivided by some criteria. Refer to the package documentation: for bibliographies subdivided by topic, see the category feature in § 3.5.6 and the corresponding filters in § 3.5.2. Alternatively, you may use the keywords field in conjunction with the keyword and notkeyword filters for comparable functionality, see §§ 2.2.3 and 3.5.2 for details. For bibliographies subdivided by type, use the type and nottype filters. – Gonzalo Medina Aug 1 '11 at 13:08
  • 1
    @gonzalo-medina: It turns out that pandoc/markdown2pdf doesn't play well with some of biblatex's special commands, include \nocite. So I'm going to keep playing with your second solution (which is obviously much more efficient), but use the first one in the meantime. Could you explain how to do change the formatting, not for a newly defined list (a la secbib), but for the default unordered list? That way I can create a special pandoc template that will kick this out the way I'd like it until I can figure the other way out. – Brian Hamilton Aug 1 '11 at 16:33
  • 1
    @Brian Hamilton-Vise: simply load the enumitem package: \usepackage{enumitem} and then \setitemize{label=,leftmargin=0.25in,itemindent=-0.25in}... or do you want to redefine the itemize environment without any additional package? – Gonzalo Medina Aug 1 '11 at 19:18
4

Probably the best way to customize list formatting in LaTeX is the enumitem package by Javier Bezos, which is contained in all modern TeX installations. (Notice that its latest version, which may be not available in your distribution yet, has some nice new features - but most probably you don't need them just to reformat your lists.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.