Text FormattingSpecial Modifications to Bibliography Style

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Special Modifications to Bibliography Style

Post by localghost »

LavaTyper wrote:Alright but I'm really doing this for my dissertation (which uses Chapters), and I need to have the references file separate. The other thing is that I don't want all of the references in my actual references file to be included if I don't cite them all...just the ones that I do cite. […]
The filecontents package and its corresponding filecontents* environment creates an external file. I only embedded this into the example to make it self-contained. That's a common procedure and won't do any harm here. And the \nocite{*} command simply provides a printed bibliography without doing a mass of citations. By the way, your \cite command here contains all the entries from your provided database file. So there is no difference. And if you want all this in your document which contains chapters, why do you provide an example that is based on the article class without chapters?
LavaTyper wrote:[…] I'd naturally adopt the script that you wrote and just add it into my thesis, but then it doesn't work. I get a chapter title that says "References," a line below it that says "References," and then a blank page. I also end up with a series of error messages in TeXShop. If I keep the \chapter and "book" options, then the first LaTeX typeset and first BiBTeX typeset works, but the second LaTeX typeset fails with error messages.[…]
Your example works fine for me even with the book class (except for some warnings about bad boxes). So, at this point I can't help any further without knowing the exact error messages from the log file (*.log). Perhaps you just need to delete the auxiliary files (*.aux, *.bbl,…) and start again.

Recommended reading 2024:

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

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

LavaTyper
Posts: 69
Joined: Sat Feb 11, 2012 2:38 am

Re: Special Modifications to Bibliography Style

Post by LavaTyper »

Guys I need help on this soon. I am trying to write my dissertation and I NEED to have this done in order to get my degree.

How do I adopt this for my dissertation??
LavaTyper
Posts: 69
Joined: Sat Feb 11, 2012 2:38 am

Special Modifications to Bibliography Style

Post by LavaTyper »

Well that's really weird, I didn't actually see the above post before I replied with "Guys I need help ..."

Edit: Wait, this is page 2 of the thread? Huh? I am so confused. I was never aware that this thread had two pages. I didn't even see my previous post go on a second page of the thread. I made sure that checked, after I posted it, and it was still on the first page with the other posts in the thread. I don't understand what just happened.


Wow anyways. Let me go back and read your post.
localghost wrote:if you want all this in your document which contains chapters, why do you provide an example that is based on the article class without chapters?
Well first I just wanted to get this to work. I wasn't expecting that the solution would depend on the document class that I'm using, so I just went with something simple (most minimal) to start with. I'm just following the rules.
localghost wrote: Your example works fine for me even with the book class (except for some warnings about bad boxes). So, at this point I can't help any further without knowing the exact error messages from the log file (*.log). Perhaps you just need to delete the auxiliary files (*.aux, *.bbl,…) and start again.
I didn't include the error messages, because there were so many of them and it was taking a very long time to type them from the console (since I apparently can't even highlight and copy anything from the console).

I wasn't aware that I could just use the log file.

I still get error messages, and my example does not work fine for me with the book class. The log file is attached.
Attachments
thesis.log
(5.33 KiB) Downloaded 667 times
Last edited by localghost on Sun Nov 24, 2013 10:07 am, edited 1 time in total.
LavaTyper
Posts: 69
Joined: Sat Feb 11, 2012 2:38 am

Special Modifications to Bibliography Style

Post by LavaTyper »

[ - 10 days later - ]

Guys I need help on this soon. I can't get my MWE (see post #10 on page 1 of this thread) to work:
localghost wrote: Your example works fine for me even with the book class (except for some warnings about bad boxes).
It doesn't work for me. My log is in the post directly above. I get a bunch of error messages, and I get an entirely different output.

First attachment: There is a huge white space on the correct Reference page, which shouldn't be.

Second attachment: There are extra verbatim "References" on the page before the actual references page.


None of this occurred before.

I am using TeXShop on Mac OS X 10.9, if that helps.




Help!




What's wrong?
Attachments
CorrectReferencesEXTRASPACEUpTop.jpg
CorrectReferencesEXTRASPACEUpTop.jpg (81.42 KiB) Viewed 10634 times
ExtraReferences.jpg
ExtraReferences.jpg (56.16 KiB) Viewed 10634 times
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Special Modifications to Bibliography Style

Post by Johannes_B »

Please test the following MWE (first posted by Thorsten in this thread)!

Code: Select all

\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[doublespacing]{setspace}
\usepackage{apacite}
\usepackage{lipsum}  % not for use in the actual document

% Original code taken from "apacite.sty"
\makeatletter
\def\thebibliography#1{%
  \@ifundefined{chapter}%
    {\st@rtbibsection}%
    {\if@sectionbibdefault
       {\@ifundefined{@mainmatterfalse}%
          {\st@rtbibchapter}%
          {\if@mainmatter
             \st@rtbibsection
           \else
             \st@rtbibchapter
           \fi
          }%
       }%
     \else
        \if@sectionbib
          \st@rtbibsection
        \else
          \st@rtbibchapter
        \fi
     \fi
    }%
  \bibliographytypesize % e.g., to put the bibliography in \small type
  \bibliographyprenote  % some explanatory note before the references
  \@ifundefined{APAC@metaprenote@\APAC@extra@b@citeb}%
    {}% skip
    {\csname APAC@metaprenote@\APAC@extra@b@citeb\endcsname}%
  \list{\relax}{\singlespacing
                \labelsep=\biblabelsep
                \parsep=\bibparsep
                \itemsep=\bibitemsep
                \leftmargin=\bibleftmargin
                \itemindent=\bibindent}% changed to cope with 4th ed.
   \def\newblock{\hskip .11em plus .33em minus .07em}%
   \sloppy\clubpenalty10000\widowpenalty10000
   \sfcode`\.=1000\relax %'
   \bt@beg@thb@hook
   \APACrestorebibitem
}
\setlength{\bibitemsep}{%
  \ifcase \@ptsize \relax % 10pt
    0.6\baselineskip%
  \or % 11pt
    0.618\baselineskip%
  \or % 12pt
    0.604\baselineskip%
  \fi%
}
\makeatother

\usepackage{filecontents}

\begin{filecontents*}{\jobname.bib}
@book{ShipingOutWhere,
  author = "H. Shipping",
  title = "Expert Deliveries",
  edition = "",
  publisher = "Silly Dogcourt",
  address = "Boston",
  year = "1978"
}

@book{Shu1980,
  author = "D. F. Shu and J. S. Mikey",
  title = "Introduction to Small Packages",
  edition = "",
  publisher = "Lackluster University",
  address = "New York",
  year = "1980"
}

@book{SnowEssentials,
  author = "I. P. Snow",
  title = "The Nighttime Extortionist",
  edition = "3",
  publisher = "Bucksport Company",
  address = "San Francisco",
  year = "1990"
}

@book{Zambaba1,
  author = "T. Zambaba",
  title = "Mega Laughanormous",
  edition = "2",
  publisher = "The Mafia",
  address = "Hoboken, New Jersey",
  year = "1997"
}

@book{SnowOrigins,
  author = "I. P. Snow",
  title = "The Nighttime Extortionist Microwaves a Light Bulb",
  edition = "9",
  publisher = "Bucksport Company",
  address = "San Francisco",
  year = "1999"
}

@book{BeeVomit,
  author = "E. T. BeeVomit",
  title = "The Honeycomb Matrix",
  edition = "",
  publisher = "Cambridge University Press",
  address = "",
  year = "1999"}

@book{WFartmann,
  author = "W. Fartmann",
  title = "Booze \& Plans 4 Tomorrow",
  edition = "6",
  publisher = "Dub Pub",
  address = "Miami, Florida",
  year = "1999"
}

@book{ChaseMax,
  author = "C. E. Max and J. E. Orive",
  title = "Myths about the Speed Demons on the Road",
  edition = "",
  publisher = "Benjamin Cummings",
  address = "San Francisco",
  year = "2001"
}

@book{Fix2004,
  author = "N. E. Fix and I. Paeyoo",
  title = "Lots of Money: If You Screw Me I Find You",
  edition = "",
  publisher = "McGraw--Hill",
  address = "New York",
  year = "2004"
}

@book{Lewiston,
  author = "W. Lewiston",
  title = "Mastery of the Internet: From Process to Production",
  edition = "4",
  publisher = "Online Press",
  address = "Everywhere",
  year = "2004"
}

@book{HTwCentry,
  author = "N. Hester and L. Blimey and W. Chesire",
  title = "The Colours of the Online Environment",
  edition = "4",
  publisher = "Chesire Company",
  address = "London",
  year = "2007"
}

@book{Schx1,
  author = "L. Schx and M. Savage",
  title = "Delivery from Dementia: an Extension of the Never-Motionless Mind",
  edition = "3",
  publisher = "McGraw--Hill",
  address = "New York",
  year = "2007"
}

@book{BenDoverReturns,
  author = "B. Dover and D. Nine",
  title = "When I Am Fixated on the Premature Mind I Dream about Long Titles",
  edition = "",
  publisher = "Boston Private Press",
  address = "Boston",
  year = "2012"
}

@book{JJCreeper,
  author = "I. C. U. Creeper",
  title = "How to creep around the house on tip toes and socks",
  edition = "",
  publisher = "Nighttime Illumination",
  address = "Atlanta, Georgia",
  year = "2010"
}

@book{FreeMe,
  author = "U. N. I. R. Free and I. M. Me",
  title = "Releaving your Old Self and Not Caring about the Mistakes You Make Along the Way",
  edition = "2",
  publisher = "House of Pride",
  address = "New York",
  year = "2011"
}

@book{Lini,
  author = "S. Lini and F. Lini",
  title = "Confusion about Commuting through the Fast Paced Cities",
  edition = "2",
  publisher = "Sickamore International",
  address = "Seattle",
  year = "2011"
}
\end{filecontents*}

\bibliographystyle{apacite}

\begin{document}
  \lipsum[1]  % not for use in the actual document
  \nocite{*}

  \bibliography{\jobname}
\end{document}
Does this give you the desired output? If you are not sure, compare with WriteLaTeX by clicking on open in writelatex just above the code button.

If it doesn't work on your system, upload the complete log and blg files.

Remember to first compile with latexpdflatex, then bibtex, then again with latex/pdflatex (2 times).
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
LavaTyper
Posts: 69
Joined: Sat Feb 11, 2012 2:38 am

Special Modifications to Bibliography Style

Post by LavaTyper »

Johannes_B wrote:Please test the following MWE (first posted by Thorsten in this thread)!
I already did that!
See post #10 of this thread. Here is what I said...I even put the text "Note" in to be absolutely sure that people would see it, look:
LavaTyper wrote: Note::

if I change the document class from "book" to "article" and \chapter to \section then it all works (**MWE**).
And I even mentioned the MWE with the clarifier: **MWE**
Changing "book" to "article" and \chapter to \section is the MWE first posted by Thorsten in this thread.


Also:

Johannes_B wrote: Remember to first compile with latexpdflatex, then bibtex, then again with latex/pdflatex (2 times).

Once again, I already said that I did that. See post #10 of this thread:
LavaTyper wrote:If I keep the \chapter and "book" options, then the first LaTeX typeset and first BiBTeX typeset works, but the second LaTeX typeset fails with error messages.

Deleting all files (log, aux, bbl) except for the .tex and references.bib file does not fix the problem.

So, why isn't it working??
LavaTyper
Posts: 69
Joined: Sat Feb 11, 2012 2:38 am

Re: Special Modifications to Bibliography Style

Post by LavaTyper »

[-- 11 days later --]


Guys, my time is running out. This is why I asked back in October I need help on this soon! :oops:
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Special Modifications to Bibliography Style

Post by Johannes_B »

The above example compiles completely fine for me. See the log of the last latex run and the pdf attached. Again, the MWE:

Code: Select all

\listfiles
\documentclass[12pt]{book}
\usepackage[T1]{fontenc}
\usepackage[doublespacing]{setspace}
\usepackage{apacite}
\usepackage{lipsum}  % not for use in the actual document

% Original code taken from "apacite.sty"
\makeatletter
\def\thebibliography#1{%
  \@ifundefined{chapter}%
    {\st@rtbibsection}%
    {\if@sectionbibdefault
       {\@ifundefined{@mainmatterfalse}%
          {\st@rtbibchapter}%
          {\if@mainmatter
             \st@rtbibsection
           \else
             \st@rtbibchapter
           \fi
          }%
       }%
     \else
        \if@sectionbib
          \st@rtbibsection
        \else
          \st@rtbibchapter
        \fi
     \fi
    }%
  \bibliographytypesize % e.g., to put the bibliography in \small type
  \bibliographyprenote  % some explanatory note before the references
  \@ifundefined{APAC@metaprenote@\APAC@extra@b@citeb}%
    {}% skip
    {\csname APAC@metaprenote@\APAC@extra@b@citeb\endcsname}%
  \list{\relax}{\singlespacing
                \labelsep=\biblabelsep
                \parsep=\bibparsep
                \itemsep=\bibitemsep
                \leftmargin=\bibleftmargin
                \itemindent=\bibindent}% changed to cope with 4th ed.
   \def\newblock{\hskip .11em plus .33em minus .07em}%
   \sloppy\clubpenalty10000\widowpenalty10000
   \sfcode`\.=1000\relax %'
   \bt@beg@thb@hook
   \APACrestorebibitem
}
\setlength{\bibitemsep}{%
  \ifcase \@ptsize \relax % 10pt
    0.6\baselineskip%
  \or % 11pt
    0.618\baselineskip%
  \or % 12pt
    0.604\baselineskip%
  \fi%
}
\makeatother

