How to Upload .tex Files to Sharelatex

Host Your Own LaTeX Server

A screenshot of local ShareLaTeX server with total texlive package installed. Tex file available in GithubGist.

If yous employ LaTeX a lot, you lot probably already know Overleaf and ShareLaTeX, which provide easy to use, online, collaborative LaTeX editor for free. In 2017, they joined forces to build the best collaborative writing tool. Now, you would ask why would I want to setup my own LaTeX server, if there is free service already? Well, I commend you for your critical thinking, and here are the reasons I tin call back of.

  • Be cool.
  • Privacy business concern. You lot need physical isolation of your documents.
  • Development. Y'all want to brand open-source contribution.

In this postal service, I will evidence the process to set up ShareLaTeX on your ain machine. The open up-source sharelatex repo is the centerpiece to enable united states of america deploying our locally hosted online LaTeX editing server. The said repository just wraps various shareLaTeX services into a docker etch file, and does non incorporate any source code by itself. There is a quick start guide in the repo, but assumes skillful background knowledge on related techniques (docker etc.). This post will present my own experience to set this up, since

If you did not document it, information technology did non happen.

Steps ane: Install docker

Presume using Debian-based Linux, sudo apt install docker will install docker and kickoff docker daemon. In order for after steps (docker-etch) to work, we need to make certain the docker daemon is really running. We can check this by sudo systemctl condition docker , and we should see something like

          ● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2019-03-17 13:l:38 PDT; 3h 59min ago
...

Step 2: Pull the sharelatex repo

With git clone git@github.com:sharelatex/sharelatex.

The docker-etch.yml file defines everything we need for our local ShareLaTeX server to run. Within this file, there is a services section and three service are available, i.eastward. sharelatex, redis, mongo. The sharelatex is the main service running in Node.js server, which are also how various sharelatex components are implemented in. The redis service is an in-retentivity cache/bulletin broker. Fincally, the mongodb is used every bit persistent story for tex documents. Interested readers could refer the official docker compose guide for more data.

Step three: Start ShareLeTeX server

With sudo docker-compose up .

The get-go time execution volition endeavour to pull three images through sudo docker pull <epitome name> , where paradigm names are sharelatex/sharelatex, library/redis, library/mongo. Afterwards the images are pulled, docker will start each of them. Keep an eye in the docker start log for any errors.

If everything works out fine, you should be able to connect to your local sharelatex server at http://0.0.0.0. Every bit the showtime time run, visit the /launchpad folio to set upwardly your admin user. Now you tin can write LaTeX in your browser. However complicated tex example shown at the beginning of this mail service won't work, since the default sharelatex prototype simply accept a minimum installation of TexLive. Next, we will update the installed Tex Alive with total installation.

Step 4: Fully install TeX Live

Run sudo docker exec sharelatex tlmgr install scheme-full , while your sharelatex container is running. Note in the command higher up, docker only executes command within live containers and thus we need the container proper name. To check a list of running containers, use sudo docker container list.

If you are lucky, your sharelatex container will first installing new tex packages. However, since the sharelatex comes with 2017 Tex Live, you are more likely to run into the "Tex version mismatch" complain. The main solution is to re-install the Tex Alive 2018, which is too complicated for me. The alternative is to stick with Tex Live 2017. To do and so, utilize sudo docker exec sharelatex tlmgr option repository ftp://tug.org/historic/systems/texlive/2017/tlnet-final to set upstream with 2017 Tex packages. Then outset a scheme-full install.

The to a higher place procedure runs for hours, since at that place are tens of thousands of tex packages to install. You can, of course, merely install the package yous demand through sudo docker exec sharelatex tlmgr install <package name> . Whenever you installed a package merely the sharelatex compiler could non pick up the packet, i.due east. complaining parcel missing, try use sudo docker exec sharelatex texhash to build new parcel alphabetize.

When the Tex full installation finished, you can commit your alter on the running container to new prototype through sudo docker commit sharelatex sharelatex/sharelatex:full-texlive-install . Here is the final images I have to give yous a sense how large is the full installation on Tex Live.

          $ sudo docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.Size}}'
REPOSITORY TAG SIZE
sharelatex/sharelatex full-texlive-install viii.49GB
redis latest 95MB
mongo latest 394MB
sharelatex/sharelatex latest 3.46GB

Now, your local ShareLaTeX server should be running with total Tex packages. And the exam tex file in the start of this post should compile to a beautiful pdf. Before we conclude, let'southward try to understand the two dependency information services that ShareLaTeX relies on.

Explore Data Services

When ShareLaTeX server is up and running, we also have redis and mongo service running. We should be able to see what are stored within each of them. First, nosotros should figure out the IP address that these two data services listening to. We tin can detect the IP by sudo docker inspect <container name> . Look for IPAddress under NetworkSettings.

In my case, the mongo container is serving through 172.18.0.4. You may need to download mongoDB client first with sudo apt install mongodb-clients . And then, we can directly connect to information technology.

          $ mongo 172.xviii.0.4
MongoDB shell version: 2.6.10
connecting to: 172.18.0.4/test
.......
> show databases;
admin 0.000GB
config 0.000GB
local 0.000GB
sharelatex 0.000GB
> use sharelatex
switched to db sharelatex
> show tables
docs
rooms
users
projects
projectHistoryMetaData
docOps
docHistory
_migrations

The docs table store every line of our testing tex file, while the projects table rail every project.

Like for redis service (running on 172.eighteen.0.2 in my example). I have one session open in my browser, and various run-time messages are tracked in redis.

          $ redis-cli -h 172.18.0.2
172.eighteen.0.2:6379> info keyspace
# Keyspace
db0:keys=13,expires=7,avg_ttl=89009937367
172.xviii.0.two:6379> keys *
1) "connected_user:5c8340567c9260008a351b14:n6LPQnWZdMsDCm6Ha8fW"
ii) "doclines:5c8340567c9260008a351b15"
three) "clients_in_project:5c8340567c9260008a351b14"
4) "RateLimit:open-project:{5c8340567c9260008a351b14:5c833fd67c9260008a351b12}"
five) "DocsIn:5c8340567c9260008a351b14"
6) "UserSessions:{5c833fd67c9260008a351b12}"
7) "ProjectId:5c8340567c9260008a351b15"
8) "RateLimit:compile-project-http:{5c8340567c9260008a351b14:5c833fd67c9260008a351b12}"
nine) "ProjectState:5c8340567c9260008a351b14"
10) "DocHash:5c8340567c9260008a351b15"
11) "sess:qP7owMjcXH3du0sM8aKGnqdqbZhY2eCs"
12) "Pathname:5c8340567c9260008a351b15"
xiii) "DocVersion:5c8340567c9260008a351b15"
172.18.0.2:6379>

Thanks for staying until the end. Happy hacking.

portisthoulds1984.blogspot.com

Source: https://medium.com/@shuangzizuobh2/host-your-own-latex-server-a-docker-example-2787531bf93b

0 Response to "How to Upload .tex Files to Sharelatex"

Publicar un comentario

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel