# Running headers from titles in the document

**URL:** <https://forum.literatureandlatte.com/t/running-headers-from-titles-in-the-document/136164>\
**Category:** Scrivener\
**Tags:** support, compile\
**Created:** [September 9, 2023, 10:34am UTC](https://forum.literatureandlatte.com/t/running-headers-from-titles-in-the-document/136164 "2023-09-09T10:34:39Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![ptram](https://forum.literatureandlatte.com/letter_avatar_proxy/v4/letter/p/49beb7/32.png) [@ptram](https://forum.literatureandlatte.com/u/ptram)\
**Post date:** [September 9, 2023, 10:34am UTC](https://forum.literatureandlatte.com/t/running-headers-from-titles-in-the-document/136164/1 "2023-09-09T10:34:39Z")

</div>

Hi,

I’m sure this must be existing, but I can’t find it. Scrivener has a native variable/placeholder for running headers (`<$pageGroupTitle>`). This gets the variable text from the actual name of the document.

However, I don’t use the actual name of a document in the output. The English name remains unchanged even in the translated documents, so that the project’s structure remains readable even with languages not everybody is supposed to know.

For example, I might have a document’s name in English, and the title to be output, as a styled heading inside the document, in Japanese.

I can’t find a way to use the styled headings as placeholders for running headers. Does a native variable exist? Or, is it a workaround to simulate it?

Paolo

---

<div class="post-metadata">

**Author:** ![Vincent\_Vincent](https://forum.literatureandlatte.com/user_avatar/forum.literatureandlatte.com/vincent_vincent/32/19680_2.png) [@Vincent\_Vincent](https://forum.literatureandlatte.com/u/Vincent_Vincent)\
**Post date:** [September 9, 2023, 12:07pm UTC](https://forum.literatureandlatte.com/t/running-headers-from-titles-in-the-document/136164/2 "2023-09-09T12:07:38Z")

</div>

There is a placeholder for custom metadata.  
Surely you have to type that alternative title somewhere…

 ![image](https://forum.literatureandlatte.com/uploads/default/original/3X/c/c/cce34e6369361dc3dc3a8456ea5b5a8652d1d8b4.png)

---

<div class="post-metadata">

**Author:** ![AntoniDol](https://forum.literatureandlatte.com/user_avatar/forum.literatureandlatte.com/antonidol/32/15972_2.png) [@AntoniDol](https://forum.literatureandlatte.com/u/AntoniDol)\
**Post date:** [September 9, 2023, 12:26pm UTC](https://forum.literatureandlatte.com/t/running-headers-from-titles-in-the-document/136164/3 "2023-09-09T12:26:36Z")

</div>

If you search for “\<$pageGroupTitle\>” in this forum, do the answers solve your problem?

---

<div class="post-metadata">

**Author:** ![ptram](https://forum.literatureandlatte.com/letter_avatar_proxy/v4/letter/p/49beb7/32.png) [@ptram](https://forum.literatureandlatte.com/u/ptram)\
**Post date:** [September 9, 2023, 1:44pm UTC](https://forum.literatureandlatte.com/t/running-headers-from-titles-in-the-document/136164/4 "2023-09-09T13:44:20Z")

</div>

The only solution that could somewhat work, that I’ve found in my search, is the same proposed by Vincent.

However, this has a few problems:

- You have to enter the metadata for each document. They are not even inherited by nested documents, so all of them have to be compiled and then translated.

- When exporting the documents for translation as, say, DOCX files, the metadata are saved into separate documents, and have to be manually entered again.

It doesn’t look a viable solution, since it would take a huge amount of time, and be prone to errors.

Paolo

---

<div class="post-metadata">

**Author:** ![Vincent\_Vincent](https://forum.literatureandlatte.com/user_avatar/forum.literatureandlatte.com/vincent_vincent/32/19680_2.png) [@Vincent\_Vincent](https://forum.literatureandlatte.com/u/Vincent_Vincent)\
**Post date:** [September 9, 2023, 3:25pm UTC](https://forum.literatureandlatte.com/t/running-headers-from-titles-in-the-document/136164/5 "2023-09-09T15:25:42Z")

</div>

> [@ptram](#):
>
> They are not even inherited by nested documents

I believe they can be, using the proper combination of placeholders.

> [@ptram](#):
>
> When exporting the documents for translation as, say, DOCX files, the metadata are saved into separate documents

Yes. But why don’t you compile instead ?

If you don’t compile, forget it, there is no solution. (Or at least that I can think of.)

---

<div class="post-metadata">

**Author:** ![ptram](https://forum.literatureandlatte.com/letter_avatar_proxy/v4/letter/p/49beb7/32.png) [@ptram](https://forum.literatureandlatte.com/u/ptram)\
**Post date:** [September 9, 2023, 6:16pm UTC](https://forum.literatureandlatte.com/t/running-headers-from-titles-in-the-document/136164/6 "2023-09-09T18:16:59Z")

</div>

> [@Vincent\_Vincent](#):
>
> Yes. But why don’t you compile instead ?

Because translators need the source file, not the compiled one. Their output must be returned as source file, to be later compiled for the project in the corresponding language.

Paolo

---

<div class="post-metadata">

**Author:** ![rms](https://forum.literatureandlatte.com/letter_avatar_proxy/v4/letter/r/f6c823/32.png) [@rms](https://forum.literatureandlatte.com/u/rms)\
**Post date:** [September 9, 2023, 6:27pm UTC](https://forum.literatureandlatte.com/t/running-headers-from-titles-in-the-document/136164/7 "2023-09-09T18:27:14Z")

</div>

Are not DOCX files output from Compile identical as output from exporting DOCX from the Editor?

---

<div class="post-metadata">

**Author:** ![ptram](https://forum.literatureandlatte.com/letter_avatar_proxy/v4/letter/p/49beb7/32.png) [@ptram](https://forum.literatureandlatte.com/u/ptram)\
**Post date:** [September 9, 2023, 6:31pm UTC](https://forum.literatureandlatte.com/t/running-headers-from-titles-in-the-document/136164/8 "2023-09-09T18:31:46Z")

</div>

> [@rms](#):
>
> Are not DOCX files output from Compile identical as output from exporting DOCX from the Editor?

As far as I can understand, exported files don’t go through the scripting and replacement of the Compile command. But please correct me if I’m wrong.

Paolo

---

<div class="post-metadata">

**Author:** ![Vincent\_Vincent](https://forum.literatureandlatte.com/user_avatar/forum.literatureandlatte.com/vincent_vincent/32/19680_2.png) [@Vincent\_Vincent](https://forum.literatureandlatte.com/u/Vincent_Vincent)\
**Post date:** [September 9, 2023, 6:52pm UTC](https://forum.literatureandlatte.com/t/running-headers-from-titles-in-the-document/136164/9 "2023-09-09T18:52:44Z")

</div>

The compiler does only what you tell it to do.

You can tell it to (don’t tell it to do anything – use a compile format that does nothing or close to) leave things as is, but process your specific replacements.

Any other way, if you don’t compile, don’t bother yourself with placeholders…

---

<div class="post-metadata">

**Author:** ![ptram](https://forum.literatureandlatte.com/letter_avatar_proxy/v4/letter/p/49beb7/32.png) [@ptram](https://forum.literatureandlatte.com/u/ptram)\
**Post date:** [September 9, 2023, 7:12pm UTC](https://forum.literatureandlatte.com/t/running-headers-from-titles-in-the-document/136164/10 "2023-09-09T19:12:38Z")

</div>

> [@Vincent\_Vincent](#):
>
> Any other way, if you don’t compile, don’t bother yourself with placeholders…

In fact, I don’t want my translators to bother with placeholders: they must ignore them and leave them unchanged, and return them to me untouched.

When compiling the translated project, the placeholders will be resolved by the Compile command. For this, they must remain as in the original text I sent the translators.

Paolo

---

<div class="post-metadata">

**Author:** ![Vincent\_Vincent](https://forum.literatureandlatte.com/user_avatar/forum.literatureandlatte.com/vincent_vincent/32/19680_2.png) [@Vincent\_Vincent](https://forum.literatureandlatte.com/u/Vincent_Vincent)\
**Post date:** [September 9, 2023, 7:17pm UTC](https://forum.literatureandlatte.com/t/running-headers-from-titles-in-the-document/136164/11 "2023-09-09T19:17:25Z")

</div>

You could write them as \<$&somethingsomething\>, which should render them inoperant — and therefor compile as text —, and later use project replace to have \<$& become \<$

So this way you could compile, and have whatever placeholder you’d like to do their job at this stage work.  
All you’d have to do for those is to write them properly, without the extra &.

Those that you break on purpose (\<$&) will come back to you (from whoever you work with) just as ready to be tweaked and operate as they left. (Assuming whoever you work with doesn’t mess them up…)

---

<div class="post-metadata">

**Author:** ![ptram](https://forum.literatureandlatte.com/letter_avatar_proxy/v4/letter/p/49beb7/32.png) [@ptram](https://forum.literatureandlatte.com/u/ptram)\
**Post date:** [September 9, 2023, 8:19pm UTC](https://forum.literatureandlatte.com/t/running-headers-from-titles-in-the-document/136164/12 "2023-09-09T20:19:37Z")

</div>

> [@Vincent\_Vincent](#):
>
> You could write them as \<$&somethingsomething\>, which should render them inoperant

That’s an interesting trick. However, there is another problem that I didn’t consider in the previous post: Compile assembles a monolithic file, while Export preserve the original structure of separate files and folders.

I need this latter for the translators, since (a) a new project must preserve the same structure of the original when translated, and (b) updates will have to be done on individual files ro snippets, and not on the full, compiled project.

Export looks like the correct procedure in this case, to me. It’s the original code, minus the metadata. Maybe there is an export format that can preserve metadata?

Paolo

---

<div class="post-metadata">

**Author:** ![kewms](https://forum.literatureandlatte.com/user_avatar/forum.literatureandlatte.com/kewms/32/15720_2.png) [@kewms](https://forum.literatureandlatte.com/u/kewms)\
**Post date:** [September 9, 2023, 11:49pm UTC](https://forum.literatureandlatte.com/t/running-headers-from-titles-in-the-document/136164/13 "2023-09-09T23:49:48Z")

</div>

> [@ptram](#):
>
> Export looks like the correct procedure in this case, to me. It’s the original code, minus the metadata. Maybe there is an export format that can preserve metadata?

There’s an option to include metadata in the exported file. What happens to it after that will depend on the destination tool.

---

<div class="post-metadata">

**Author:** ![ptram](https://forum.literatureandlatte.com/letter_avatar_proxy/v4/letter/p/49beb7/32.png) [@ptram](https://forum.literatureandlatte.com/u/ptram)\
**Post date:** [September 10, 2023, 10:22am UTC](https://forum.literatureandlatte.com/t/running-headers-from-titles-in-the-document/136164/14 "2023-09-10T10:22:04Z")

</div>

> [@kewms](#):
>
> There’s an option to include metadata in the exported file.

The checkbox I find in the Export dialog seems to only create a separate sidecar .txt file (Filename Metadata.txt). This file seems to remain separate when going back into Scrivener.

Are there ways to force the Export command to include metadata right into the exported file?

Paolo

---

<div class="post-metadata">

**Author:** ![ptram](https://forum.literatureandlatte.com/letter_avatar_proxy/v4/letter/p/49beb7/32.png) [@ptram](https://forum.literatureandlatte.com/u/ptram)\
**Post date:** [September 10, 2023, 10:25am UTC](https://forum.literatureandlatte.com/t/running-headers-from-titles-in-the-document/136164/15 "2023-09-10T10:25:40Z")

</div>

> [@Vincent\_Vincent](#):
>
> > [@ptram](#):
> >
> > [custom metadata] are not even inherited by nested documents
> 
> I believe they can be, using the proper combination of placeholders.

As of now, what I’ve found is that you can add a “Metadata” document at the beginning of a group of documents. Or does this only work with folders?

I’ve not yet been able to test it. It doesn’t seem to work with exported documents. I don’t know how to check it with a compiled project.

Paolo

---

<div class="post-metadata">

**Author:** ![kewms](https://forum.literatureandlatte.com/user_avatar/forum.literatureandlatte.com/kewms/32/15720_2.png) [@kewms](https://forum.literatureandlatte.com/u/kewms)\
**Post date:** [September 10, 2023, 3:42pm UTC](https://forum.literatureandlatte.com/t/running-headers-from-titles-in-the-document/136164/16 "2023-09-10T15:42:08Z")

</div>

Well, you can certainly use an editor outside of Scrivener to incorporate the metadata file into the main output file.

But the fundamental issue is that the metadata _is_ just text to any application other than Scrivener. There’s no way to say “this is metadata, treat it differently” to other applications, and therefore no way to flag it in a way that Scrivener will recognize when re-imported.