\usepackage{filecontents}

\begin{filecontents*}{\jobname.bib}
@book{ShipingOutWhere,
  author = "H. Shipping",
  title = "Expert Deliveries",
  edition = "",
  publisher = "Silly Dogcourt",
  address = "Boston",
  year = "1978"
}

@book{Shu1980,
  author = "D. F. Shu and J. S. Mikey",
  title = "Introduction to Small Packages",
  edition = "",
  publisher = "Lackluster University",
  address = "New York",
  year = "1980"
}

@book{SnowEssentials,
  author = "I. P. Snow",
  title = "The Nighttime Extortionist",
  edition = "3",
  publisher = "Bucksport Company",
  address = "San Francisco",
  year = "1990"
}

@book{Zambaba1,
  author = "T. Zambaba",
  title = "Mega Laughanormous",
  edition = "2",
  publisher = "The Mafia",
  address = "Hoboken, New Jersey",
  year = "1997"
}

@book{SnowOrigins,
  author = "I. P. Snow",
  title = "The Nighttime Extortionist Microwaves a Light Bulb",
  edition = "9",
  publisher = "Bucksport Company",
  address = "San Francisco",
  year = "1999"
}

@book{BeeVomit,
  author = "E. T. BeeVomit",
  title = "The Honeycomb Matrix",
  edition = "",
  publisher = "Cambridge University Press",
  address = "",
  year = "1999"}

