How to Install TeXworks on Ubuntu 22.04 | 20.04

TeXworks is a free, open-source, cross-platform LaTeX editor designed to streamline the creation of professional documents using the LaTeX typesetting system. Inspired by the simplicity of TeXShop, a popular editor for Mac users, TeXworks aims to provide an intuitive and user-friendly interface for beginners while offering advanced features for experienced users. Some of its key features include:

  • Cross-platform support: TeXworks is available for Windows, macOS, and Linux, ensuring a consistent user experience across different operating systems.
  • Integrated PDF viewer: The built-in PDF viewer lets you preview your document in real-time as you make changes, eliminating the need to switch between multiple applications.
  • Syntax highlighting: TeXworks provides syntax highlighting for LaTeX, making reading and navigating your code easier.
  • Auto-completion: TeXworks offers auto-completion suggestions for LaTeX commands as you type to speed up the writing process.
  • Unicode support: The editor fully supports Unicode, allowing you to include special characters and symbols in your document without issues.
  • Customizable interface: TeXworks lets you personalize the interface by adjusting font sizes, color schemes, and window layouts to match your preferences.
  • Spell-checking: Integrated spell-checking helps ensure your documents are free of spelling errors.
  • Regular expression search: Advanced search functionality with regular expression support allows for precise text search and replacement operations.
  • Scripting support: Users can extend TeXworks’ functionality by writing custom scripts using JavaScript, Python, and Lua.
  • Keyboard shortcuts: Streamline your workflow with customizable keyboard shortcuts for common tasks and commands.

Although TeXworks is available for Linux users, it relies on the Qt toolkit, which may not be compatible with all Linux distributions. However, this is not the case for Ubuntu users. This guide will demonstrate installing TeXworks on Ubuntu 22.04 Jammy Jellyfish and Ubuntu 20.04 Focal Fossa using the APT package manager with APT or Flatpak, ensuring a smooth experience for users on these popular distributions.

Method 1: Install TeXworks with TeXworks PPA

Step 1: Update and Upgrade System Packages

The first method involves installing TeXworks using the official LaunchPAD PPA maintained by the “TeXworks” team. This method is often preferred as it provides the most recent stable versions without relying on container software installations such as Flatpak or Snapcraft.

sudo apt update && sudo apt upgrade

Step 2: Add TeXworks Launchpad PPA to System

There are two versions: the latest stable version and the latest-build version, which can be considered a nightly build release. Most users will find the latest stable version sufficient, as it is frequently updated. However, the choice is yours.

Import the stable PPA of TeXworks:

sudo add-apt-repository ppa:texworks/stable -y

Import the latest-builds (development) PPA of TeXworks:

sudo add-apt-repository ppa:texworks/ppa -y

Step 3: Install TeXworks

Before running the installation command, execute an apt update to reflect the newly imported PPA.

sudo apt update

Install TeXworks using the following command:

sudo apt install texworks

Method 2: Install TeXworks with Flatpak and Flathub

An alternative approach to installing TeXworks is leveraging Flatpak, a versatile package management system with a sandboxed application environment. To install TeXworks via Flatpak, you must include the Flathub repository, which contains the TeXworks package.

Note: If Flatpak is not yet installed on your system, refer to How to Install Flatpak on Ubuntu with the Flatpak Team Official LaunchPAD PPA, which provides instructions for using the Flatpak Team Official LaunchPAD PPA to obtain the most recent supported version.

Start by opening the terminal and entering the following command to integrate the Flathub repository:

sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

With the repository now in place, proceed to install TeXworks by executing the command below:

flatpak install flathub org.tug.texworks

How to Launch TeXworks

Once you have installed TeXworks using either the APT or Flatpak method, you can launch it from the command terminal or by locating the application icon in your system. Here’s how to do it:

APT Method: If you have installed TeXworks using the APT method, open the terminal and type the following command

texworks

Flatpak Method: If you have installed TeXworks using the Flatpak method, open the terminal and type the following command:

flatpak run org.tug.texworks

Launching TeXworks by finding the application icon

  1. Step 1: Access your system’s application menu. This can typically be done by clicking the menu icon in your screen’s lower-left or upper-left corner. Depending on your Linux distribution and desktop environment, the icon might look like a grid of dots, the Ubuntu logo, or a different symbol.
  2. Step 2: Search for TeXworks in the application menu. You can browse through the list of installed applications or use the search functionality provided by your desktop environment. Type “TeXworks” in the search bar and the application icon should appear.
  3. Step 3: Launch TeXworks by clicking on the application icon. This will start the program, and you can begin creating and managing your LaTeX documents.

