Browse Source

auctex & pdftools on ubuntu

redis
parent
commit
f5fb820f0e
9 changed files with 104 additions and 131 deletions
  1. +4
    -0
      .gitignore
  2. +15
    -0
      Readme.md
  3. +57
    -57
      config/.emacs
  4. +3
    -1
      docker/emacs/Dockerfile
  5. +0
    -1
      examples/latex-test/main.aux
  6. +0
    -69
      examples/latex-test/main.log
  7. BIN
      examples/latex-test/main.pdf
  8. +17
    -0
      examples/latex-test/main.tex
  9. +8
    -3
      scientific-emacs

+ 4
- 0
.gitignore View File

@ -15,3 +15,7 @@ config/.cache
config/.zshrc.pre-oh-my-zsh
.DS_Store
dump.rdb
*.aux
*.log
*.synctex.gz
*.blg

+ 15
- 0
Readme.md View File

@ -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


+ 57
- 57
config/.emacs View File

@ -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.


+ 3
- 1
docker/emacs/Dockerfile View File

@ -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


+ 0
- 1
examples/latex-test/main.aux View File

@ -1 +0,0 @@
\relax

+ 0
- 69
examples/latex-test/main.log View File

@ -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
</usr/share/
texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/share/texlive
/texmf-dist/fonts/type1/public/amsfonts/cm/cmr7.pfb>
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)

BIN
examples/latex-test/main.pdf View File


+ 17
- 0
examples/latex-test/main.tex View File

@ -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:

+ 8
- 3
scientific-emacs View File

@ -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


Loading…
Cancel
Save