@book{WFartmann,
  author = "W. Fartmann",
  title = "Booze \& Plans 4 Tomorrow",
  edition = "6",
  publisher = "Dub Pub",
  address = "Miami, Florida",
  year = "1999"
}

@book{ChaseMax,
  author = "C. E. Max and J. E. Orive",
  title = "Myths about the Speed Demons on the Road",
  edition = "",
  publisher = "Benjamin Cummings",
  address = "San Francisco",
  year = "2001"
}

@book{Fix2004,
  author = "N. E. Fix and I. Paeyoo",
  title = "Lots of Money: If You Screw Me I Find You",
  edition = "",
  publisher = "McGraw--Hill",
  address = "New York",
  year = "2004"
}

@book{Lewiston,
  author = "W. Lewiston",
  title = "Mastery of the Internet: From Process to Production",
  edition = "4",
  publisher = "Online Press",
  address = "Everywhere",
  year = "2004"
}

@book{HTwCentry,
  author = "N. Hester and L. Blimey and W. Chesire",
  title = "The Colours of the Online Environment",
  edition = "4",
  publisher = "Chesire Company",
  address = "London",
  year = "2007"
}

@book{Schx1,
  author = "L. Schx and M. Savage",
  title = "Delivery from Dementia: an Extension of the Never-Motionless Mind",
  edition = "3",
  publisher = "McGraw--Hill",
  address = "New York",
  year = "2007"
}

