keepcalculator

06 Numbers and Powers

Escape Running Head Codes: Fix APA & MLA Headers

Card No. 06·75925 · Updated · Standard formula, shown below

Running head codes (like \field{…} in Word or \markboth{…} in LaTeX) are the hidden formatting instructions that create the short title at the top of every page in an APA paper. If you see the raw code instead of your header text, or if the header won’t update, this article explains what those codes are, why they break, and how to fix or replace them in Word, Google Docs, and LaTeX.

What Are Running Head Codes?

A running head is the abbreviated title that appears in the header of each page, usually in all caps. In word processors and typesetting systems, it is not plain text—it is a field or a command that tells the software to insert the title automatically. For example:

  • Microsoft Word uses field codes such as { STYLEREF 1 \* MERGEFORMAT } or { PAGE } to pull the title from your document’s Heading 1 style.
  • LaTeX uses commands like \markboth{Left}{Right} or \pagestyle{headings} to set what appears in the header.
  • Google Docs does not use field codes by default, but you can insert page numbers and manually type the title.

When these codes are displayed literally (e.g., you see { STYLEREF 1 } instead of “MY TITLE”), it usually means the field code display is toggled on, or the style reference is broken.

Why Do Running Head Codes Break?

There are three common reasons you might see the raw code instead of the actual header:

  1. Field codes are toggled to show the code – In Word, pressing Alt+F9 toggles between showing field results and field codes. If you accidentally hit that key combination, all fields in the document display as code.
  2. The referenced style is missing or renamed – If the running head pulls from Heading 1 and you deleted or renamed that style, the field cannot resolve and may show an error or the code itself.
  3. The document was converted from another format – Opening a PDF or an HTML file in Word can turn header text into literal field codes that no longer work.

How to Fix Running Head Codes in Word

If you see { STYLEREF 1 \* MERGEFORMAT } in your header, do this:

  1. Click inside the header area (double-click at the top of any page).
  2. Press Alt+F9 to toggle the field code display off. The actual title text should appear.
  3. If it still shows an error like Error! No text of specified style in document, check that your title uses the Heading 1 style. Select the title text, go to the Home tab, and click the Heading 1 style.
  4. If the field still doesn’t update, right-click the field and choose Update Field, or press F9.

If you want to remove the field entirely and just type plain text, click on the field, press Ctrl+Shift+F9 to unlink it. That converts the field to static text that won’t change.

How to Fix Running Head Codes in Google Docs

Google Docs does not use field codes, so the “running head code” problem usually comes from pasting content from Word. If you see something like { STYLEREF 1 } in a Google Doc, it was pasted as plain text. To fix it:

  1. Delete the pasted code.
  2. Go to Insert > Header & page number > Header.
  3. Type your running head manually (e.g., MY TITLE).
  4. Add a page number by going to Insert > Page numbers and choosing the top-right option.

Google Docs doesn’t support automatic style references, so you must type the title each time you create a new document.

How to Fix Running Head Codes in LaTeX

In LaTeX, running head codes are commands like \markboth or \leftmark. If you see the command text in your PDF, it means the command is not being executed—often because you used it outside the header, or you forgot to load the fancyhdr package. Here’s a minimal fix:

  1. Add \usepackage{fancyhdr} to your preamble.
  2. Set the page style: \pagestyle{fancy}.
  3. Define the header: \fancyhead[L]{MY TITLE} for left-aligned, or [R] for right.

If you’re using the default headings style, the running head is taken from the current chapter or section. If you see the literal command, check that you didn’t put a backslash before a space—\markboth must be inside the header, not in the body text.

Common Mistakes and Misconceptions

One common mistake is confusing running head with page numbers. The running head is the title text; the page number is separate. In APA 7th edition, the running head is no longer required for student papers, but it is still used in professional papers. Many people also think that pressing Alt+F9 is a “secret” that breaks the document—it doesn’t, it’s just a toggle.

Another misconception: if you see { PAGE } in the header, that’s a page number field, not a running head. It works the same way—toggle with Alt+F9—but it’s not the title.

Alternatives to Field Codes

If field codes are causing too much trouble, you can bypass them entirely:

  • Type the running head as plain text – In Word, just type your title in the header. It won’t update automatically if you change the title, but it’s simple and never breaks.
  • Use a style reference only for the first page – For APA, you only need the running head on the first page, so you can type it manually and not worry about fields at all.
  • Use a template – Many university templates have the running head already set up correctly. You just replace the placeholder text.

Frequently Asked Questions

Why do I see { STYLEREF 1 } instead of my title?

This happens when Word’s field code display is toggled on. Press Alt+F9 to show the field results instead of the code. If that doesn’t work, the field may be broken because the referenced style doesn’t exist—check that your title uses Heading 1.

How do I remove a running head field code?

Click on the field, then press Ctrl+Shift+F9 in Word. This unlinks the field and turns it into static text. You can then edit it like normal text.

Does APA 7 require a running head?

For student papers, no. For professional papers (those submitted for publication), yes. Check your instructor’s guidelines. If you do need one, it should be a shortened title (max 50 characters) in all caps, aligned left in the header.

Why does my running head show on every page except the first?

In APA, the running head on the first page is often different (it includes the words “Running head:” in APA 6, but not in APA 7). In Word, you likely have a different first page header. Go to the header, check the Different First Page box, and set the first-page header separately.

Can I use a running head in Google Docs?

Yes, but you have to type it manually. Google Docs doesn’t support automatic style references, so you can’t create a field that pulls the title from your document. Just type the title in the header and add a page number.

What does \markboth mean in LaTeX?

It’s a command that sets the left and right running head marks. It’s used with the fancyhdr package. If you see the literal command in your PDF, it means you placed it in the body instead of the header, or you forgot to load the package.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →