Skip to content

Commit 566975c

Browse files
author
Denis Jelovina
committed
add config.cfg
1 parent edbf574 commit 566975c

File tree

3 files changed

+115
-1
lines changed

3 files changed

+115
-1
lines changed

.github/workflows/static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
# 'mk4ht' is now guaranteed to be available in this container environment
5656
run: |
5757
echo "Starting HTML compilation with mk4ht..."
58-
mk4ht htlatex main.tex "xhtml" "-p"
58+
mk4ht htlatex main.tex "config.cfg,xhtml" "-p"
5959
6060
# Create output directory and move files
6161
mkdir -p html_output

config.cfg

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
% config.cfg
2+
\Preamble{xhtml}
3+
4+
\begin{document}
5+
% Wrap the entire CSS block in \HCode{}
6+
\HCode{
7+
<style type="text/css">
8+
body {
9+
font-family: Arial, sans-serif;
10+
line-height: 1.6;
11+
color: #333;
12+
margin: 150px;
13+
background-color: white;
14+
}
15+
a {
16+
color: #007bff;
17+
text-decoration: none;
18+
}
19+
a:hover {
20+
text-decoration: underline;
21+
}
22+
h1, h2, h3, h4, h5, h6 {
23+
color: #2c3e50;
24+
margin-top: 1.5em;
25+
margin-bottom: 0.5em;
26+
}
27+
div.lstlisting {
28+
border: 1px solid #ccc;
29+
background-color: #f8f8f8;
30+
padding: 10px;
31+
border-radius: 5px;
32+
overflow-x: auto;
33+
margin-bottom: 1em;
34+
}
35+
div.lstlisting pre {
36+
margin: 0;
37+
}
38+
table {
39+
width: 100%;
40+
border-collapse: collapse;
41+
margin-bottom: 1em;
42+
}
43+
th, td {
44+
border: 1px solid #ddd;
45+
padding: 8px;
46+
text-align: left;
47+
}
48+
th {
49+
background-color: #f2f2f2;
50+
font-weight: bold;
51+
}
52+
tr:nth-child(even) {
53+
background-color: #f9f9f9;
54+
}
55+
div.figure {
56+
text-align: center;
57+
margin-bottom: 1.5em;
58+
}
59+
span.caption {
60+
display: block;
61+
font-style: italic;
62+
color: #555;
63+
margin-top: 0.5em;
64+
}
65+
ul, ol {
66+
margin-left: 20px;
67+
padding-left: 0;
68+
margin-bottom: 1em;
69+
}
70+
li {
71+
margin-bottom: 0.5em;
72+
}
73+
</style>
74+
}
75+
\EndPreamble

main.tex

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,51 @@
77
\usepackage{courier}
88
\usepackage{hyperref} % For clickable links in PDF
99
\usepackage{listings}
10+
\usepackage{xcolor}
11+
12+
% \lstset{
13+
% % Other useful options
14+
% breaklines=true, % Automatic line breaking for long lines
15+
% breakatwhitespace=true, % Break lines only at whitespace
16+
% tabsize=2, % Number of spaces a tab represents
17+
% captionpos=b, % Caption position: b (bottom) or t (top)
18+
% showspaces=false, % Do not show dots for spaces
19+
% showtabs=false, % Do not show markers for tabs
20+
% showstringspaces=false, % Do not show dots for spaces within strings
21+
% extendedchars=true, % Allow extended ASCII characters
22+
% inputencoding=utf8, % Specify input encoding
23+
% literate={_}{_}1 {~}{~}1 {^}{^}1 {\textless}{<}1 {\textgreater}{>}1, % Handle special characters
24+
% }
1025

1126
\lstset{
27+
% Colors (requires xcolor package)
28+
backgroundcolor=\color[rgb]{0.95,0.95,0.95}, % Light gray background (adjust RGB as needed)
29+
commentstyle=\color[rgb]{0.2,0.4,0.2}\ttfamily\small, % Dark green comments
30+
keywordstyle=\color[rgb]{0.6,0.0,0.0}\bfseries, % Dark red bold keywords
31+
stringstyle=\color[rgb]{0.0,0.0,0.8}, % Blue strings
32+
numberstyle=\small\color{gray}, % Small gray line numbers
33+
% Frame and numbering
34+
frame=single, % Draws a single frame around the listing
35+
framesep=5pt, % Space between the frame and the code
36+
rulecolor=\color{black}, % Color of the frame
37+
numbers=left, % Display line numbers on the left
38+
stepnumber=1, % Increment line numbers by 1
39+
firstnumber=auto, % Start numbering from 1 for each new listing
40+
% Language settings
1241
basicstyle=\ttfamily\small,
1342
language=C++,
1443
columns=fullflexible,
1544
keepspaces=true,
45+
% Other useful options
46+
breaklines=true, % Automatic line breaking for long lines
47+
breakatwhitespace=true, % Break lines only at whitespace
48+
tabsize=2, % Number of spaces a tab represents
49+
captionpos=b, % Caption position: b (bottom) or t (top)
50+
showspaces=false, % Do not show dots for spaces
51+
showtabs=false, % Do not show markers for tabs
52+
showstringspaces=false, % Do not show dots for spaces within strings
53+
extendedchars=true, % Allow extended ASCII characters
54+
inputencoding=utf8, % Specify input encoding
1655
% Map Unicode “·” and “⊙” to LaTeX-safe output:
1756
literate=
1857
{·}{{$\cdot$}}1

0 commit comments

Comments
 (0)