Example of TeXworks in the Ubuntu application menu:

When first launching TeXworks on Ubuntu, consider checking out the following features and tips to make the most of your experience:

  • Explore the interface: Familiarize yourself with the TeXworks interface, which is designed to be user-friendly and accessible for both new and experienced users. Locate the toolbar, menu options, and editing area.
  • Check the settings: Go to “Edit” > “Preferences” in the menu bar to access various settings and customize your TeXworks experience. You can adjust the appearance, syntax highlighting, and other features to suit your preferences.
  • Get acquainted with the typesetting options: TeXworks provides several typesetting options, such as pdfLaTeX, XeLaTeX, and LuaLaTeX. You can find these options in the toolbar at the top or by going to “Tools” > “Commands” in the menu bar.
  • Configure spell-checking: TeXworks comes with a built-in spell-checker. To set your desired language, go to “Edit” > “Spelling” in the menu bar and select the appropriate language.
  • Learn keyboard shortcuts: Boost your productivity by learning keyboard shortcuts for frequently used commands. You can find a list of shortcuts in the “Help” menu under “Shortcuts”.
  • Discover integrated PDF viewer: TeXworks features an integrated PDF viewer that automatically opens your compiled LaTeX documents. This simplifies reviewing your work and makes it easy to switch between editing and previewing your document.
  • Access built-in templates: TeXworks includes several templates to help you get started quickly. Go to “File” > “New from Template” in the menu bar to browse and choose from available templates.
  • Utilize code folding: To keep your workspace organized, TeXworks offers code folding, which allows you to collapse and expand sections of your document. This feature is particularly helpful when working on large and complex projects.
  • Refer to the built-in documentation: If you need help or more information about specific LaTeX commands, TeXworks includes built-in documentation. Go to “Help” > “LaTeX Reference” in the menu bar to access it.

By exploring these features and tips when launching TeXworks on Ubuntu, you’ll be better prepared to create, edit, and manage your LaTeX documents effectively and efficiently.

Example of TeXworks on Ubuntu desktop:

Additional Tips

How to Update TeXworks

The software should update automatically with your system packages for desktop users using the APT package manager. For users who would like to check manually, use the following command in your terminal:

sudo apt update && sudo apt upgrade

Alternatively, Flatpak users can use the following command to update TeXworks:

flatpak update org.tug.texworks

How to Remove (Uninstall) TeXworks

TeXworks, when installed, adds quite a few dependencies. Ideally, using the autoremove command is best to keep your system clean and not bloated.

sudo apt remove texworks

Next, remove the imported PPA if you have no desire to re-install the software:

sudo add-apt-repository --remove ppa:texworks/stable -y
sudo add-apt-repository --remove ppa:texworks/ppa -y

Alternatively, Flatpak installations will require running the following command to remove TeXworks:

flatpak uninstall org.tug.texworks

Conclusion

In conclusion, installing TeXworks on Ubuntu is a simple and efficient process, providing users with a powerful tool for working with LaTeX documents. Users can choose the best approach with two primary installation methods, APT package manager and Flatpak. TeXworks offers an intuitive interface and robust functionality for professionals and students, making it an excellent choice for LaTeX projects. Following this article’s comprehensive installation guide and tips, users can quickly set up TeXworks on their Ubuntu systems.

Additional Resources

To further enhance your experience with TeXworks and LaTeX, consider exploring the following resources:

  • LaTeX Project: The official LaTeX project website offers extensive documentation, tutorials, and news about LaTeX.
  • TeX Stack Exchange: A community-driven question-and-answer platform dedicated to TeX, LaTeX, and related typesetting systems.
  • CTAN: The Comprehensive TeX Archive Network (CTAN) is an extensive repository of LaTeX packages, fonts, and tools.
  • LaTeX Wikibook: A community-authored guide to LaTeX, covering many topics and suitable for beginners and advanced users alike.
  • Flatpak: The official website for Flatpak, a package manager providing sandboxed application environments.
  • Flathub: The official repository for Flatpak applications, including TeXworks.
  • TeXworks Launchpad PPA: The official TeXworks Personal Package Archive (PPA) for Ubuntu users, maintained by the TeXworks team.

Share to...