diff --git a/.gitignore b/.gitignore index 72f8980..77a77ed 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,7 @@ config/.cache config/.zshrc.pre-oh-my-zsh .DS_Store dump.rdb +*.aux +*.log +*.synctex.gz +*.blg diff --git a/Readme.md b/Readme.md index d88d763..fa82b03 100644 --- a/Readme.md +++ b/Readme.md @@ -1,5 +1,20 @@ # Readme +Write here about container + +# How to install +1. Clone this repository: +`git clone xxxx` +2. Build the container using: +`docker build -t gmarxcc/scientific-emacs:0.1 docker/emacs/` +3. Run the container to test: +`docker run --rm -it gmarxcc/scientific-emacs:0.1` +4. Run an Ubuntu command like `ls` + +Done, you are doing great! + +# Executing emacs + To get the ip address ''' open -a xquartz diff --git a/config/.emacs b/config/.emacs index 42f20b0..24da3d1 100644 --- a/config/.emacs +++ b/config/.emacs @@ -93,45 +93,43 @@ :bind ("C-=" . er/expand-region) ("C--" . er/contract-region)) + ;; latex -(use-package tex - :defer t - :ensure auctex - :init - (progn - (setq-default TeX-master nil) ; Query for master file. - (setq TeX-auto-save t) ; Enable parse on save. - (setq TeX-save-query nil) - ;;(setq TeX-command-force "LaTex") - (setq latex-run-command "pdflatex") - (setq TeX-parse-self t) ; Enable parse on load. - (setenv "PATH" (concat (getenv "PATH") ":/Library/TeX/texbin/")) - (setq exec-path (append exec-path '("/Library/TeX/texbin/"))) - ;; pdf-tools configuration - (setq TeX-PDF-mode t) - (add-hook 'TeX-after-compilation-finished-functions - #'TeX-revert-document-buffer) - (setq TeX-view-program-selection '((output-pdf "PDF Tools")) - TeX-source-correlate-start-server t) - (setq pdf-info-epdfinfo-program "/usr/local/bin/epdfinfo") - (add-to-list 'auto-mode-alist '("\\.pdf\\'" . pdf-view-mode)) - (add-hook 'pdf-view-mode-hook - (lambda () (pdf-tools-enable-minor-modes))) - (setq LaTeX-includegraphics-read-file 'LaTeX-includegraphics-read-file-relative) - ) - :config - (add-hook 'LaTeX-mode-hook - (lambda () - ;;(rainbow-delimiters-mode) - ;;(company-mode) - ;;(smartparens-mode) - (turn-on-reftex) - (setq reftex-plug-into-AUCTeX t) - (reftex-isearch-minor-mode) - (setq TeX-PDF-mode t) - (setq TeX-source-correlate-method 'synctex) - (setq TeX-source-correlate-start-server t))) - ) +;; (use-package tex +;; :defer t +;; :ensure auctex +;; :init +;; (progn +;; (setq-default TeX-master nil) ; Query for master file. +;; (setq TeX-auto-save t) ; Enable parse on save. +;; (setq TeX-save-query nil) +;; (setq LaTeX-includegraphics-read-file 'LaTeX-includegraphics-read-file-relative) +;; (custom-set-variables '(LaTeX-command "latex -synctex=1")) +;; ;;(setq TeX-command-force "LaTex") +;; ;;(setq latex-run-command "pdflatex") +;; (setq TeX-parse-self t) ; Enable parse on load. +;; (setenv "PATH" (concat (getenv "PATH") ":/Library/TeX/texbin/")) +;; (setq exec-path (append exec-path '("/Library/TeX/texbin/"))) +;; ;; pdf-tools configuration +;; (setq TeX-PDF-mode t) +;; (add-hook 'TeX-after-compilation-finished-functions +;; #'TeX-revert-document-buffer) +;; (setq TeX-view-program-selection '((output-pdf "PDF Tools")) +;; TeX-source-correlate-start-server t) +;; (setq pdf-info-epdfinfo-program "/usr/bin/epdfinfo") +;; (add-to-list 'auto-mode-alist '("\\.pdf\\'" . pdf-view-mode)) +;; (add-hook 'pdf-view-mode-hook +;; (lambda () (pdf-tools-enable-minor-modes))) +;; ) + ;; :config + ;; (add-hook 'LaTeX-mode-hook + ;; (lambda () + ;; (company-mode) + ;; (turn-on-reftex) + ;; (setq reftex-plug-into-AUCTeX t) + ;; (reftex-isearch-minor-mode)) + ;; ) + ;; pdf-tools (use-package pdf-tools :ensure t @@ -139,25 +137,9 @@ :magic ("%PDF" . pdf-view-mode) :config (custom-set-variables - '(pdf-tools-handle-upgrades nil)) - ) - - - -;; -+-+-+-+-+-+-+ -;; startup config -(setq inhibit-startup-message t) ;;inhibit startup -(show-paren-mode 1) ;; parenthesis match -(tool-bar-mode -1) ;; no tool-bar -(menu-bar-mode -1) ;; menu-bar disable -(global-hl-line-mode +1) ;; highlith current line -(delete-selection-mode +1) ;; deletes selected text and replace it -(scroll-bar-mode -1) -;; Set default font: -(add-to-list 'default-frame-alist - '(font . "DejaVu Sans Mono-16")) -(fset 'yes-or-no-p 'y-or-n-p) ;; Ask y/n instead of yes/no -(add-hook 'prog-mode-hook 'display-line-numbers-mode) ;; display line number when programming + '(pdf-tools-handle-upgrades nil)) + ) +;; ---------- ;; rextex (use-package reftex :ensure t @@ -178,6 +160,24 @@ +;; -+-+-+-+-+-+-+ +;; startup config +(setq inhibit-startup-message t) ;;inhibit startup +(show-paren-mode 1) ;; parenthesis match +(tool-bar-mode -1) ;; no tool-bar +(menu-bar-mode -1) ;; menu-bar disable +(global-hl-line-mode +1) ;; highlith current line +(delete-selection-mode +1) ;; deletes selected text and replace it +(scroll-bar-mode -1) +;; Set default font: +(add-to-list 'default-frame-alist + '(font . "DejaVu Sans Mono-16")) +(fset 'yes-or-no-p 'y-or-n-p) ;; Ask y/n instead of yes/no +(add-hook 'prog-mode-hook 'display-line-numbers-mode) ;; display line number when programming +;; -+-+-+-+-+-+-+- + + + (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/docker/emacs/Dockerfile b/docker/emacs/Dockerfile index 9fad517..be0f51d 100644 --- a/docker/emacs/Dockerfile +++ b/docker/emacs/Dockerfile @@ -12,7 +12,7 @@ RUN apt-get update \ # installing texlive base with pdflatex utility: RUN apt-get -y install \ texlive-latex-base \ -texlive-latex-recommended \ +texlive-latex-extra \ texlive-pictures \ texlive-science \ texlive-bibtex-extra @@ -25,6 +25,8 @@ curl \ aspell \ vim \ python3 \ +elpa-pdf-tools \ +auctex \ zsh # oh-my-zshell diff --git a/examples/latex-test/main.aux b/examples/latex-test/main.aux deleted file mode 100644 index f23e546..0000000 --- a/examples/latex-test/main.aux +++ /dev/null @@ -1 +0,0 @@ -\relax diff --git a/examples/latex-test/main.log b/examples/latex-test/main.log deleted file mode 100644 index 11cc865..0000000 --- a/examples/latex-test/main.log +++ /dev/null @@ -1,69 +0,0 @@ -This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex 2020.8.31) 31 AUG 2020 05:56 -entering extended mode - restricted \write18 enabled. - %&-line parsing enabled. -**\nonstopmode\input main.tex -(./main.tex (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls -Document Class: article 2019/12/20 v1.4l Standard LaTeX document class -(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo -File: size10.clo 2019/12/20 v1.4l Standard LaTeX file (size option) -) -\c@part=\count167 -\c@section=\count168 -\c@subsection=\count169 -\c@subsubsection=\count170 -\c@paragraph=\count171 -\c@subparagraph=\count172 -\c@figure=\count173 -\c@table=\count174 -\abovecaptionskip=\skip47 -\belowcaptionskip=\skip48 -\bibindent=\dimen134 -) -(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def -File: l3backend-pdfmode.def 2020-02-03 L3 backend support: PDF mode -\l__kernel_color_stack_int=\count175 -\l__pdf_internal_box=\box45 -) -(./main.aux) -\openout1 = `main.aux'. - -LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 2. -LaTeX Font Info: ... okay on input line 2. -LaTeX Font Info: External font `cmex10' loaded for size -(Font) <7> on input line 3. -LaTeX Font Info: External font `cmex10' loaded for size -(Font) <5> on input line 3. - [1 - -{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./main.aux) ) -Here is how much of TeX's memory you used: - 365 strings out of 483107 - 6183 string characters out of 5964630 - 231847 words of memory out of 5000000 - 15473 multiletter control sequences out of 15000+600000 - 532338 words of font info for 24 fonts, out of 8000000 for 9000 - 59 hyphenation exceptions out of 8191 - 25i,4n,19p,158b,97s stack positions out of 5000i,500n,10000p,200000b,80000s - -Output written on main.pdf (1 page, 19184 bytes). -PDF statistics: - 16 PDF objects out of 1000 (max. 8388607) - 10 compressed objects within 1 object stream - 0 named destinations out of 1000 (max. 500000) - 1 words of extra memory for PDF output out of 10000 (max. 10000000) - diff --git a/examples/latex-test/main.pdf b/examples/latex-test/main.pdf deleted file mode 100644 index 0163143..0000000 Binary files a/examples/latex-test/main.pdf and /dev/null differ diff --git a/examples/latex-test/main.tex b/examples/latex-test/main.tex index f89b06a..b99106e 100644 --- a/examples/latex-test/main.tex +++ b/examples/latex-test/main.tex @@ -1,4 +1,21 @@ \documentclass{article} +\usepackage{graphicx} +\usepackage{lipsum} \begin{document} Hello \LaTeX{}. + +\section{Introduction} +\label{sec:intro} + + +\begin{figure}[htb] + \centering + \includegraphics + \caption{Test} +\end{figure} \end{document} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: diff --git a/scientific-emacs b/scientific-emacs index 649ac8c..9497e35 100755 --- a/scientific-emacs +++ b/scientific-emacs @@ -3,12 +3,17 @@ ip=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}') xhost + $ip echo 'checking redis ...' -if [ "$(docker container inspect -f '{{.State.Status}}' this_redis)" = "running" ]; then +state=$(docker container inspect -f '{{.State.Status}}' this_redis) +echo "$state" +if [ $state = "exited" ]; then echo 'starting redis' docker start this_redis +elif [ $state = "running" ]; then + echo 'stopping redis...' + docker stop this_redis + docker start this_redis else - echo 'running redis...' - docker run --name this_redis redis + docker run -d --name this_redis redis fi # scientific