2

I have been using LaTeX now for a little over a year, but it has always been for simple things such as typing up my math homework. Now I am using it for a much larger project that includes tables, graphics, references, etc. I knew about BiBTeX but I couldn't seem to get it to work properly, so I resorted to using the built in bibliography environment, and I have had some formatting issues. I also have quite a large amount of sources already, so it would be tedious to switch to BiBTeX now. Anyways, I have lots of trouble when attempting to indent my sources after the first line (APA7 style). I have to continually guess when there cannot be any more characters on a line and continually use \hspace awkwardly. Here is an example (the first item shows the formatting that I would like to see, but this has to be done with the annoying hspaces, while the second item is an unformatted entry that gives a warning):

\documentclass{article}
\usepackage[utf8]{inputenc}

\begin{document}
\begin{thebibliography}{99}
\bibitem{TARDI2021}
Tardi, C.
(2021, September 13).
\textit{Why has gold always been valuable?}
In-
\hspace*{10mm} vestopedia.
Retrieved September 16, 2021,
from https://www.inves-
\hspace*{10mm} topedia.com/articles/investing/071114/why-gold-has- 
always-had-v
\hspace*{10mm} alue.asp.

\bibitem{CFTC2021}
\textit{Digital assets.} CFTC. (n.d.). Retrieved September 23, 2021, 
from https://www.cftc.gov/digitalassets/index.htm. 
\end{thebibliography}

\end{document}

When I do not do this annoying guessing and checking in order to make sure that only the exact amount of characters fit per line, I get an underfull hbox warning and the text seems to be separated in an odd way (words are separately by spaces larger than the typical single space) and the indents are completely misaligned. I know I am probably doing this completely wrong, so go easy on me. Thanks!

4
  • 1
    Welcome to TeX.SE! First, do not add code as image, we can simply not copy the code and test it on our own computers ... Second: Can you show a short compilable TeX code calling bibtex and two bib entries, that we can see which error(s) you get (you did not name them :-( )
    – Mensch
    Commented Sep 29, 2021 at 22:57
  • Alright, I edited my original post and I hope that is what you are looking for now :)
    – Gigaknight
    Commented Sep 29, 2021 at 23:13
  • 1
    Well, can you add the code you tried with bibtex (add two bib entrys you have used). Then we can see the error you got with bibtex and can help you. Manual formating as you did in your current MWE is not the best way ...
    – Mensch
    Commented Sep 29, 2021 at 23:18
  • I don't think that the errors were from anything in my code in particular, but instead because of the multi-step compilation when using bibtex that has always confused me and has not worked since I do not know what I am doing.
    – Gigaknight
    Commented Sep 29, 2021 at 23:30

2 Answers 2

4

You've identified one of the big issues posed by creating a bibliography by hand (via the thebibliography mechanism): the time-consuming, deeply meaningless, and rather error-prone nature of the work. I'd say that another, and possibly even more serious, issue is the following: if you provide URL strings in the formatted entry, the hand-crafted nature of line-breaks in these URL strings pretty much assures that your readers will not be able to reach the websites simply by clicking on the URL string from within a pdf viewer. Nowadays, pretty much all readers of pdf documents expect to be able to click on a URL string and be taken to the corresponding site or document. If you don't provide this facility, your readers may well become irritated and not continue reading your piece.

The longer you delay teaching yourself the basics of LaTeX-based bibliography creation, the worse these problems will become. Creating a bib file by hand is, admittedly, not much fun either. However, it's a one-time effort, whereas creating bibliographies by hand is a recurring chore, made all the more burdensome if your papers have to conform to, shall we say charitably, heterogeneous stylistic requirements imposed by journals and book publishers.

Anyway, it took me less than 5 minutes to create two bib entries from the information you provided (note the author field for the CFTC entry). Then, assuming you use biblatex and biber, all you need to do is specify the package option style = apa in order to get the bibliographic entries formatted according to APA7 guidelines.


enter image description here

\documentclass{article}
\begin{filecontents}[overwrite]{mybib.bib}
@online{TARDI2021,
  author = "Tardi, Carla",
  date   = "2021-09-13",
  title  = "Why has gold always been valuable?",
  organization = "Investopedia",
  urldate= "2021-09-16",
  url    = "https://www.investopedia.com/articles/investing/071114/why-gold-has-always-had-value.asp",
}
@online{CFTC2021,
  author = "CFTC",
  title  = "Digital assets",
  organization = "CFTC",
  urldate= "2021-09-13",
  url    = "https://www.cftc.gov/digitalassets/index.htm",
}
\end{filecontents}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{xurl} % <-- important
\usepackage[colorlinks,allcolors=blue]{hyperref} % <-- optional

\usepackage[style=apa]{biblatex}
\addbibresource{mybib.bib}

\begin{document}
\noindent
\cite{TARDI2021}; \cite{CFTC2021}.
\printbibliography
\end{document}
0

Some remarks in addition to @Mico 's answer about creating a bibliography.

WYSIWIG programs like MicroSoft Word or LibreOffice Writer have a build-in editor to create a references database. That database contains specifically named fields to enter the data of a reference. These fields are used by the text processor to generate a bibliography according to a certain style like APA or Chicago. Although in my experience most users enter their references like @Gigaknight did in his example.

LaTeX (or any TeX) isn't WYSIWIG, but has powerful macro's and modules to create a bibliography in a document. Biblatex (or the native Bibtex) are examples of those macro's / modules. But these add-ons don't provide you with the possibility to create a database with references. Granted: you can create a handmade *.bib file as database. But you have extensive knowledge of entry types and formatting doing that, as Mico already pointed out.

Fortunately, there are open source solutions to that issue. One example is to use the program Zotero (available from: Zotero.org. This program has a connector to use in browsers and a program to edit and browse collected references. It is available for Windows, Mac and Linux. Once installed a good add-on to Zotero is BetterBibTex, that extends certain functions in Zotero.

Organising the referrences in Zotero is actually a breeze. You can enter all data required to indentify the reference and add keywords, notes and collections to them. Making a map allows you to gather specific references that can be exported to a .bib file. Subsequently you can use that .bib file in your TeX document by adding the line \addbibresource{<name>.bib}.

I hope this short suggestion helps you to create professional looking bibligraphies.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .