Skip to content

Commit e12433a

Browse files
committed
Доработан для сборки в 20.04, добавлена сборка через docker
1 parent 1953a4c commit e12433a

File tree

7 files changed

+89
-17
lines changed

7 files changed

+89
-17
lines changed

Dockerfile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# build with: sudo docker build -t navsyslab/nslreport:v1 .
2+
# run with: sudo docker run -it -v ~/NSLReport:/tmp/tex navsyslab/nslreport:v1
3+
#
4+
5+
FROM ubuntu:20.04
6+
RUN sed -i'' 's/archive\.ubuntu\.com/us\.archive\.ubuntu\.com/' /etc/apt/sources.list
7+
MAINTAINER Ilya Korogodin <korogodiniv@gmail.com>
8+
ARG DEBIAN_FRONTEND=noninteractive
9+
RUN apt update
10+
RUN apt install -y \
11+
make \
12+
inkscape \
13+
imagemagick \
14+
latexmk \
15+
texlive-latex-base \
16+
texlive-latex-extra \
17+
texlive-extra-utils \
18+
texlive-lang-cyrillic \
19+
texlive-luatex \
20+
texlive-bibtex-extra \
21+
biber \
22+
cm-super \
23+
&& \
24+
rm -rf /var/lib/apt/lists/* && \
25+
apt clean
26+
27+
RUN sed -i 's/^.*policy.*coder.*none.*PDF.*//' /etc/ImageMagick-6/policy.xml
28+
29+
# COPY ../fonts/* /usr/local/share/fonts/
30+
# %RUN fc-cache -f -v && luaotfload-tool -u -f
31+
32+
#make a Testman user
33+
RUN adduser --disabled-password --gecos '' testman
34+
USER testman
35+
WORKDIR /home/testman
36+

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ BIBFILE=$(TEX)/rpz.bib
2525
STYLES=$(TEX)/NSLReport.cls $(TEX)/NSLExtra.sty $(TEX)/NSLDisser.sty $(TEX)/NSLEskd.sty
2626
PARTS_TEX = $(wildcard $(TEX)/[0-9][0-9]-*.tex)
2727

28+
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
29+
mkfile_dir := $(dir $(mkfile_path))
30+
2831
ifeq ($(firstword $(LATEX)), pdflatex)
2932
CODE_CONVERTION=iconv -f UTF-8 -t KOI8-R
3033
else
@@ -121,6 +124,13 @@ example_eskd_fo:
121124
printf "Directory $(TEX) is exist already! If you want to compile an example, you should delete it manually and try again\n"; \
122125
fi
123126

127+
image:
128+
sudo docker build -t navsyslab/nslreport:v1 .
129+
130+
docker: image
131+
sudo docker run --rm -it -v $(mkfile_dir):/tmp/report navsyslab/nslreport:v1 make -C /tmp/report
132+
133+
124134
distclean: clean
125135

