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:
To obtain the ID
of the user you wish to publish public templates:
Log in using an Administrator account and go to
Admin
>Manage Users
.Search for the user using their email address and click through to their user admin page. There you will find the
ID
:Copy that
ID
and use it to set the environment variableOVERLEAF_TEMPLATES_USER_ID
.Run
bin/up -d
to recreate thesharelatex
container and apply the change.
Altering the configuration files of Server Pro typically necessitates the recreation of one or more containers. This procedure will cause user disconnections and lead to a period of downtime. As such, we advise implementing these modifications during prearranged maintenance periods.
Publishing templates
If you'd like to make templates available to all of your on-premise Server Pro users you'll need to:
Log in as the templates user.
As the templates user, create or upload a project containing the template's source code and make sure it compiles.
In the editor's left-hand menu, choose Manage Template.
Enter a custom description of the template
Click the Publish button
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
.
Did you know that you can transfer quality, pre-built LaTeX templates that are available on the Template Gallery at overleaf.com to your on-premise instance of Server Pro? For more information see the Transferring templates section below.
Unpublishing templates
If you'd like to unpublish a template you'll need to:
Log in as the templates user.
Open the previously existing project containing the template's source code.
In the editor's left-hand menu, choose Manage Template.
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
Your gallery
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
.
Did you know that if you tag a project multiple times it will appear in multiple groups.
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:
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.
Navigate to the Template Gallery on overleaf.com and locate the required template, for example IEEE Photonics Journal Paper Template - Example Submission
Click on the Open as Template button
Click on the project menu and choose Download Source
Next, log into the on-premise Server Pro account
Click the New Project button from the projects dashboard and choose Upload Project
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.
Last updated
Was this helpful?