]> Untitled Git - articles.git/commitdiff
Начал работу с блоком фрагмента кода
authorNikolay Shaplov <dhyan@nataraj.su>
Sat, 13 Jun 2026 09:37:33 +0000 (12:37 +0300)
committerNikolay Shaplov <dhyan@nataraj.su>
Sat, 13 Jun 2026 09:37:33 +0000 (12:37 +0300)
slides/0000 - LaTeX Stub/elements/code.tex
slides/0000 - LaTeX Stub/example.tex
slides/0000 - LaTeX Stub/pgpro2025bis.theme/beamercolorthemePgPro2025bis.sty
slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/CONSOLA.TTF [deleted file]
slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/CONSOLAB.TTF [deleted file]
slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/Consolas.ttf [deleted file]
slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/consolai.ttf [deleted file]
slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/consolaz.ttf [deleted file]

index 9c504c3eac1432f8c9a41050d8fb9e5c43e023bd..877edc10f6f2677aad3f93763a3173312c2f9b7c 100644 (file)
@@ -1,4 +1,4 @@
-\usepackage{listings}
+\usepackage{listingsutf8} % listings с поддержкой unicode
 
 % for listings
 \definecolor{acmebg}{HTML}{FFFFEF}
@@ -42,4 +42,4 @@
                 \kern\linewidth \kern\lst@numbersep
                 \lst@numberstyle{\thelstnumber}}\lst@linebgrd}%
     }{\PackageError{Listings}{Numbers #1 unknown}\@ehc}}
-\makeatother
\ No newline at end of file
+\makeatother
index 3d49f2ade5c08fe8c35f867bab9f0e3e03601787..3bd75788bf7af157ad76b06fccde0cb45b0e853b 100644 (file)
 
     Пример кода:
     % gobble отрежет 8 символов левого отступа и избавится от финальной пустой строки т.к. она короче 8ми символов
-    \begin{lstlisting}[linewidth=0.9\textwidth, gobble=8]
+    \begin{lstlisting}[language=bash, linewidth=0.9\textwidth, gobble=8, inputencoding=utf8, extendedchars=true]
+        echo "Hellow, World! По русски"
         pip install -r requirements.txt
         # Дети, никогда так не делайте. Питон опасен для когнитивных функций вашего мозга!
     \end{lstlisting}
index 4ccefdb6c160189a3cfc7be039d21d878eafb79f..0b01dd7006e1096502c568d6aa565d3e9cb5020b 100644 (file)
@@ -3,7 +3,7 @@
 % Settings
 \AtBeginDocument{\setromanfont{Times New Roman}}
 \AtBeginDocument{\setsansfont{Roboto}}
-\AtBeginDocument{\setmonofont{Consolas}}
+\AtBeginDocument{\setmonofont{RobotoMono-Regular}}
 \setbeamercolor*{title page header}{fg=white}
 \setbeamerfont*{title}{size*={40pt}{40pt},family={\fontspec{Roboto-Medium}}}
 \setbeamercolor*{subtitle}{fg=subTitleColor}
 \renewcommand{\ULthickness}{\dimexpr \f@size pt * 488 / 10000 \relax}%
 \renewcommand{\ULdepth}{\dimexpr \f@size pt * 10 / 100 \relax}% отступ от базовой линии
 
-
 % Переопределяем href чтобы он использовал \uline для подчеркивания ссылок
 \let\oldhref\href
 \renewcommand{\href}[2]{{\color{urlcolor}\uline{\oldhref{#1}{#2}}}}
 
+
+\definecolor{codeTextColor}{HTML}{142D99}
+\definecolor{codeBgColor}{HTML}{EFEFF2}
+\setbeamerfont*{codelisting}{size*={14pt}{16pt},family=\ttfamily}
+
+\AtBeginDocument{%
+  \@ifpackageloaded{listings}{%
+    \lstset{
+      basicstyle=\usebeamerfont{codelisting}\color{codeTextColor},
+      backgroundcolor=\color{codeBgColor},
+      rulecolor=\color{codeBgColor},
+    }%
+  }{}%
+}
+
+
+
+
+
 % Макросы воспроизводят поведение LibreOffice Impress при размещении текста
 % в текстовом блоке: LibreOffice использует usWinAscent как First Baseline
 % Offset — расстояние от верхней границы блока до базовой линии первой строки.
diff --git a/slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/CONSOLA.TTF b/slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/CONSOLA.TTF
deleted file mode 100644 (file)
index 556d2fd..0000000
Binary files a/slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/CONSOLA.TTF and /dev/null differ
diff --git a/slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/CONSOLAB.TTF b/slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/CONSOLAB.TTF
deleted file mode 100644 (file)
index ef6d555..0000000
Binary files a/slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/CONSOLAB.TTF and /dev/null differ
diff --git a/slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/Consolas.ttf b/slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/Consolas.ttf
deleted file mode 100644 (file)
index 2162134..0000000
Binary files a/slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/Consolas.ttf and /dev/null differ
diff --git a/slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/consolai.ttf b/slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/consolai.ttf
deleted file mode 100644 (file)
index 74a5445..0000000
Binary files a/slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/consolai.ttf and /dev/null differ
diff --git a/slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/consolaz.ttf b/slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/consolaz.ttf
deleted file mode 100644 (file)
index 3b51dd3..0000000
Binary files a/slides/0000 - LaTeX Stub/pgpro2025bis.theme/fonts/consolaz.ttf and /dev/null differ