LaTeX forum ⇒ Text FormattingSpecial Modifications to Bibliography Style Topic is solved

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

Re: Special Modifications to Bibliography Style

Postby localghost » Sat Nov 16, 2013 7:34 pm

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.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Tags:

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

Postby LavaTyper » Fri Nov 22, 2013 4:02 pm

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: 68
Joined: Sat Feb 11, 2012 2:38 am

Postby LavaTyper » Sat Nov 23, 2013 8:19 pm

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 248 times
Last edited by localghost on Sun Nov 24, 2013 10:07 am, edited 1 time in total.
Reason: Complete files are better uploaded as attachment to the forum server instead of being posted as code.

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

Postby LavaTyper » Wed Dec 04, 2013 12:23 am

[ - 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 5538 times
ExtraReferences.jpg
ExtraReferences.jpg (56.16 KiB) Viewed 5538 times

User avatar
Johannes_B
Site Moderator
Posts: 4077
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Wed Dec 04, 2013 10:08 am

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

  1. \documentclass[12pt]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[doublespacing]{setspace}
  4. \usepackage{apacite}
  5. \usepackage{lipsum} % not for use in the actual document
  6.  
  7. % Original code taken from "apacite.sty"
  8. \makeatletter
  9. \def\thebibliography#1{%
  10. \@ifundefined{chapter}%
  11. {\st@rtbibsection}%
  12. {\if@sectionbibdefault
  13. {\@ifundefined{@mainmatterfalse}%
  14. {\st@rtbibchapter}%
  15. {\if@mainmatter
  16. \st@rtbibsection
  17. \else
  18. \st@rtbibchapter
  19. \fi
  20. }%
  21. }%
  22. \else
  23. \if@sectionbib
  24. \st@rtbibsection
  25. \else
  26. \st@rtbibchapter
  27. \fi
  28. \fi
  29. }%
  30. \bibliographytypesize % e.g., to put the bibliography in \small type
  31. \bibliographyprenote % some explanatory note before the references
  32. \@ifundefined{APAC@metaprenote@\APAC@extra@b@citeb}%
  33. {}% skip
  34. {\csname APAC@metaprenote@\APAC@extra@b@citeb\endcsname}%
  35. \list{\relax}{\singlespacing
  36. \labelsep=\biblabelsep
  37. \parsep=\bibparsep
  38. \itemsep=\bibitemsep
  39. \leftmargin=\bibleftmargin
  40. \itemindent=\bibindent}% changed to cope with 4th ed.
  41. \def\newblock{\hskip .11em plus .33em minus .07em}%
  42. \sloppy\clubpenalty10000\widowpenalty10000
  43. \sfcode`\.=1000\relax %'
  44. \bt@beg@thb@hook
  45. \APACrestorebibitem
  46. }
  47. \setlength{\bibitemsep}{%
  48. \ifcase \@ptsize \relax % 10pt
  49. 0.6\baselineskip%
  50. \or % 11pt
  51. 0.618\baselineskip%
  52. \or % 12pt
  53. 0.604\baselineskip%
  54. \fi%
  55. }
  56. \makeatother
  57.  
  58. \usepackage{filecontents}
  59.  
  60. \begin{filecontents*}{\jobname.bib}
  61. @book{ShipingOutWhere,
  62. author = "H. Shipping",
  63. title = "Expert Deliveries",
  64. edition = "",
  65. publisher = "Silly Dogcourt",
  66. address = "Boston",
  67. year = "1978"
  68. }
  69.  
  70. @book{Shu1980,
  71. author = "D. F. Shu and J. S. Mikey",
  72. title = "Introduction to Small Packages",
  73. edition = "",
  74. publisher = "Lackluster University",
  75. address = "New York",
  76. year = "1980"
  77. }
  78.  
  79. @book{SnowEssentials,
  80. author = "I. P. Snow",
  81. title = "The Nighttime Extortionist",
  82. edition = "3",
  83. publisher = "Bucksport Company",
  84. address = "San Francisco",
  85. year = "1990"
  86. }
  87.  
  88. @book{Zambaba1,
  89. author = "T. Zambaba",
  90. title = "Mega Laughanormous",
  91. edition = "2",
  92. publisher = "The Mafia",
  93. address = "Hoboken, New Jersey",
  94. year = "1997"
  95. }
  96.  
  97. @book{SnowOrigins,
  98. author = "I. P. Snow",
  99. title = "The Nighttime Extortionist Microwaves a Light Bulb",
  100. edition = "9",
  101. publisher = "Bucksport Company",
  102. address = "San Francisco",
  103. year = "1999"
  104. }
  105.  
  106. @book{BeeVomit,
  107. author = "E. T. BeeVomit",
  108. title = "The Honeycomb Matrix",
  109. edition = "",
  110. publisher = "Cambridge University Press",
  111. address = "",
  112. year = "1999"}
  113.  
  114. @book{WFartmann,
  115. author = "W. Fartmann",
  116. title = "Booze \& Plans 4 Tomorrow",
  117. edition = "6",
  118. publisher = "Dub Pub",
  119. address = "Miami, Florida",
  120. year = "1999"
  121. }
  122.  
  123. @book{ChaseMax,
  124. author = "C. E. Max and J. E. Orive",
  125. title = "Myths about the Speed Demons on the Road",
  126. edition = "",
  127. publisher = "Benjamin Cummings",
  128. address = "San Francisco",
  129. year = "2001"
  130. }
  131.  
  132. @book{Fix2004,
  133. author = "N. E. Fix and I. Paeyoo",
  134. title = "Lots of Money: If You Screw Me I Find You",
  135. edition = "",
  136. publisher = "McGraw--Hill",
  137. address = "New York",
  138. year = "2004"
  139. }
  140.  
  141. @book{Lewiston,
  142. author = "W. Lewiston",
  143. title = "Mastery of the Internet: From Process to Production",
  144. edition = "4",
  145. publisher = "Online Press",
  146. address = "Everywhere",
  147. year = "2004"
  148. }
  149.  
  150. @book{HTwCentry,
  151. author = "N. Hester and L. Blimey and W. Chesire",
  152. title = "The Colours of the Online Environment",
  153. edition = "4",
  154. publisher = "Chesire Company",
  155. address = "London",
  156. year = "2007"
  157. }
  158.  
  159. @book{Schx1,
  160. author = "L. Schx and M. Savage",
  161. title = "Delivery from Dementia: an Extension of the Never-Motionless Mind",
  162. edition = "3",
  163. publisher = "McGraw--Hill",
  164. address = "New York",
  165. year = "2007"
  166. }
  167.  
  168. @book{BenDoverReturns,
  169. author = "B. Dover and D. Nine",
  170. title = "When I Am Fixated on the Premature Mind I Dream about Long Titles",
  171. edition = "",
  172. publisher = "Boston Private Press",
  173. address = "Boston",
  174. year = "2012"
  175. }
  176.  
  177. @book{JJCreeper,
  178. author = "I. C. U. Creeper",
  179. title = "How to creep around the house on tip toes and socks",
  180. edition = "",
  181. publisher = "Nighttime Illumination",
  182. address = "Atlanta, Georgia",
  183. year = "2010"
  184. }
  185.  
  186. @book{FreeMe,
  187. author = "U. N. I. R. Free and I. M. Me",
  188. title = "Releaving your Old Self and Not Caring about the Mistakes You Make Along the Way",
  189. edition = "2",
  190. publisher = "House of Pride",
  191. address = "New York",
  192. year = "2011"
  193. }
  194.  
  195. @book{Lini,
  196. author = "S. Lini and F. Lini",
  197. title = "Confusion about Commuting through the Fast Paced Cities",
  198. edition = "2",
  199. publisher = "Sickamore International",
  200. address = "Seattle",
  201. year = "2011"
  202. }
  203. \end{filecontents*}
  204.  
  205. \bibliographystyle{apacite}
  206.  
  207. \begin{document}
  208. \lipsum[1] % not for use in the actual document
  209. \nocite{*}
  210.  
  211. \bibliography{\jobname}
  212. \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: 68
Joined: Sat Feb 11, 2012 2:38 am

Postby LavaTyper » Wed Dec 04, 2013 7:28 pm

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: 68
Joined: Sat Feb 11, 2012 2:38 am

Postby LavaTyper » Sun Dec 15, 2013 11:18 pm

[-- 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: 4077
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Dec 16, 2013 10:59 am

The above example compiles completely fine for me. See the log of the last latex run and the pdf attached. Again, the MWE:
  1. \listfiles
  2. \documentclass[12pt]{book}
  3. \usepackage[T1]{fontenc}
  4. \usepackage[doublespacing]{setspace}
  5. \usepackage{apacite}
  6. \usepackage{lipsum} % not for use in the actual document
  7.  
  8. % Original code taken from "apacite.sty"
  9. \makeatletter
  10. \def\thebibliography#1{%
  11. \@ifundefined{chapter}%
  12. {\st@rtbibsection}%
  13. {\if@sectionbibdefault
  14. {\@ifundefined{@mainmatterfalse}%
  15. {\st@rtbibchapter}%
  16. {\if@mainmatter
  17. \st@rtbibsection
  18. \else
  19. \st@rtbibchapter
  20. \fi
  21. }%
  22. }%
  23. \else
  24. \if@sectionbib
  25. \st@rtbibsection
  26. \else
  27. \st@rtbibchapter
  28. \fi
  29. \fi
  30. }%
  31. \bibliographytypesize % e.g., to put the bibliography in \small type
  32. \bibliographyprenote % some explanatory note before the references
  33. \@ifundefined{APAC@metaprenote@\APAC@extra@b@citeb}%
  34. {}% skip
  35. {\csname APAC@metaprenote@\APAC@extra@b@citeb\endcsname}%
  36. \list{\relax}{\singlespacing
  37. \labelsep=\biblabelsep
  38. \parsep=\bibparsep
  39. \itemsep=\bibitemsep
  40. \leftmargin=\bibleftmargin
  41. \itemindent=\bibindent}% changed to cope with 4th ed.
  42. \def\newblock{\hskip .11em plus .33em minus .07em}%
  43. \sloppy\clubpenalty10000\widowpenalty10000
  44. \sfcode`\.=1000\relax %'
  45. \bt@beg@thb@hook
  46. \APACrestorebibitem
  47. }
  48. \setlength{\bibitemsep}{%
  49. \ifcase \@ptsize \relax % 10pt
  50. 0.6\baselineskip%
  51. \or % 11pt
  52. 0.618\baselineskip%
  53. \or % 12pt
  54. 0.604\baselineskip%
  55. \fi%
  56. }
  57. \makeatother
  58.  
  59. \usepackage{filecontents}
  60.  
  61. \begin{filecontents*}{\jobname.bib}
  62. @book{ShipingOutWhere,
  63. author = "H. Shipping",
  64. title = "Expert Deliveries",
  65. edition = "",
  66. publisher = "Silly Dogcourt",
  67. address = "Boston",
  68. year = "1978"
  69. }
  70.  
  71. @book{Shu1980,
  72. author = "D. F. Shu and J. S. Mikey",
  73. title = "Introduction to Small Packages",
  74. edition = "",
  75. publisher = "Lackluster University",
  76. address = "New York",
  77. year = "1980"
  78. }
  79.  
  80. @book{SnowEssentials,
  81. author = "I. P. Snow",
  82. title = "The Nighttime Extortionist",
  83. edition = "3",
  84. publisher = "Bucksport Company",
  85. address = "San Francisco",
  86. year = "1990"
  87. }
  88.  
  89. @book{Zambaba1,
  90. author = "T. Zambaba",
  91. title = "Mega Laughanormous",
  92. edition = "2",
  93. publisher = "The Mafia",
  94. address = "Hoboken, New Jersey",
  95. year = "1997"
  96. }
  97.  
  98. @book{SnowOrigins,
  99. author = "I. P. Snow",
  100. title = "The Nighttime Extortionist Microwaves a Light Bulb",
  101. edition = "9",
  102. publisher = "Bucksport Company",
  103. address = "San Francisco",
  104. year = "1999"
  105. }
  106.  
  107. @book{BeeVomit,
  108. author = "E. T. BeeVomit",
  109. title = "The Honeycomb Matrix",
  110. edition = "",
  111. publisher = "Cambridge University Press",
  112. address = "",
  113. year = "1999"}
  114.  
  115. @book{WFartmann,
  116. author = "W. Fartmann",
  117. title = "Booze \& Plans 4 Tomorrow",
  118. edition = "6",
  119. publisher = "Dub Pub",
  120. address = "Miami, Florida",
  121. year = "1999"
  122. }
  123.  
  124. @book{ChaseMax,
  125. author = "C. E. Max and J. E. Orive",
  126. title = "Myths about the Speed Demons on the Road",
  127. edition = "",
  128. publisher = "Benjamin Cummings",
  129. address = "San Francisco",
  130. year = "2001"
  131. }
  132.  
  133. @book{Fix2004,
  134. author = "N. E. Fix and I. Paeyoo",
  135. title = "Lots of Money: If You Screw Me I Find You",
  136. edition = "",
  137. publisher = "McGraw--Hill",
  138. address = "New York",
  139. year = "2004"
  140. }
  141.  
  142. @book{Lewiston,
  143. author = "W. Lewiston",
  144. title = "Mastery of the Internet: From Process to Production",
  145. edition = "4",
  146. publisher = "Online Press",
  147. address = "Everywhere",
  148. year = "2004"
  149. }
  150.  
  151. @book{HTwCentry,
  152. author = "N. Hester and L. Blimey and W. Chesire",
  153. title = "The Colours of the Online Environment",
  154. edition = "4",
  155. publisher = "Chesire Company",
  156. address = "London",
  157. year = "2007"
  158. }
  159.  
  160. @book{Schx1,
  161. author = "L. Schx and M. Savage",
  162. title = "Delivery from Dementia: an Extension of the Never-Motionless Mind",
  163. edition = "3",
  164. publisher = "McGraw--Hill",
  165. address = "New York",
  166. year = "2007"
  167. }
  168.  
  169. @book{BenDoverReturns,
  170. author = "B. Dover and D. Nine",
  171. title = "When I Am Fixated on the Premature Mind I Dream about Long Titles",
  172. edition = "",
  173. publisher = "Boston Private Press",
  174. address = "Boston",
  175. year = "2012"
  176. }
  177.  
  178. @book{JJCreeper,
  179. author = "I. C. U. Creeper",
  180. title = "How to creep around the house on tip toes and socks",
  181. edition = "",
  182. publisher = "Nighttime Illumination",
  183. address = "Atlanta, Georgia",
  184. year = "2010"
  185. }
  186.  
  187. @book{FreeMe,
  188. author = "U. N. I. R. Free and I. M. Me",
  189. title = "Releaving your Old Self and Not Caring about the Mistakes You Make Along the Way",
  190. edition = "2",
  191. publisher = "House of Pride",
  192. address = "New York",
  193. year = "2011"
  194. }
  195.  
  196. @book{Lini,
  197. author = "S. Lini and F. Lini",
  198. title = "Confusion about Commuting through the Fast Paced Cities",
  199. edition = "2",
  200. publisher = "Sickamore International",
  201. address = "Seattle",
  202. year = "2011"
  203. }
  204. \end{filecontents*}
  205.  
  206. \bibliographystyle{apacite}
  207.  
  208. \begin{document}
  209. \lipsum[1] % not for use in the actual document
  210. \nocite{*}
  211.  
  212. \bibliography{\jobname}
  213. \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 223 times
lavaBib.pdf
(80.24 KiB) Downloaded 157 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: 68
Joined: Sat Feb 11, 2012 2:38 am

Postby LavaTyper » Mon Dec 16, 2013 10:00 pm

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 160 times
thesis.log
(5.98 KiB) Downloaded 236 times

User avatar
cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Mon Dec 16, 2013 10:13 pm

LavaTyper wrote:What am I supposed to do with your log file?


Compare it with yours :)

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

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


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
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 5 guests