Giter Site home page Giter Site logo

swiftlatex / swiftlatex Goto Github PK

View Code? Open in Web Editor NEW
2.0K 32.0 106.0 166.22 MB

SwiftLaTeX, a WYSIWYG Browser-based LaTeX Editor

Home Page: https://www.swiftlatex.com

License: GNU Affero General Public License v3.0

HTML 0.01% JavaScript 0.55% TypeScript 0.15% Shell 0.05% C 57.92% Makefile 0.11% C++ 40.49% TeX 0.08% Objective-C++ 0.08% Perl 0.08% xBase 0.40% CMake 0.09%
latex wysiwyg editor webassembly

swiftlatex's Introduction

SwiftLaTeX

Demo Website https://www.swiftlatex.com

Building Assets

Introduction for SwiftLaTeX

SwiftLaTeX, LaTeX Engines in Browsers with optional WYSIWYG support. We are a big fan of WebAssembly and all computation is done locally.

Main Features

  1. Speed. SwiftLaTeX engines run in browsers, all computation is done strictly locally.
  2. Library Support. Simply include a script tag and use PdfTeX or XeTeX in your own webpage.
  3. Compatibility. Produce exact same output you would get from TexLive or MikTeX.
  4. WYSIWYG. SwiftLaTeX provides an optional WYSIWYG editor, allowing users to editing PDF output directly (WIP).

Quick Installation Guide

  1. Download latest release from Github. Extract the files and put them into your webpage directory.
  2. Include the src tag in your page.
<script src="PdfTeXEngine.js"></script>
  1. Initialize the engine.
const engine = new PdfTeXEngine();
await engine.loadEngine();
  1. Load the tex files/pictures/fonts to engines.
engine.writeMemFSFile("main.tex", "\documentclass{...");
  1. Set the main file and fire the engine.
engine.setEngineMainFile("main.tex");
let r = await engine.compileLaTeX(); // r contains PDF binray and compilation log.

APIs

  1. async loadEngine(): Promise.
    Load the webassembly engine.
  2. isReady(): boolean.
    Check whether the engine is ready to compile documents.
  3. writeMemFSFile(filename: string, srccode: string | Uint8Array).
    Upload source codes / assets to the engine.
  4. makeMemFSFolder(folder: string).
    Create a directory.
  5. setEngineMainFile(filename: string).
    Tell the engine which latex file is the entry file.
  6. compileLaTeX():Promise.
    Start compiling LaTeX documents and return CompileResult.
  7. flushCache().
    Purge all the files uploaded.
  8. closeWorker().
    Shutdown the engine.
  9. setTexliveEndpoint(url: string).
    If you host your own texlive server, you can ask the engine to fetch files from the server.
  10. compileFormat().
    If you host your own texlive server, you may wanna generate the tex engine format file via this function.

Compile Engines by yourself

SwiftLaTeX compiles XeTeX and PdfTeX engines into WebAssembly. We recommend the XeTeX engine as it supports UTF-8 and Opentype fonts out of box. The engine is almost 100% identical to XeTeX except SwiftLaTeX does not include a full ICU dataset. As a result, the locale linebreaking may not function as expected. This issue is easy to fix: we just need to initialize the ICU library with the correct dataset. If you just need to handle English, the PdfTeX is also a nice option. It is less compilcated, thus faster and less buggy.

  1. Get the emsdk repo
git clone https://github.com/emscripten-core/emsdk.git
  1. Enter that directory
cd emsdk
  1. Fetch the latest version of the emsdk (not needed the first time you clone)
git pull
  1. Download and install the latest SDK tools.
./emsdk install latest
  1. Make the latest" SDK "active" for the current user. (writes .emscripten file)
./emsdk activate latest
  1. Activate PATH and other environment variables in the current terminal
source ./emsdk_env.sh
  1. Compile XeTeX or PdfTeX
cd pdftex.wasm or xetex.wasm
make

CTAN files

LaTeX is not a stand-alone typesetting program in itself, but document preparation software that runs on top of Donald E. Knuth's TeX typesetting system. TeX distributions usually bundle together all the parts needed for a working TeX system and they generally add to this both configuration and maintenance utilities. Nowadays LaTeX, and many of the packages built on it, form an important component of any major TeX distribution. In SwiftLaTeX, all required files are fetched from CTAN (Comprehensive TeX Archive Network), https://www.ctan.org, or our mirror server https://texlive.swiftlatex.com. You can checkout the repo https://github.com/SwiftLaTeX/Texlive-Ondemand and host your own server.

WYSIWYG Editor

We are also working hard to bring back our WYSIWYG latex editor. The editor is pretty similar to overleaf, except users are allowed to edit pdf output directly.

License

The code in this repository is released under the GNU AFFERO GENERAL PUBLIC LICENSE, version 3. A copy can be found in the LICENSE file. Copyright (c) SwiftLab, 2018-2022.

swiftlatex's People

Contributors

elliott-wen avatar neo-jgrec avatar topse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swiftlatex's Issues