126136
PACK = $(addprefix NSLReport, Makefile tex/* src/* utils/*)

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,25 @@
4343
С примерами в формате pdf можно ознакомиться в директории `examples`.
4444
Собранные версии документов отстают от исходных материалов, обновляются не каждый коммит.
4545

46-
## Как собрать пример?
4746

48-
Можно начать со сборки примера
47+
## Как собрать пример в виртуальном docker-окружении?
48+
49+
Самый простой вариант попробовать фреймворк - это собрать пример в docker-окружении.
50+
Для этого достаточно выполнить команду (потребует права суперпользователя для сборки образа и его запуска):
51+
```
52+
make docker
53+
```
54+
Конечно, предварительно установив сам docker (например, `sudo apt install docker-ce`).
55+
56+
При первом запуске `make docker` будет собран образ и создана директория `tex` с исходными файлами примера.
57+
Из них будет собран документ `tex/rpz.pdf`.
58+
Дальнейшие запуски команды `make docker` будут приводить к пересборке документа.
59+
60+
61+
## Как собрать пример с установкой зависимостей в основную систему?
4962

5063
1. Установить texlive, inkscape и другие зависимости:
64+
5165
```sudo apt-get update
5266
sudo apt-get install -y
5367
latexmk \
@@ -63,6 +77,7 @@
6377
и далее по-обстоятельсвам.
6478

6579
2. Разрешить imagemagick клепать pdf-ки, для чего поправить policies (можно руками):
80+
6681
```
6782
sed -i 's/^.*policy.*coder.*none.*PDF.*//' /etc/ImageMagick-6/policy.xml
6883
```
@@ -76,6 +91,7 @@ git clone https://github.com/Korogodin/NSLReport
7691
```
7792

7893
5. Собрать пример
94+
7995
```
8096
make
8197
```

examples/disser/rpz.bib

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,12 +1419,11 @@ @Manual{federalRadionavigationPlan2001
14191419
}
14201420

14211421
@Article{monteiro2005,
1422-
author = {Monteiro, Luís Sardinha and Moore, Terry and Hill, Chris},
1423-
title = {{What is the accuracy of DGPS?}},
1424-
journal = {{The Journal of Navigation}},
1425-
number = {{58}},
1422+
author = {Monteiro, Luis Sardinha and Moore, Terry and Hill, Chris},
1423+
title = {What is the accuracy of DGPS?},
14261424
year = 2005,
14271425
pages = {207-225},
1426+
number = 30,
14281427
}
14291428

14301429
@inproceedings{teunissen1993,

examples/eskd_fo/rpz.bib

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,12 +1419,11 @@ @Manual{federalRadionavigationPlan2001
14191419
}
14201420

14211421
@Article{monteiro2005,
1422-
author = {Monteiro, Luís Sardinha and Moore, Terry and Hill, Chris},
1423-
title = {{What is the accuracy of DGPS?}},
1424-
journal = {{The Journal of Navigation}},
1425-
number = {{58}},
1422+
author = {Monteiro, Luis Sardinha and Moore, Terry and Hill, Chris},
1423+
title = {What is the accuracy of DGPS?},
14261424
year = 2005,
14271425
pages = {207-225},
1426+
number = 30,
14281427
}
14291428

14301429
@inproceedings{teunissen1993,

sty/NSLDisser.sty

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
\geometry{ignorefoot}% считать от нижней границы текста
5252

5353

54-
\usepackage[backend=biber, style=gost-numeric, sorting=none]{biblatex}
54+
\usepackage[backend=biber, bibencoding=utf8, style=gost-numeric, sorting=none]{biblatex}
5555
\usepackage{csquotes}
5656

5757
\usepackage{fancyhdr} % пакет для установки колонтитулов

sty/NSLExtra.sty

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,29 @@ citecolor=black, menucolor=black, filecolor=black,
8383
\defaulthyphenchar=127
8484

8585
% \RequirePackage{cmap}% % теперь из pdf можно копипастить русский текст % да и так можно, всё ок
86-
\RequirePackage[T2A]{fontenc}%
86+
\RequirePackage[T1, T2A]{fontenc}%
8787
\RequirePackage[utf8]{inputenc}%
8888
\RequirePackage[english,russian]{babel}%
8989

9090

91-
9291
% GOST 7.32 p. 6.4.6 excluded letters ё, з, й, о, ч, ъ, ы, ь., переопределяем asbuk из бабеля
93-
\renewcommand*{\Asbuk}[1]{\protect\StrChar{АБВГДЕЖИКЛМНПРСТУФХЦШЩЭЮЯ}{\the\@nameuse{c@#1}}}
94-
\renewcommand*{\asbuk}[1]{\protect\StrChar{абвгдежиклмнпрстуфхцшщэюя}{\the\@nameuse{c@#1}}}
95-
96-
92+
%\renewcommand*{\Asbuk}[1]{\protect\StrChar{АБВГДЕЖИКЛМНПРСТУФХЦШЩЭЮЯ}{\the\@nameuse{c@#1}}}
93+
%\renewcommand*{\asbuk}[1]{\protect\StrChar{абвгдежиклмнпрстуфхцшщэюя}{\the\@nameuse{c@#1}}}
94+
% Временные проблемы с переопределением в 20.04, поэтому так:
95+
\renewcommand{\asbuk}[1]{\expandafter\russian@realalph\csname c@#1\endcsname}
96+
\renewcommand{\Asbuk}[1]{\expandafter\russian@realAlph\csname c@#1\endcsname}
97+
\def\russian@realAlph#1{\ifcase#1\or
98+
А\or Б\or В\or Г\or Д\or Е\or Ж\or
99+
И\or К\or Л\or М\or Н\or
100+
П\or Р\or С\or Т\or У\or Ф\or Х\or
101+
Ц\or Ш\or Щ\or Э\or Ю\or Я\else\xpg@ill@value{#1}{russian@Alph}\fi}
102+
\def\russian@realalph#1{\ifcase#1\or
103+
а\or б\or в\or г\or д\or е\or ж\or
104+
и\or к\or л\or м\or н\or
105+
п\or р\or с\or т\or у\or ф\or х\or
106+
ц\or ш\or щ\or э\or ю\or я\else\xpg@ill@value{#1}{russian@alph}\fi}
107+
108+
97109
\RequirePackage{enumitem}
98110
\AddEnumerateCounter{\Asbuk}{\@Asbuk}{Я} % иначе asbuk ломается в перечислениях
99111
\AddEnumerateCounter{\asbuk}{\@asbuk}{я} %

0 commit comments

Comments
 (0)