3

I am using \usepackage{hyperref} and \urlstyle{rm} to produce urls in roman font in my documents. However, when I also include \usepackage{apacite} the font is no longer roman, but typewriter for the urls.

This code works correctly and displays the url in roman font:

\documentclass[12pt]{article}

\usepackage{hyperref}

\urlstyle{rm}

\begin{document}

\url{http://en.wikipedia.org/wiki/Function_(mathematics)}

\end{document}

Which generates this:

url in roman font

However, when I add the package apacite, it no longer displays in roman, but rather in typewriter font:

\documentclass[12pt]{article}
\usepackage{apacite}

\usepackage{hyperref}

\urlstyle{rm}

\begin{document}

\url{http://en.wikipedia.org/wiki/Function_(mathematics)}

\end{document}

Which generates this:

url in tt font

I have tried it with the \usepackage{apacite} coming after the \urlstyle{rm} but it doesn't make a difference.

3

Package apacite sets \urlstyle inside \AtBeginDocument to APACtt. Therefore switching back to rm should be done at a later time, e.g.:

\documentclass[12pt]{article}
\usepackage{apacite}

\usepackage{hyperref}

\AtBeginDocument{%
  \urlstyle{APACrm}% APAC version of rm
  % \urlstyle{rm}%
}

\begin{document}

\url{http://en.wikipedia.org/wiki/Function_(mathematics)}

\end{document}

Result

  • How did you produce the blockquote in your answer with the transparent background? i.e. What markup did you use besides blockquote and how did you get an image with transparent background from your latex? – decuser Sep 1 '14 at 12:03
  • @WillSenn Simple quote markup (> ...) with PNG image, generated via ghostscript's pngalpha device. – Heiko Oberdiek Sep 1 '14 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.