No pages of output.

I opened the local version of SwiftLatex, and I searched for a resume template. After i chose one, something went wrong when i was about to edit it.
Please help me! Thanks anyway.
image

Fontconfig in XeTeX engine

Hi Guys or girls,

I am working on a more modern engine XeTeX. (under the engine directory).

One tricky question is about fontconfig, which may not work under WebAssembly environment.

Currently, I removed fontconfig such that the compilation can go ahead.

But it means users who wishes to use non-standard tex fonts has to upload their fonts. Do you think it is a sensible decision?

Pressing return while on the sign in page text field won't have the expected behavior

image

Steps to reproduce the problem:

  1. Go to https://www.swiftlatex.com/signin and write an email address in the text field.
  2. Press the return key.
  3. Notice how your URL bar will change to something like https://www.swiftlatex.com/[email protected] and then go back to the original https://www.swiftlatex.com/signin. (I'm not sure what appears exactly, because it happens too quickly. If anyone knows where in the dev console I can look it up, let me know!)
  4. The page seems to refresh and your input is lost.
  5. I also did not receive an email.

When pressing tab and then return(or space) to select the button, or just by clicking the button, I get the expected behavior:
A message appears telling me to look in my email inbox and I do actually receive the email.

image

Update project?

Hey,

i am looking for a good overleaf alternative. All in all SwiftLatex is a nice and lightweight self-hosted alternative!
However, one question comes to mind: Is it possible to implement passwordless login into the self-hosted alternative? It seems to me that https://www.swiftlatex.com/ has a much more up-to-date version than the one in the Git Repo.

Would be very cool! Thanks.

moving docker setup to alpine

Why use ubuntu which on installing does this?

Need to get 126 MB of archives.
After this operation, 440 MB of additional disk space will be used.

Instead use alpine which is small and just contains what's needed. I have tested this dockerfile

FROM python:3.8-alpine
RUN apk add --no-cache git gcc libc-dev linux-headers

RUN git clone https://github.com/SwiftLaTeX/SwiftLaTeX.git /app && \
    pip3 install -r /app/requirements.txt && echo "0.1"

WORKDIR /app
CMD ["python3", "wsgi.py"]

Change the repo url to https to make it work without ssh.

If OK I can send a PR.

ASL 2.0

I am wondering if you are willing to license this as ASL 2.0 or another more permissive license like MIT, BSD, etc.

Texlive

Noted that it uses external services like "texlive.swiftlatex.com" and "texlivep.swiftlatex.com". Is it possible for us host these services in a local server? Our information security team does not allow sending document content outside of our network.

Appreciate your comments.

other storage

Hello,

For security reason, we can't use Google Drive or another external storage provider.
It'll be good to be able to use:

Regards

source code to build cpdfetex.wasm

This could maybe be in a separate repository.
I'm also not sure if you want to include the whole Latex sources in there, or just the patch files, and build scripts.
Or is it actually already there? It's not clear to me. Some brief documentation, or just Readme with a link, would be helpful.

\includegraphics issues

Thank you very much for developing this fantastic tool!

I have noticed some issues with using \includegraphics:

  1. pdf files included using \includegraphics do not show up in the preview, but they do show up when exported.
  2. png files incuded using \includegraphics show up neither in the preview, nor when exported.

I am using https://v2.swiftlatex.com. I have attached a minimal example where these issues arise.

The project files:
swiftlatex_project.zip

The result of exporting:
graph_png_export.pdf
graph_pdf_export.pdf

Python build failed

PS X:\Repos\Other\SwiftLaTeX> python3 wsgi.py
<gevent._socket3.socket object, fd=1420, family=2, type=1, proto=0>: Invalid HTTP method: '\x16\x03\x01\x02\x00\x01\x00\x01รผ\x03\x03\x0f\x824\x12}@\x16ร•รครœ1\x8dรญMรฐh\x08\x91\x8cรฆNรฑรณ\x97รฐร‘Zh\x17\x85ยฒ\x1c \x0bcร…aรฎ\x04รฃร‚yร‰รฆlz\x95=8\x95\x9bยถ\x06Qร‚\x0eP\x10=Hยฅ\x00\x0bร•ร\x00"ยบยบ\x13\x01\x13\x02\x13\x03ร€+ร€/ร€,ร€0รŒยฉรŒยจร€\x13ร€\x14\x00\x9c\x00\x9d\x00/\x005\x00\n'
127.0.0.1 - - [2019-12-31 15:50:42] "๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝรผ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ4๏ฟฝ}@๏ฟฝร•รครœ1๏ฟฝรญMรฐ๏ฟฝ๏ฟฝรฆNรฑรณ๏ฟฝรฐร‘Zh๏ฟฝ๏ฟฝยฒ๏ฟฝ ๏ฟฝcร…aรฎ๏ฟฝรฃร‚yร‰รฆlz๏ฟฝ=8๏ฟฝ๏ฟฝQร‚๏ฟฝP๏ฟฝ=Hยฅ๏ฟฝร•ร"ยบยบ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝร€+ร€/ร€,ร€0รŒยฉรŒยจร€๏ฟฝร€๏ฟฝ๏ฟฝ๏ฟฝ/5" 400 - 0.002017
<gevent._socket3.socket object, fd=1432, family=2, type=1, proto=0>: Invalid HTTP method: '\x16\x03\x01\x02\x00\x01\x00\x01รผ\x03\x03ร‚รž\\ยฟยฏ\x000;\x03++Y\xa0|\x99ยน\x81รชWjรผIUId\x9e\x9c\x10$ยซHo )ร‹iรท\x9e eรšf{\x0bยฐรพp\x04z>\x86\x8eรนwยซw\x86\x7fร•รˆร“รŸ\x8bรน\x11\x00"zz\x13\x01\x13\x02\x13\x03ร€+ร€/ร€,ร€0รŒยฉรŒยจร€\x13ร€\x14\x00\x9c\x00\x9d\x00/\x005\x00\n'
127.0.0.1 - - [2019-12-31 15:50:42] "๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝรผ๏ฟฝ๏ฟฝร‚รž\ยฟยฏ0;๏ฟฝ++Yย |๏ฟฝยน๏ฟฝรชWjรผIUId๏ฟฝ๏ฟฝ๏ฟฝ$ยซHo )ร‹iรท๏ฟฝ eรšf{๏ฟฝยฐรพp๏ฟฝz>๏ฟฝ๏ฟฝรนwยซw๏ฟฝ๏ฟฝร•รˆร“รŸ๏ฟฝรน๏ฟฝ"zz๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝร€+ร€/ร€,ร€0รŒยฉรŒยจร€๏ฟฝร€๏ฟฝ๏ฟฝ๏ฟฝ/5" 400 - 0.004962
<gevent._socket3.socket object, fd=1428, family=2, type=1, proto=0>: Invalid HTTP method: '\x16\x03\x01\x02\x00\x01\x00\x01รผ\x03\x03\x9b\\\n'
127.0.0.1 - - [2019-12-31 15:50:42] "๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝรผ๏ฟฝ๏ฟฝ" 400 - 0.001009

adding new line adds space after first character in new line

The text was

A document to get you started. Delete any text you do not want.

And I put the cursor after the started. , right before the D, removed the space, and pressed enter, such that I had this:

A document to get you started.
Delete any text you do not want.

However, in the visualization, it looks like there is a space after D, i.e. it reads like D elete any text ....
Screen Shot 2019-12-05 at 09 02 46
Screen Shot 2019-12-05 at 09 02 51

Share-volume with docker and its host

First thing first, great work, looking forward to the official DockerHub image.

My question is:
Is it possible to setup a share volume between docker image and the host?

I had some legacy tex directory for some documents, is it possible to use the SwiftLaTex docker image directly on those share volume directories with docker "-v" argument and then everything shows on web browser UI?

It might be easier for us to handle the previous created docment with git version control without recreate the project in the UI again?

Many thanks.

LDAP support for local integration

I am really loving swiftlatex and wanted it to be a part of the working group at my university. But it would be awesome to be able to login via an ldap service where an account is automatically made for local projects. Is somehting like this planned or will I have to wait for this feature for too long?

Best regards!

