Skip to content
This repository was archived by the owner on Dec 2, 2024. It is now read-only.

praksharma/Dockerised-LyX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Dockerised LyX

Docker container: https://hub.docker.com/repository/docker/prakhars962/lyx

After each restart we have to add docker to the access control list with the following command:

xhost +local:docker

Run Docker container:

docker run -it --rm \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $(pwd):/root/project \
prakhars962/lyx:v2.3.6-1v1.0

UPDATE (16th Oct 23): I will stick to Lyx 2.3.6-1 as it is working fine.

UPDATE (02th Jun 24): Lyx 2.3.6.1 isn't compiling my PhD thesis due to some updates in tex-live. The docker container compiles my thesis just fine. So I will write my thesis using this docker image.

This repo contains a containerized version of LyX, the LaTeX WYSIWYG editor, built on Ubuntu 23.04. Ideal for running on systems with incompatible or older dependencies.

Why Containerize LyX?

On January 7, 2023, LyX 2.3.7 was released. This version isn't available on for Ubuntu 20.04 users via the lyx-devel PPA, which has been discontinued after nearly a decade. However, new versions of LyX are available in universe repo of Ubuntu.

Why not flatpak, snap or appimage?

I'm lazy. Simple as that. :|

Supported LyX Version

Currently, I am able to build LyX 2.3.7. However, there are some issues with the container.

  • LyX 2.3.6.1 on Ubuntu 22.04 just works fine. However, there are some problems with LyX 2.3.7 on Ubuntu 23.04. This is probably due to the choice of a non-LTS version.
  • pdflatex not working.
  • need to find more issues.

Extending the features

At some point I need to include these dependencies.

  • chktex: check for typographical errors
  • gnuhtml2latex: import HTML documents
  • groff: improved table formatting in plain text exports
  • librsvg2-bin, inkscape: use the SVG image format in LyX documents
  • linuxdoc-tools: export SGML LinuxDoc documents
  • mythes-*: use the OpenOffice.org/LibreOffice Thesaurus
  • noweb: import noweb files
  • rcs: integrated version control
  • sgmltools-lite: export SGML DocBook documents
  • texlive-xetex: use the XeTeX typesetting system
  • wv: import MS Word documents

Building the container

Currently, the docker build are not automated with github-actions. One can build the container with the following command:

docker build -t lyx-container .

This will add the docker container to docker images.

╰─ docker images                                                             ─╯
REPOSITORY            TAG           IMAGE ID       CREATED         SIZE
lyx-container         latest        c510e25efddf   2 minutes ago   1.45GB
prakhars962/deepinn   pre-release   886808706155   3 months ago    6.99GB
pytorch/pytorch       latest        26551f1051e7   4 months ago    6.48GB
modulus               22.09         3043d21ce86d   12 months ago   17.2GB

Now we need to add docker to the access control list with the following command:

xhost +local:docker
  • xhost : The command used to manage the access control list for the X server.
  • + : Add to the list (as opposed to - which would remove from the list).
  • local:docker : Allow local connections from Docker containers.

The docker container can be launched with the following command:

docker run -it --rm \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $(pwd):/root/project \
lyx-container
  • -e DISPLAY=$DISPLAY : Sets the DISPLAY environment variable inside the container.
  • -v /tmp/.X11-unix:/tmp/.X11-unix : Mounts the X11 UNIX socket into the container,
  • Also, bind the $(pwd) to /root/project

And you should be able to see this screen. Bit glitchy atm.

Alt text

For tinkering

One can easily tinker the container within an interactive session.

docker run -it --rm lyx-container /bin/bash
  • -it: The flags to run the container in interactive mode with a terminal.
  • --rm: Automatically remove the container when it exits.
  • /bin/bash: The command to open a bash shell.

Here is a simple example to check the version of LyX available on Ubuntu 23.04.

╰─ docker run -it --rm lyx-container /bin/bash                               ─╯

root@cac097c14f8e:/# apt-c
apt-cache   apt-cdrom   apt-config  
root@cac097c14f8e:/# apt-cache policy lyx
lyx:
  Installed: 2.3.7-1
  Candidate: 2.3.7-1
  Version table:
 *** 2.3.7-1 100
        100 /var/lib/dpkg/status
root@cac097c14f8e:/# 

Prune unused images

Each time we build a Docker image the Docker will create new unused image with NONE tag. We can force remove unused tag with.

docker image prune -f

License

This project is licensed under AGPL-3.0. See the LICENSE file for details.

Screenshots

Alt text Alt text

Packages

 
 
 

Contributors