Skip to content

Instantly share code, notes, and snippets.

@SaeedForoutan
Last active February 24, 2024 19:34
Show Gist options
  • Save SaeedForoutan/d8e12226dd1b1466976b431379bd41a2 to your computer and use it in GitHub Desktop.
Save SaeedForoutan/d8e12226dd1b1466976b431379bd41a2 to your computer and use it in GitHub Desktop.

Daily Persian Memoir LaTeX Script and Aliases

Bash script for Ubuntu 22.04 to create a daily memoir in LaTeX stored on Dropbox. Generates a journal entry with date, centered image, and a Persian greeting.

Instructions:

  1. Copy script into ~/.bashrc.
  2. Run source ~/.bashrc.
  3. Use memoir alias to create a timestamped Notes folder and capture an image.

Customize as needed.

Notes:

  • Update and upgrade: sudo apt update && sudo apt upgrade
  • Install Dropbox by this Link.
  • Install TeX Live full: sudo apt install texlive-full -y (Highly recommended for xepersian and Xelatex engine, requires 5GB)

Feel free to adjust the picture resolution and width based on your preferences.

The output is this Link.

myaliases() {
echo "\documentclass[14pt,a4paper]{memoir}"
echo "\usepackage{enumerate}"
echo "\usepackage{xepersian}"
echo "\settextfont{XB Niloofar}"
echo "\begin{document}"
echo "\begin{center}"
echo " {\Large به نام خدا}"
echo ""
echo " \hfill \break"
echo ""
echo " {\large \textbf{\today}}"
echo ""
echo " \hfill \break"
echo ""
echo " \includegraphics[width=12cm]{sample.jpg}"
echo "\end{center}‎ "
echo "سلام"
echo ""
echo "\end{document}"
} > $(date +%Y%m%d_%H%M).tex
alias myalias=myaliases
alias memoir='cd ~/Dropbox/Notes/ && mkdir $(date +%Y%m%d_%H%M) && fswebcam -r 1280x720 --jpeg 85 -D 1 ~/Dropbox/Notes/$(date +%Y%m%d_%H%M)/sample.jpg && cd $(date +%Y%m%d_%H%M) && myalias && gopen $(date +%Y%m%d_%H%M).tex'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment