Skip to content

Configuring Headers, Footers & Logo

Miguel Serrano edited this page Apr 1, 2024 · 11 revisions

IMPORTANT: starting with Overleaf CE/Server Pro 5.0.1 environment variables have been rebranded from SHARELATEX_* to OVERLEAF_*.

If you're using a 4.x version (or earlier) please make sure the variables are prefix accordingly (e.g. SHARELATEX_NAV_TITLE instead of OVERLEAF_NAV_TITLE)

Header

Site title

The nav title can be set with OVERLEAF_NAV_TITLE, this is used in the top left corner of navigation if a logo is not set.

# toolkit/variables.env
OVERLEAF_NAV_TITLE=My Overleaf Instance

# `docker` command
--env OVERLEAF_NAV_TITLE='My Overleaf Instance'

# `docker-compose.yml`
environment:
  OVERLEAF_NAV_TITLE:'My Overleaf Instance'

Header Navigation links

Extra navigation items can be added to the navigation header by setting the OVERLEAF_HEADER_EXTRAS option to a JSON array of objects. For example:

[
  {
    "text": "Some link",
    "url": "http://example.com/somelink",
    "class": "subdued",
    "only_when_logged_out": true
  },
  {
    "text": "Help",
    "class": "subdued"
    "dropdown": [
      {
        "text": "Documentation",
        "url": "/learn"
      },
      {
        "text": "Contact Admin",
        "url": "http://example.com/contact"
      }
    ]
  }
]

# toolkit/variables.env
OVERLEAF_HEADER_NAV_LINKS=[{"text":"Somelink","url":"http://example.com/somelink","class":"subdued","only_when_logged_out":true},{"text":"Help","class":"subdued""dropdown":[{"text":"Documentation","url":"/learn"},{"text":"ContactAdmin","url":"http://example.com/contact"}]}]

Logo

You can set a custom logo rather than using text with the variable OVERLEAF_HEADER_IMAGE_URL this points to an externally hosted image

# toolkit/variables.env
OVERLEAF_HEADER_IMAGE_URL=https://mysite.somewhere.com/img/logo.png

Footers

It is possible to customise both the left and smaller right footer which is found on pages like /project using the environmental variables OVERLEAF_LEFT_FOOTER and the smaller OVERLEAF_RIGHT_FOOTER

Both expect an array of JSON which will be inserted.

[
	{
		"text": "Powered by <a href=\"https://www.overleaf.com\">Overleaf</a> © 2024"
	},{
		"text": "Another page I want to link to can be found <a href=\"here\">here</a>"
	}
]

This data needs to be valid JSON to work, with quotes escaped when passed through as an environmental variable

# toolkit/variables.env
OVERLEAF_LEFT_FOOTER='[{"text": "Powered by <a href=\"https://www.overleaf.com\">Overleaf</a> © 2024"},{"text": "Another page I want to link to can be found <a href=\"here\">here</a>"} ]'
Clone this wiki locally