Templates

With Server Pro, you have the ability to create and publish your own templates, within your self-hosted environment, as well as re-distribute downloaded templates from the Template Gallery on overleaf.com.

Setting up the templates user

In Server Pro, a single user is responsible for publishing the curated list of templates that are visible on your local template gallery /templates.

To do this, you'll need to set the environment variable OVERLEAF_TEMPLATES_USER_ID in toolkit/config/variables.env to the ID of the user who will be responsible for template management within your instance, for example:

OVERLEAF_TEMPLATES_USER_ID=56a8865231faeb5f07d69959

To obtain the ID of the user you wish to publish public templates:

  1. Log in using an Administrator account and go to Admin > Manage Users.

  2. Search for the user using their email address and click through to their user admin page. There you will find the ID:

  3. Copy that ID and use it to set the environment variable OVERLEAF_TEMPLATES_USER_ID.

  4. Run bin/up -d to recreate the sharelatex container and apply the change.

Publishing templates

If you'd like to make templates available to all of your on-premise Server Pro users you'll need to:

  1. Log in as the templates user.

  2. As the templates user, create or upload a project containing the template's source code and make sure it compiles.

  3. In the editor's left-hand menu, choose Manage Template.

  4. Enter a custom description of the template

  5. Click the Publish button

  6. Go to the project dashboard and tag the template with the name of the cateogry you'd like it to appear in. For example Presentations.

Unpublishing templates

If you'd like to unpublish a template you'll need to:

  1. Log in as the templates user.

  2. Open the previously existing project containing the template's source code.

  3. In the editor's left-hand menu, choose Manage Template.

  4. Once the confirmation popup is displayed, click Unpublish.

Once this has been done, the template should have been removed from the templates list.

Linking to your templates

On the templates gallery page, /templates, templates are grouped together using the tag which the user assigns to the projects, e.g. Journals, Reports etc. To see all templates add /all to the URL /templates/all, which can also be used as the default URL if you do not wish to use tags for groupings.

Like-wise, you can view/link to templates within a specific category by appending the tag name to the templates URL, for example: /templates/journals.

New project menu

When a user creates a new project, they can be shown customized links to template categories. These links are set via the OVERLEAF_NEW_PROJECT_TEMPLATE_LINKS environment variable in toolkit/config/variables.env, for example:

OVERLEAF_NEW_PROJECT_TEMPLATE_LINKS='[
   {"name":"All Templates","url":"/templates/all"},
   {"name":"All Categories","url":"/templates"},
   {"name":"Reports","url":"/templates/reports"},  
   {"name":"External","url":"https://somewhere.com/templates/reports"}
]'

Transferring templates from overleaf.com

As Server Pro has been architected to work offline, there isn't an automated way to integrate overleaf.com gallery templates into your on-premise installation, it is however possible to do this manually on a per template basis.

By default, Server Pro is configured to use a basic scheme version of TeXLive for compiles. This basic version is lightweight and only contains a very limited subset of LaTeX packages which, will most likely result in missing package errors for your users when attempting to use templates from overleaf.com on your local on-premise instance.

Unfortunately, whilst there isn't an automatic way to install missing packages, we do have a configurable setting within Server Pro that will allow your users to compile projects with access to more packages, and in a more secure way. This feature is called Sandbox Compiles (also known as Sibling Containers).

To ensure that downloaded templates are compatible with your on-premise Server Pro instance, we highly recommend that you enable Sandbox Compiles as this feature will provide your users with access to the same TeX Live environment as that on overleaf.com. These images contain the most popular packages and fonts and have already been tested against our gallery templates.

You can find additional information about configuring what TeX Live versions users are able to choose from within their project along with setting the default TeX Live image version for new projects in the Changing the TeX Live Image section of our documentation.

  1. Navigate to the Template Gallery on overleaf.com and locate the required template, for example IEEE Photonics Journal Paper Template - Example Submission

  2. Click on the Open as Template button

  3. Click on the project menu and choose Download Source

  4. Next, log into the on-premise Server Pro account

  5. Click the New Project button from the projects dashboard and choose Upload Project

  6. Click the Select a .zip file button and choose the downloaded template zip file

The user can then use this newly uploaded template within their own account, or, as the templates user, you can publish it for other users to use.

An overleaf.com account is required.

Last updated

Was this helpful?