Selecting a range with the cursor should(n't)...

First off since it seems this will be the first issue ever let me set the tone by saying, wow! This is a really neat project with an innovative approach. I'm primarily reviewing it with an eye to what UIs could be built for the SILE Typesetter, but I can see this being really useful especially as a component to bake into other systems.

Now back to issue reporting:

Because there is a somewhat unconventional disconnect between what you are clicking on and looking and and where the keyboard input is actually getting sent, it is a little confusing to guess what will happen when clicking in the PDF. Single clicks pretty much make sense, you get a cursor.

On the other hand drag selections don't do anything sensible at all. Selecting a range of text looks like an operation is happening, but nothing does. I would either:

  • disable mouse drags entirely on the canvas to make it clear it does nothing or
  • actually use the start and end locations from the canvas to select the same range in the TeX source pane and have the keyboard focus there so Backspace, CtrlC, et al work as expected.

Release a version integrating all CTAN files

Can you release a version that integrates all CTAN files?
Downloading all required files from CTAN server or mirror server for me costs some time.
I hope that I can do my work without any internet access.

Thank you!

ReferenceError: cwrap is not defined swiftlatexpdftex.js

Although the three wasm modules compiled without errors, I had to add some run time functions as compiler arguments. Otherwise, when compiling a TeX document, swiftlatexpdftex.js (and the other two modules accordingly) would complain about not defined functions:

ReferenceError: cwrap is not defined swiftlatexpdftex.js:1:1687
    compileLaTeXRoutine http://localhost/swiftlatexpdftex.js:1
    onmessage http://localhost/swiftlatexpdftex.js:1

The solution was to add -s EXPORTED_RUNTIME_METHODS='["cwrap", "allocate"]' to the makefiles.

Has anyone else experienced this issue?

CORS access to mirror?

I'm trying to deploy a very simple editor on a personal site (basically cloning https://www.swiftlatex.com/pdftex_basic.html to start) and I get issues whenever attempting to access the mirror sever:

Access to XMLHttpRequest at 'https://texlive2.swiftlatex.com/pdftex/10/swiftlatexpdftex.fmt' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

  1. Is that expected?
  2. If so - what's the correct configuration to point switflatex to a different mirror? It looks like these might be hardcoded?
    self.texlive_endpoint = "https://texlive2.swiftlatex.com/";

Unexpected error detected when sharing this project.

I tried to share my project on a self-hosted instance. Clicking the share button gives me an unexpected error. The console gives me a 404 not found.

editor.bundle.js:57 GET http://192.168.1.20:3011/s/create?p=someRandomKey&uri=http%3A%2F%2F192.168.1.20%3A3011%2Fupload%2Fmanifest%2FsomeRandomKey 404 (Not Found)

Add some command autofill

Hi,
I am very happy with your very nice and easy Editor. The WYSIWYG is very nice and useful:)
I now wrote some pages and I miss the autofill for the latex-commands like in VSCODE or similar. Also some automatic brackets (.,{,[,... would be an awesome feature.

Regards

Bug: setTexliveEndpoint

Hi,
I found the following code:

    PdfTeXEngine.prototype.setTexliveEndpoint = function (url) {
        if (this.latexWorker !== undefined) {
            this.latexWorker.postMessage({ 'cmd': 'settexliveurl', 'url': url });
            this.latexWorker = undefined;
        }
    };

I dont understand, why there is "this.latexWorker = undefined". When I try to use the compileLaTeX afterwards, I get errors.

After removing that command, it works. You find that in XeTeXEngine and PdfTeXEngine at least.

A Bug?

Best Regards,
Tobias

feature request: add GitHub integration

My Latex documents are often in some (maybe private) GitHub repos (or maybe GitLab). It would be very nice if there is some (simple) integration that I can edit these directly, and commit & push changes.
(Not sure exactly how to handle conflicts... Maybe push to an alternative new branch and ignore this problem for now.)

math rendered incorrectly

\[ x^2 + 2x + 1 \] results in this:
Screen Shot 2019-12-05 at 09 09 34
i.e. baseline kerning of the fonts in math mode seem a bit off; it has the x in 2x a bit raised.
(Reported here.)

Docker images can not connect to mongo

I wanted to try out the new version, especially since minio is integrated and maybe ldap will be next.
I am working in a docker environment and fired up a modified version of the provided docker-compose.yml file:

version: '3'
services:
  database:
    image: 'mongo'
    container_name: 'mongodb'
    network_mode: 'bridge'
    expose:
      - '27017-27019'
  minio:
    image: 'swiftlatex/storage:v2'
    container_name: 'storage'
    network_mode: 'bridge'
    expose:
      - '9000'
  portal:
    #image: 'swiftlatex/portal:v2'
    #image: 'swiftlatex/portalv2:latest'
    build:
      context: .
    container_name: 'portal'
    network_mode: 'bridge'
    environment:
      - MONGO_URL=mongodb://mongodb:27017/swiftlatex
      - S3_ENDPOINT=http://storage:9000
      - S3_KEY=limiteduser
      - S3_SECRET=limiteduser
    expose:
      - '3000'
    links:
      - 'database:mongodb'
      - 'minio:storage'

Since an nginx-proxy is handling the requests, I needed all containers in the bridge.
The first issue was selecting the right image for the portal instance, since there are two different versions on docker hub: portal:v2 and portalv2:latest.

Running portal:v2 gives the following error:

Traceback (most recent call last):
  File "./wsgi.py", line 2, in <module>
    import app
  File "/usr/src/app/app.py", line 43, in <module>
    sess = Session(app)
  File "/usr/local/lib/python3.8/site-packages/flask_session/__init__.py", line 54, in __init__
    self.init_app(app)
  File "/usr/local/lib/python3.8/site-packages/flask_session/__init__.py", line 61, in init_app
    app.session_interface = self._get_interface(app)
  File "/usr/local/lib/python3.8/site-packages/flask_session/__init__.py", line 90, in _get_interface
    session_interface = FileSystemSessionInterface(
  File "/usr/local/lib/python3.8/site-packages/flask_session/sessions.py", line 313, in __init__
    from werkzeug.contrib.cache import FileSystemCache
ModuleNotFoundError: No module named 'werkzeug.contrib

Running portalv2:latest gives the following problem by handling the GET request:

[2020-03-03 14:35:59,705] ERROR in app: Request finalizing failed with an error while handling an error
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2445, in wsgi_app
    ctx.push()
  File "/usr/local/lib/python3.8/site-packages/flask/ctx.py", line 390, in push
    self.session = session_interface.open_session(self.app, self.request)
  File "/usr/local/lib/python3.8/site-packages/flask_session/sessions.py", line 410, in open_session
    document = self.store.find_one({'id': store_id})
  File "/usr/local/lib/python3.8/site-packages/pymongo/collection.py", line 1273, in find_one
    for result in cursor.limit(-1):
  File "/usr/local/lib/python3.8/site-packages/pymongo/cursor.py", line 1156, in next
    if len(self.__data) or self._refresh():
  File "/usr/local/lib/python3.8/site-packages/pymongo/cursor.py", line 1050, in _refresh
    self.__session = self.__collection.database.client._ensure_session()
  File "/usr/local/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1810, in _ensure_session
    return self.__start_session(True, causal_consistency=False)
  File "/usr/local/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1763, in __start_session
    server_session = self._get_server_session()
  File "/usr/local/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1796, in _get_server_session
    return self._topology.get_server_session()
  File "/usr/local/lib/python3.8/site-packages/pymongo/topology.py", line 482, in get_server_session
    self._select_servers_loop(
  File "/usr/local/lib/python3.8/site-packages/pymongo/topology.py", line 208, in _select_servers_loop
    raise ServerSelectionTimeoutError(
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1969, in finalize_request
    response = self.process_response(response)
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2268, in process_response
    self.session_interface.save_session(self, ctx.session, response)
  File "/usr/local/lib/python3.8/site-packages/flask_session/sessions.py", line 427, in save_session
    store_id = self.key_prefix + session.sid
AttributeError: 'NoneType' object has no attribute 'sid'

Where it seems like the environment variable MONGO_URL is not used correctly.

The only option how I got it to run is to build my own image like this using a Dockerfile:

FROM python:3

WORKDIR /usr/src/app
RUN cd /usr/src/app

RUN apt update && \
   apt install git

RUN git clone https://github.com/SwiftLaTeX/SwiftLaTeX.git /usr/src/app
RUN pip install --no-cache-dir -r requirements.txt

CMD [ "python", "./wsgi.py" ]

It is quick and dirty and I can finally reach my container.
The problem is, I don't understand how I can now use the MinIO integration. Is it only available for the sandbox?
And we are still not able to create users, but only can connect to the provided services?
Also, trying to connect to the services only gives a bad request message on all services...

Unable to create a new sandbox/local project

Forward: The project looks outstanding, great work so far!!

I'm trying to deploy from scratch. I'm using a fresh LXD container running Ubuntu 18.04.

As root,

  1. apt update && apt -y upgrade
  2. apt -y install python3 python3-pip mongodb git
  3. python3 -m pip install --upgrade pip
  4. git clone https://github.com/SwiftLaTeX/SwiftLaTeX
  5. cd SwiftLaTeX
  6. python3 -m pip install -r requirements.txt
  7. python3 ./wsgi.py

Great! Now I open a browser and go to http://<container ip address>:3000 and start a new sandbox instance. I click "Create New Project", give it a name, and then the whole page loads refreshes to 500 Internal Server Error.

The log from wsgi.py looks like this,

root@swiftlatex:~/SwiftLaTeX# python3 ./wsgi.py 
10.67.102.1 - - [2020-04-19 02:04:14] "GET / HTTP/1.1" 200 2713 0.117160
10.67.102.1 - - [2020-04-19 02:04:14] "GET /static/css/index.css HTTP/1.1" 200 466 0.005513
10.67.102.1 - - [2020-04-19 02:04:15] "GET /favicon.ico HTTP/1.1" 404 501 0.005106
10.67.102.1 - - [2020-04-19 02:04:50] "GET /sandbox HTTP/1.1" 302 533 0.120948
10.67.102.1 - - [2020-04-19 02:04:50] "GET /project HTTP/1.1" 200 5265 0.024764
10.67.102.1 - - [2020-04-19 02:04:51] "GET /static/css/project.css HTTP/1.1" 200 3193 0.004487
10.67.102.1 - - [2020-04-19 02:04:51] "GET /static/js/project.js HTTP/1.1" 200 1725 0.009460
10.67.102.1 - - [2020-04-19 02:05:30] "POST /project/create HTTP/1.1" 500 571 8.429417

I don't see any other errors or logs. What am I missing? Thanks in advance!

How to setup from scratch?

I have set up this locally. However, this repo doesn't mention how to set up back-end tex compile such as texlive. Do I have to pull a texlive docker image?

Dockerhub

Can I suggest creating https://hub.docker.com/r/swiftlatex before anyone else, as I cannot find a user with that name? Then publishing the latest swiftlatex/swiftlatex:latest so people can fetch it like that.

Right now everybody has to either:

  1. Pull the whole repo and build it themselves (and the build has its own git clone in it)
  2. Copy the DockerFile and docker-compose manually, and build it like that.

Wrong port exposed?

I wanted to test the new version with docker.
First I tried using the docker hub version, which did not work and a quick look in the nginx config revealed that the port is not correct that I used. I opened the provided dockerfile in the repo, to find out, you expose the port 8080, but the application is running on 3000. Than I used the provided Dockerfile to build my own image, but now the application uses port 3011. After exposing 3011, in the dockerfile, everything worked finde!
Have I done something wrong or should this be switched somehow?

Google Drive session signs out when browser is closed

Desired outcome: Be able to sign in with Google and for the session to not sign out when the browser is closed.

Reality: I can successfully sign into Google Drive through https://www.swiftlatex.com/oauth/login_oauth?type=google and grant the appropriate permissions, but when I quit the browser and reopen https://www.swiftlatex.com/ide/index.html I get an error message: You must log in first, and I am forced to sign in again and grant permissions again.

Modern CV Template Not Working

Steps:

  1. Create new project with modern cv template
  2. Nothing is rendered and error is reported at the title display line

Connection refused: Cannot run with either docker container or python3 directly

Hello, I can run with neither docker container nor python3 directly in the system. Does anyone successfully run the SwiftLaTeX?

Error:
portal | 172.19.19.1 - - [2020-03-31 10:57:53] "GET /favicon.ico HTTP/1.1" 500 456 60.152768
portal | [2020-03-31 10:58:23,360] ERROR in app: Exception on /favicon.ico [GET]
portal | Traceback (most recent call last):
portal | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2446, in wsgi_app
portal | response = self.full_dispatch_request()
portal | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
portal | return self.finalize_request(rv)
portal | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1969, in finalize_request
portal | response = self.process_response(response)
portal | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2268, in process_response
portal | self.session_interface.save_session(self, ctx.session, response)
portal | File "/usr/local/lib/python3.8/site-packages/flask_session/sessions.py", line 439, in save_session
portal | self.store.update({'id': store_id},
portal | File "/usr/local/lib/python3.8/site-packages/pymongo/collection.py", line 3213, in update
portal | return self._update_retryable(
portal | File "/usr/local/lib/python3.8/site-packages/pymongo/collection.py", line 854, in _update_retryable
portal | return self.__database.client._retryable_write(
portal | File "/usr/local/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1490, in _retryable_write
portal | with self._tmp_session(session) as s:
portal | File "/usr/local/lib/python3.8/contextlib.py", line 113, in enter
portal | return next(self.gen)
portal | File "/usr/local/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1823, in _tmp_session
portal | s = self._ensure_session(session)
portal | File "/usr/local/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1810, in _ensure_session
portal | return self.__start_session(True, causal_consistency=False)
portal | File "/usr/local/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1763, in __start_session
portal | server_session = self._get_server_session()
portal | File "/usr/local/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1796, in _get_server_session
portal | return self._topology.get_server_session()
portal | File "/usr/local/lib/python3.8/site-packages/pymongo/topology.py", line 482, in get_server_session
portal | self._select_servers_loop(
portal | File "/usr/local/lib/python3.8/site-packages/pymongo/topology.py", line 208, in _select_servers_loop
portal | raise ServerSelectionTimeoutError(
portal | pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused

Millions of thx in advance

Supporting change tracking and file versioning

We are currently working hard on change tracking and file versioning.

We have a few potential technical approaches. One of them is to use YJS and store each document update in the backend storage. But we are still working out the actual storage schemas. If you have any better idea, please feel free to share.

Projects cannot be loaded

Hi,
I have the issue, that no projects will be correctly created. The page don't stops loading while creating. If I move backwards to the project-overview and click the project, there is only some loading circle showing up.

I created my own dockerfile because the original one wasn't working with the presented docker-compose workaround. My Dockerfile is equal to that one
Issue30.

On my minio storage only a manifest date is created.

Here are the logs:

172.17.0.1 - - [2020-05-15 08:15:26] "GET /u/op4svsorChIn34kq/ HTTP/1.1" 304 288 0.035482
172.17.0.1 - - [2020-05-15 08:15:29] "GET /project HTTP/1.1" 200 6027 0.046851
172.17.0.1 - - [2020-05-15 08:15:29] "GET /static/css/project.css HTTP/1.1" 304 289 0.018784
172.17.0.1 - - [2020-05-15 08:15:29] "GET /static/js/project.js HTTP/1.1" 304 289 0.019799
172.17.0.1 - - [2020-05-15 08:15:30] "GET /project HTTP/1.1" 200 6027 0.050605
172.17.0.1 - - [2020-05-15 08:15:30] "GET /static/js/project.js HTTP/1.1" 304 289 0.018897
172.17.0.1 - - [2020-05-15 08:15:30] "GET /static/css/project.css HTTP/1.1" 304 289 0.017721
172.17.0.1 - - [2020-05-15 08:15:34] "GET /u/43BvNR2r8Sxdt34V/ HTTP/1.1" 200 667 0.037878
172.17.0.1 - - [2020-05-15 08:15:34] "GET /u/43BvNR2r8Sxdt34V/bundle.js HTTP/1.1" 200 6183232 0.361072
172.17.0.1 - - [2020-05-15 08:15:35] "GET /u/43BvNR2r8Sxdt34V/22.bundle.js HTTP/1.1" 200 26587 0.042429
172.17.0.1 - - [2020-05-15 08:15:35] "GET /u/43BvNR2r8Sxdt34V/37.bundle.js HTTP/1.1" 200 7736 0.033381
172.17.0.1 - - [2020-05-15 08:15:35] "GET /u/43BvNR2r8Sxdt34V/e817279537a0417d042f62fbb1b99eea.gif HTTP/1.1" 200 44498 0.037781
172.17.0.1 - - [2020-05-15 08:15:35] "GET /u/43BvNR2r8Sxdt34V/34.bundle.js HTTP/1.1" 200 22186 0.031101
172.17.0.1 - - [2020-05-15 08:15:35] "GET /u/43BvNR2r8Sxdt34V/42.bundle.js HTTP/1.1" 200 3914 0.037056
172.17.0.1 - - [2020-05-15 08:15:35] "GET /u/43BvNR2r8Sxdt34V/39.bundle.js HTTP/1.1" 200 12383 0.032565
172.17.0.1 - - [2020-05-15 08:15:35] "GET /u/43BvNR2r8Sxdt34V/12.bundle.js HTTP/1.1" 200 34256 0.034597
172.17.0.1 - - [2020-05-15 08:15:35] "GET /u/43BvNR2r8Sxdt34V/0.bundle.js HTTP/1.1" 200 16930 0.027610
172.17.0.1 - - [2020-05-15 08:15:35] "GET /u/43BvNR2r8Sxdt34V/1.bundle.js HTTP/1.1" 200 19235 0.037785
172.17.0.1 - - [2020-05-15 08:15:36] "GET /u/43BvNR2r8Sxdt34V/7.bundle.js HTTP/1.1" 200 56027 0.041588
172.17.0.1 - - [2020-05-15 08:15:36] "GET /u/43BvNR2r8Sxdt34V/2.bundle.js HTTP/1.1" 200 1307036 0.217206
172.17.0.1 - - [2020-05-15 08:15:36] "GET /u/43BvNR2r8Sxdt34V/3.bundle.js HTTP/1.1" 200 46440 0.035293
172.17.0.1 - - [2020-05-15 08:15:36] "GET /u/43BvNR2r8Sxdt34V/4.bundle.js HTTP/1.1" 200 20206 0.030034
172.17.0.1 - - [2020-05-15 08:15:36] "GET /u/43BvNR2r8Sxdt34V/5.bundle.js HTTP/1.1" 200 86774 0.036285
172.17.0.1 - - [2020-05-15 08:15:36] "GET /u/43BvNR2r8Sxdt34V/33.bundle.js HTTP/1.1" 200 35649 0.034099
172.17.0.1 - - [2020-05-15 08:15:36] "GET /u/43BvNR2r8Sxdt34V/9.bundle.js HTTP/1.1" 200 22282 0.036638
172.17.0.1 - - [2020-05-15 08:15:36] "GET /u/43BvNR2r8Sxdt34V/43.bundle.js HTTP/1.1" 200 3207 0.031523
172.17.0.1 - - [2020-05-15 08:15:36] "GET /u/43BvNR2r8Sxdt34V/6.bundle.js HTTP/1.1" 200 113096 0.052128
172.17.0.1 - - [2020-05-15 08:15:36] "GET /u/43BvNR2r8Sxdt34V/44.bundle.js HTTP/1.1" 200 2827 0.026237
172.17.0.1 - - [2020-05-15 08:15:36] "GET /u/43BvNR2r8Sxdt34V/36.bundle.js HTTP/1.1" 200 27123 0.031674
172.17.0.1 - - [2020-05-15 08:15:36] "GET /u/43BvNR2r8Sxdt34V/8.bundle.js HTTP/1.1" 200 31826 0.030872
172.17.0.1 - - [2020-05-15 08:15:36] "GET /u/43BvNR2r8Sxdt34V/11.bundle.js HTTP/1.1" 200 273323 0.053292
172.17.0.1 - - [2020-05-15 08:15:36] "GET /u/43BvNR2r8Sxdt34V/10.bundle.js HTTP/1.1" 200 728062 0.129827
172.17.0.1 - - [2020-05-15 08:15:36] "GET /u/43BvNR2r8Sxdt34V/14.bundle.js HTTP/1.1" 200 124580 0.042705
172.17.0.1 - - [2020-05-15 08:15:36] "GET /u/43BvNR2r8Sxdt34V/13.bundle.js HTTP/1.1" 200 666046 0.064171
172.17.0.1 - - [2020-05-15 08:15:36] "GET /u/43BvNR2r8Sxdt34V/40.bundle.js HTTP/1.1" 200 3221 0.037594
172.17.0.1 - - [2020-05-15 08:15:37] "GET /u/43BvNR2r8Sxdt34V/15.bundle.js HTTP/1.1" 200 252039 0.047349
172.17.0.1 - - [2020-05-15 08:15:37] "GET /u/43BvNR2r8Sxdt34V/32.bundle.js HTTP/1.1" 200 30501 0.035625
172.17.0.1 - - [2020-05-15 08:15:37] "GET /u/43BvNR2r8Sxdt34V/18.bundle.js HTTP/1.1" 200 123328 0.037632
172.17.0.1 - - [2020-05-15 08:15:37] "GET /u/43BvNR2r8Sxdt34V/20.bundle.js HTTP/1.1" 200 35204 0.028809
172.17.0.1 - - [2020-05-15 08:15:37] "GET /u/43BvNR2r8Sxdt34V/16.bundle.js HTTP/1.1" 200 19179 0.036381
172.17.0.1 - - [2020-05-15 08:15:37] "GET /u/43BvNR2r8Sxdt34V/28.bundle.js HTTP/1.1" 200 118954 0.040095
172.17.0.1 - - [2020-05-15 08:15:37] "GET /u/43BvNR2r8Sxdt34V/23.bundle.js HTTP/1.1" 200 342305 0.045416
172.17.0.1 - - [2020-05-15 08:15:37] "GET /u/43BvNR2r8Sxdt34V/30.bundle.js HTTP/1.1" 200 79754 0.034224

Regards

Cannot build WASM core

After going through the instructions, after make I get:

wasm-ld: error: xpdf/xpdf.a(TextString.o): undefined symbol: pdfDocEncoding
em++: error: '/home/alexc/Software/emsdk/upstream/bin/wasm-ld -o swiftlatex.wasm tex/xetex0.o tex/xetexini.o tex/xetex-pool.o md5.o xmemory.o texfile.o kpseemu.o texmfmp.o main.o bibtex.o xetexdir/XeTeX_ext.o xetexdir/XeTeX_pic.o xetexdir/image/bmpimage.o xetexdir/image/jpegimage.o xetexdir/image/pngimage.o xetexdir/trans.o xetexdir/XeTeXOTMath.o xetexdir/XeTeXLayoutInterface.o xetexdir/XeTeXFontMgr.o xetexdir/XeTeXFontInst.o xetexdir/XeTeXFontMgr_FC.o xetexdir/hz.o xetexdir/XeTeXHTML.o xetexdir/XeTeXColor.o xetexdir/pdfimage.o teckit/teckit-Engine.o xpdf/xpdf.a -L/home/alexc/Software/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten /home/alexc/Software/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/libharfbuzz.a /home/alexc/Software/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/libfreetype.a /home/alexc/Software/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/libpng.a /home/alexc/Software/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/libz.a -lGL -lal -lhtml5 -lstubs -lc -lcompiler_rt -lc++-noexcept -lc++abi-noexcept -ldlmalloc -lc_rt -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --import-undefined --strip-debug --export-if-defined=compileBibtex --export-if-defined=compileLaTeX --export-if-defined=compileFormat --export-if-defined=main --export-if-defined=setMainEntry --export-if-defined=stackSave --export-if-defined=stackRestore --export-if-defined=stackAlloc --export-if-defined=__wasm_call_ctors --export-if-defined=__errno_location --export-if-defined=_get_tzname --export-if-defined=_get_daylight --export-if-defined=_get_timezone --export-if-defined=malloc --export-if-defined=free --export-if-defined=saveSetjmp --export-if-defined=setThrew --export-if-defined=memalign --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-table -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=2147483648 --global-base=1024' failed (returned 1)
make: *** [Makefile:33: swiftlatex.js] Error 1

[Enhancement] Change editor font size

Hi,

First of all, thank you for this wonderful project.

It would be pretty useful to be able to change the editor font size. For me personally, the font is too big so I have to zoom out of the page which makes the rest of the page totally small. Being able to change the font size via Ctr+ and Ctr- or via the editor menu would be a great improvement for me.

Can this library be used in node.js?

I encountered some issues when I tried to import SwiftLaTex in a node.js script

$ cat index.js
const {PdfTeXEngine} = require('./vendor/SwiftLaTex/PdfTeXEngine.js')

const doc = `
    \\documentclass{article}
    \\begin{document}
    hi REPLACEME
    \\end{document}
  `

;(async () => {
  const engine = new PdfTeXEngine()
  await engine.loadEngine()
  engine.writeMemFSFile("main.tex", doc)
  engine.setEngineMainFile("main.tex")
  let r = await engine.compileLaTeX()
})()

$ node index.js
/home/ducaale/swiftlatex-experiment/index.js:11
  const engine = new PdfTeXEngine()
                 ^

TypeError: PdfTeXEngine is not a constructor

After some tweaks, I managed to import it successfully but that led to other issues:

  • Worker is not defined which I fixed by importing it from worker_threads
  • The Worker constructor expecting an absolute or relative URL to swiftlatexpdftex.js
  • self is not defined error (I am not sure how to address this one)

I was hoping to use this library in the next rewrite of resumake.io which will use next.js and can render the LaTeX in both the server and the client.

biblatex support

It seems biblatex (and in particular biber) is not available / not supported. Could it be added? Probably depends on unicode support?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.