Text FormattingSpacings and paragraphs in bibliography (and other places)

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Spacings and paragraphs in bibliography (and other places)

Post by Cham »

I need to clear up a few things I see everywhere on the internet, about proper spacings and paragraphs commands. Many people are still using some very old and obsolete commands in LaTeX, so I don't want to learn wrong habits.

I'll take the specific example of a bibliography. Here's a MWE to work with (the class is arbitrary here. I took it from some real papers on arXiv, and modified it to show the main things I want to concentrate on) :

Code: Select all

\RequirePackage[l2tabu,orthodox]{nag}
\documentclass[11pt]{revtex4-1}
 
\begin{document}
  
\begin{thebibliography}{999}
\bibitem{bibitem1}
\uppercase{Some one}, \par \textit{Title 1}, \par Found.\ Phys.\  \textbf{47}, no. 6, 797 (1980).

\medskip

\bibitem{bibitem2}
\uppercase{Some guy}, \par \textit{Title 2}, \par Phys.\ Rev.\ D \textbf{65}, 103522 (1990).
\end{thebibliography}
 
\end{document}
So, should I use \ (for a space) as shown in this example ? Or use ~ instead ? Or somehing else ?

For a change of paragraph in text mode, Should I use \\ (I believe this is obsolete), or \par, or \newline (or even something else) in the bibliography?

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Spacings and paragraphs in bibliography (and other places)

Post by Johannes_B »

\ is a space, which can be broken upon lines, while ~ is unbreakable.
\\ is never to be used outside tabulars end equations. If you want to start a new paragraph, leave an empty line in the source code.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

Spacings and paragraphs in bibliography (and other places)

Post by Cham »

If \ is a simple breakable space, why people are using it in their code ? I'm wondering about this since I see \ very often in arXiv codes (or from other places). I suspect that \ is totally useless.

For a journal name made of several words, should we "link" the words with a unbreakable space (i.e. ~) ? What about people names, ex: "Albert Einstein", or "A., Einstein" ? Should we write "Albert~Einstein", or "A.~Einstein" ? I'm expecting some typographical conventions here.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Spacings and paragraphs in bibliography (and other places)

Post by Johannes_B »

Albert Eistein
A.~Einstein
I am a \LaTeX\ fan.


It really depends on what you want to get.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Spacings and paragraphs in bibliography (and other places)

Post by Stefan Kottwitz »

\ is a white space. It's not a space between commands or commands and stuff. A simple space ends a command name. So,
  • \TeX ing prints TeXing
  • \TeX\ user prints TeX user (with the space)
  • \TeX~user prints TeX user (with nonbreaking space)
One normally uses spaces in text, they are commonly printed. But a space that ends a command is not printed. So one can enforce a printed whitespace with the backslash. The non-breaking space is just for when you really don't want an annoying break, such as with "S.~Kottwitz" when I don't want to have just S. at the end of a line.

Stefan
LaTeX.org admin
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Spacings and paragraphs in bibliography (and other places)

Post by Johannes_B »

\~ is the control sequence to print a tilde as a diacritical. ;-)
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Spacings and paragraphs in bibliography (and other places)

Post by Stefan Kottwitz »

Thanks, corrected. I normally don't use such a thing. :-)

Stefan
LaTeX.org admin
Post Reply