TeX - LaTeX Asked by mszegedy on September 1, 2020
I am writing a letter with an APA-style bibliography, and I want to center the bibliography heading. There are no hooks in apacite
for controlling its formatting, so I’m going to have to renew section
(which isn’t defined in the letter
environment, but which I am defining for the body anyway). So I have written this code:
documentclass[12pt]{letter}
usepackage{microtype} % better spacing
usepackage[margin=1in]{geometry} % nice margins
usepackage[utf8]{inputenc} % utf-8 encoding
usepackage{block} % left-align everything
usepackage[natbibapa]{apacite} % citations
usepackage[english]{babel} % correct line breaks
usepackage{setspace} % double spacing
%addto{captionsenglish}{renewcommand{refname}{}}
newcommand{section}[1]{{bf #1}hfillbreak}
begin{document}
begin{letter}{}
bibliographystyle{apacite}
doublespacing
newcommand{newblock}{}
renewcommand{section}[1]{begin{center}#1end{center}}
bibliography{bibliography.bib}
singlespacing
end{letter}
end{document}
But instead of centering my header, it does this:
What does this mean? How do I prevent this?
The answer is obvious once you see it. apacite
is supplying two arguments to section
, one being the asterisk, and the other being the title. (I had my own battles with changing the title; it turned out to be an interaction with the babel
package, documented here.) So the correct code for the redefinition of section
is:
renewcommand{section}[2]{begin{center}#2end{center}}
Answered by mszegedy on September 1, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP