LaTexBot is a Python project developed by Indrajit Ghosh to simplify the process of writing and compiling LaTeX documents. The project provides a collection of classes that enable users to produce various LaTeX document templates with ease.
Author: Indrajit Ghosh
Project URL: LaTexBot
- Write and compile LaTeX documents effortlessly.
- Ready-to-use classes such as
TexFile
,PlainArticle
,Article
,AmsArticle
, and more. - Customize templates for different types of documents.
- Easily integrate LaTeX code into your Python project.
This project requires the following dependencies to be installed on your system:
-
Python 3.x: This project is built using Python 3.x. If you don't have Python 3.x installed, you can download it from the official Python website: Python Downloads
-
LaTeX Distribution: A LaTeX distribution is necessary to compile and generate documents from LaTeX source code. You can choose from the following popular LaTeX distributions:
-
TeX Live: TeX Live is a cross-platform, comprehensive distribution that provides a wide range of packages and tools for LaTeX typesetting. It's available for various operating systems including Windows, macOS, and Linux. You can download TeX Live from their official website: TeX Live
-
MiKTeX: MiKTeX is a LaTeX distribution for Windows, known for its ease of installation and package management capabilities. It provides a user-friendly interface for package installation and updates. You can download MiKTeX from their official website: MiKTeX
-
MacTeX: MacTeX is a distribution specifically designed for macOS, providing everything you need to work with LaTeX on a Mac. It includes various tools and editors that integrate well with the macOS environment. You can download MacTeX from their official website: MacTeX
-
Before using this project, ensure that you have installed Python 3.x and one of the LaTeX distributions mentioned above. For detailed instructions on installing LaTeX, you can refer to the LaTeX Installation Guide created by Indrajit Ghosh.
Open a new terminal window and cd
to where you want to install LaTexBot
. Then follow the steps below:
- Clone the project from GitHub using the following command:
git clone https://github.com/indrajit912/LaTexBot.git
- Change into the project directory:
cd LaTexBot
- (Optional but Recommended) Create virtualenv (if you don't have
virtualenv
in your python distribution, install it usingpip
).
virtualenv env
- (Optional, if you followed 3.) Activate the
virtualenv
source env/bin/activate
- Install the required dependencies:
pip install -r requirements.txt
- Check whether everything is installed correctly by running the following script staying in the root directory
LaTexBot/
:
python3 examples/example_plain_article.py
If you see a pdf
then everything is working as fine!
-
Import the desired class (e.g.
PlainArticle
) from thelatex_bot
package into your Python script. -
Create an
PlainArticle
class object. -
Use the provided methods to write and compile the document.
from latex_bot import PlainArticle
# Create a PlainArticle document
document = PlainArticle(
title="My LaTeX Document",
project_dir="home/Desktop/new_plain_art" # Change with a proper path.
)
# Add sections, content, and other elements
document.add_section("Introduction")
document.add_text("This is the introduction section.")
# Create the document
document.show_output()
document.create()
- You can use
LaTexBot
to create a specific LaTeX templates, such asplainart
,article
,amsart
,thesis
,beamer
etc. The bot will set up aLaTeX
project directory with a predefined customTeX
settings for you everytime! See the example below:
- Open terminal window and
cd
toLaTexBot
. - Activate the
virtualenv
(in case you are using one!)
source env/bin/activate
- Run the bot by the following cmd
python3 main.py
- The bot will ask for the template to create. After that it will create the corresponding
LaTeX
project directory in the current working directory. You can copy that project somewhere else if you wish!
For detailed documentation and examples, please refer to the LaTexBot Wiki (Will be updated soon!).
Contributions to LaTexBot are welcome! If you find a bug, have a feature request, or want to contribute improvements, please submit a pull request or open an issue on GitHub.
- Author: Indrajit Ghosh
- Email: indrajitghosh912@gmail.com
- GitHub: indrajit912
This project is licensed under the MIT License. Feel free to use, modify, and distribute the code as per the terms of the license.