LaTeX forum ⇒ Text FormattingSpacings and paragraphs in bibliography (and other places) Topic is solved

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

Spacings and paragraphs in bibliography (and other places)

Postby Cham » Sat Dec 02, 2017 6:13 pm

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) :
  1. \RequirePackage[l2tabu,orthodox]{nag}
  2. \documentclass[11pt]{revtex4-1}
  3.  
  4. \begin{document}
  5.  
  6. \begin{thebibliography}{999}
  7. \bibitem{bibitem1}
  8. \uppercase{Some one}, \par \textit{Title 1}, \par Found.\ Phys.\ \textbf{47}, no. 6, 797 (1980).
  9.  
  10. \medskip
  11.  
  12. \bibitem{bibitem2}
  13. \uppercase{Some guy}, \par \textit{Title 2}, \par Phys.\ Rev.\ D \textbf{65}, 103522 (1990).
  14. \end{thebibliography}
  15.  
  16. \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?

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

Postby Johannes_B » Sat Dec 02, 2017 6:45 pm

\ 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: 819
Joined: Sat Apr 02, 2011 4:06 pm

Postby Cham » Sat Dec 02, 2017 6:50 pm

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

Postby Johannes_B » Sat Dec 02, 2017 7:16 pm

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: 8534
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Sat Dec 02, 2017 7:20 pm

\ 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
Site admin

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

Postby Johannes_B » Sat Dec 02, 2017 7:23 pm

\~ 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: 8534
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Sat Dec 02, 2017 7:39 pm

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

Stefan
Site admin


Return to “Text Formatting”

Who is online

Users browsing this forum: No registered users and 5 guests