@book{BenDoverReturns,
  author = "B. Dover and D. Nine",
  title = "When I Am Fixated on the Premature Mind I Dream about Long Titles",
  edition = "",
  publisher = "Boston Private Press",
  address = "Boston",
  year = "2012"
}

@book{JJCreeper,
  author = "I. C. U. Creeper",
  title = "How to creep around the house on tip toes and socks",
  edition = "",
  publisher = "Nighttime Illumination",
  address = "Atlanta, Georgia",
  year = "2010"
}

@book{FreeMe,
  author = "U. N. I. R. Free and I. M. Me",
  title = "Releaving your Old Self and Not Caring about the Mistakes You Make Along the Way",
  edition = "2",
  publisher = "House of Pride",
  address = "New York",
  year = "2011"
}

@book{Lini,
  author = "S. Lini and F. Lini",
  title = "Confusion about Commuting through the Fast Paced Cities",
  edition = "2",
  publisher = "Sickamore International",
  address = "Seattle",
  year = "2011"
}
\end{filecontents*}

\bibliographystyle{apacite}

\begin{document}
  \lipsum[1]  % not for use in the actual document
  \nocite{*}

  \bibliography{\jobname}
\end{document}
Note the first line, this gives you a file list in the log. Compare the package versions and update your system if necessary.
Attachments
lavaBib.log
(4.6 KiB) Downloaded 692 times
lavaBib.pdf
(80.24 KiB) Downloaded 556 times
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
LavaTyper
Posts: 69
Joined: Sat Feb 11, 2012 2:38 am

Special Modifications to Bibliography Style

Post by LavaTyper »

Johannes_B,

once again the above example does not work for me.


I copied it, character for character. It does not work.


What am I supposed to do with your log file?


I'm using the latest MacTeX distribution. That contains all the latest packages already. I don't have any idea what else I'm supposed to update.


Here is my attached log and resulting PDF file...after I accept the error messages that I get.



(My time is running out. Can you guys suggest a modification to the code that won't give me error messages so I can just be done with this and move on?)
Attachments
thesis.pdf
(90.32 KiB) Downloaded 428 times
thesis.log
(5.98 KiB) Downloaded 579 times
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Special Modifications to Bibliography Style

Post by cgnieder »

LavaTyper wrote:What am I supposed to do with your log file?
Compare it with yours :)

In his log file I read

Code: Select all

 *File List*
    book.cls    2007/10/19 v1.4h Standard LaTeX document class
    bk12.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
 fontenc.sty
   t1enc.def    2005/09/27 v1.99g Standard LaTeX file
setspace.sty    2011/12/19 v6.7a set line spacing
 apacite.sty    2013/07/21 v6.03 APA citation
  lipsum.sty    2011/04/14 v1.2 150 paragraphs of Lorem Ipsum dummy text
filecontents.sty    2011/10/08 v1.3 Create an external file from within a LaTeX
 document
 english.apc    2013/07/21 v6.03 apacite language file
 lavaBib.bbl
 ***********
and in yours

Code: Select all

 *File List*
    book.cls    2007/10/19 v1.4h Standard LaTeX document class
    bk12.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
 fontenc.sty
   t1enc.def    2005/09/27 v1.99g Standard LaTeX file
setspace.sty    2011/12/19 v6.7a set line spacing
 apacite.sty    2012/02/25 v6.01 APA citation
  lipsum.sty    2011/04/14 v1.2 150 paragraphs of Lorem Ipsum dummy text
filecontents.sty    2011/10/08 v1.3 Create an external file from within a LaTeX
 document
 english.apc    2012/02/25 v6.01 apacite language file
  thesis.bbl
 ***********
which clearly shows that your version of apacite is not up to date. Johannes has 2013/07/21 v6.03 while you have 2012/02/25 v6.01.

Regards
site moderator & package author
Post Reply