| 1 |
%% $Id: minted-code-doc.tex 1155 2025-10-08 08:55:59Z herbert $ |
| 2 |
%% |
| 3 |
\listfiles |
| 4 |
\documentclass[russian,greek,ngerman,twoside=on, |
| 5 |
spanish,polish,english,parskip=half-, |
| 6 |
paper=a4,DIV=14]{scrartcl} |
| 7 |
|
| 8 |
\usepackage[ |
| 9 |
mono=Julia Mono, |
| 10 |
monoFeatures={Scale=MatchLowercase,FakeStretch=0.88}, |
| 11 |
math=STIXTwo Math, |
| 12 |
mathFeatures={math-style=TeX}]{gentium-otf} |
| 13 |
\setsansfont |
| 14 |
[ Ligatures = TeX , |
| 15 |
Scale = MatchUppercase, |
| 16 |
Extension = .otf, |
| 17 |
Numbers = Lining, |
| 18 |
UprightFont = *-Regular, |
| 19 |
ItalicFont = *-Italic, |
| 20 |
BoldFont = *-Bold, |
| 21 |
BoldItalicFont = *-BoldItalic, |
| 22 |
]{FiraSans} |
| 23 |
|
| 24 |
\usepackage{babel} |
| 25 |
|
| 26 |
\usepackage{minted-code} |
| 27 |
\usepackage{fancyvrb} |
| 28 |
\usepackage{xcolor,url} |
| 29 |
\usepackage[colorlinks]{hyperref} |
| 30 |
|
| 31 |
\def\Lcs#1{\texttt{\textbackslash#1}\index{#1@\texttt{\textbackslash#1}}} |
| 32 |
\def\Largb#1{\texttt{\{}\textit{#1}\texttt{\}}} |
| 33 |
\def\Lpack#1{\texttt{#1}\index{#1@\texttt{#1}}\index{Package!#1@\texttt{#1}}} |
| 34 |
\def\Loption#1{\texttt{#1}\index{#1@\texttt{#1}}\index{Option!#1@\texttt{#1}}} |
| 35 |
|
| 36 |
\title{List source code with minted} |
| 37 |
\author{Herbert Voß\thanks{\protect\url{[email protected]}}} |
| 38 |
\raggedbottom |
| 39 |
|
| 40 |
\begin{document} |
| 41 |
|
| 42 |
\maketitle |
| 43 |
|
| 44 |
\tableofcontents |
| 45 |
|
| 46 |
\section{Sourcecode without output } |
| 47 |
|
| 48 |
\subsection{Environment \texttt{codeblock}} |
| 49 |
|
| 50 |
\begin{Verbatim} |
| 51 |
\begin{codeblock}[minted language=bash, title=Bash code (Terminal)] |
| 52 |
ls -la | grep ".pdf" |
| 53 |
\end{codeblock} |
| 54 |
\end{Verbatim} |
| 55 |
|
| 56 |
|
| 57 |
\begin{codeblock}[minted language=bash, title=Bash code (Terminal)] |
| 58 |
ls -la | grep ".pdf" |
| 59 |
\end{codeblock} |
| 60 |
|
| 61 |
|
| 62 |
\begin{Verbatim} |
| 63 |
\setminted{breakafter=/}% allows linebreak after slash |
| 64 |
\begin{codeblock}[minted language=python3, title=A PAthon3 example] |
| 65 |
import dash |
| 66 |
import dash_core_components as dcc |
| 67 |
import dash_html_components as html |
| 68 |
import plotly.express as px |
| 69 |
import pandas as pd |
| 70 |
|
| 71 |
[...] |
| 72 |
|
| 73 |
if __name__ == '__main__': |
| 74 |
app.run(debug=False) |
| 75 |
\end{codeblock} |
| 76 |
\end{Verbatim} |
| 77 |
|
| 78 |
\setminted{breakafter=/} |
| 79 |
\begin{codeblock}[minted language=python3, title=A PAthon3 example] |
| 80 |
import dash |
| 81 |
import dash_core_components as dcc |
| 82 |
import dash_html_components as html |
| 83 |
import plotly.express as px |
| 84 |
import pandas as pd |
| 85 |
|
| 86 |
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] |
| 87 |
app = dash.Dash(__name__, external_stylesheets=external_stylesheets) |
| 88 |
df = pd.read_csv('https://gist.githubusercontent.com/chriddyp/5d1ea79569ed194d432e56108a04d188/raw/a9f9e8076b837d541398e999dcbac2b2826a81f8/gdp-life-exp-2007.csv') |
| 89 |
|
| 90 |
print(df) |
| 91 |
fig = px.scatter(df, x="gdp per capita", y="life expectancy", |
| 92 |
size="population", color="continent", hover_name="country", |
| 93 |
log_x=True, size_max=60) |
| 94 |
|
| 95 |
app.layout = html.Div([ |
| 96 |
dcc.Graph( |
| 97 |
id='life-exp-vs-gdp', |
| 98 |
figure=fig |
| 99 |
) |
| 100 |
]) |
| 101 |
|
| 102 |
if __name__ == '__main__': |
| 103 |
app.run(debug=False) |
| 104 |
\end{codeblock} |
| 105 |
|
| 106 |
|
| 107 |
\subsection{Environment \texttt{codeblockA}} |
| 108 |
|
| 109 |
|
| 110 |
\begin{Verbatim} |
| 111 |
\begin{codeblockA}[title=Code with \LaTeX]% default lang is latex |
| 112 |
\usepackage[ |
| 113 |
sans=FiraSans-Regular.otf, |
| 114 |
sansFeatures={Scale=MatchUppercase}, |
| 115 |
mono=Julia Mono, |
| 116 |
monoFeatures={Scale=MatchLowercase,FakeStretch=0.88}, |
| 117 |
math=STIXTwo Math, |
| 118 |
mathFeatures={math-style=TeX}]{gentium-otf} |
| 119 |
\end{codeblockA} |
| 120 |
\end{Verbatim} |
| 121 |
|
| 122 |
|
| 123 |
\begin{codeblockA}[title=Code with \LaTeX]% default lang is latex |
| 124 |
\usepackage[ |
| 125 |
sans=FiraSans-Regular.otf, |
| 126 |
sansFeatures={Scale=MatchUppercase}, |
| 127 |
mono=Julia Mono, |
| 128 |
monoFeatures={Scale=MatchLowercase,FakeStretch=0.88}, |
| 129 |
math=STIXTwo Math, |
| 130 |
mathFeatures={math-style=TeX}]{gentium-otf} |
| 131 |
\end{codeblockA} |
| 132 |
|
| 133 |
|
| 134 |
\section{Sourcecode with \LaTeX-output} |
| 135 |
|
| 136 |
\subsection{\texttt{exampleA}} |
| 137 |
|
| 138 |
\begin{Verbatim} |
| 139 |
\begin{exampleA}[righthand width=0.6\linewidth]{Capitals toSC -- exampleA} |
| 140 |
Gentium Font ŐŰÉÁÄ |
| 141 |
\Lctosc{Gentium Font ŐŰÉÁÄ}\\ |
| 142 |
\LCtoSC+ Gentium Font ŐŰÉÁÄ |
| 143 |
\end{exampleA} |
| 144 |
\end{Verbatim} |
| 145 |
|
| 146 |
\begin{exampleA}[righthand width=0.6\linewidth]{Capitals toSC -- exampleA} |
| 147 |
Gentium Font ŐŰÉÁÄ |
| 148 |
\Lctosc{Gentium Font ŐŰÉÁÄ}\\ |
| 149 |
\LCtoSC+ Gentium Font ŐŰÉÁÄ |
| 150 |
\end{exampleA} |
| 151 |
|
| 152 |
\subsection{\texttt{exampleB}} |
| 153 |
|
| 154 |
\begin{Verbatim} |
| 155 |
\begin{exampleB}%[righthand width=0.6\linewidth] |
| 156 |
{Ligatures -- exampleB} |
| 157 |
No ligatures for the upright font! |
| 158 |
Schifffahrt ff, fi, ffi, fl |
| 159 |
|
| 160 |
\itshape but for the italic font! |
| 161 |
Schifffahrt ff, fi, ffi, fl |
| 162 |
{\LLIGA- ff, fi, ffi, fl, Schifffahrt} |
| 163 |
\end{exampleB} |
| 164 |
\end{Verbatim} |
| 165 |
|
| 166 |
|
| 167 |
\begin{exampleB}%[righthand width=0.6\linewidth] |
| 168 |
{Ligatures -- exampleB} |
| 169 |
No ligatures for the upright font! |
| 170 |
Schifffahrt ff, fi, ffi, fl |
| 171 |
|
| 172 |
\itshape but for the italic font! |
| 173 |
Schifffahrt ff, fi, ffi, fl |
| 174 |
{\LLIGA- ff, fi, ffi, fl, Schifffahrt} |
| 175 |
\end{exampleB} |
| 176 |
|
| 177 |
|
| 178 |
\subsection{\texttt{exampleM}} |
| 179 |
|
| 180 |
|
| 181 |
\begin{exampleM}[]{Stylistic Sets -- exampleM} |
| 182 |
default: aªàáâãäåāăąǎǟǡǻȁȃȧḁẚạảấầẩẫậắằẳẵặⱥₐᵃ◌ͣgĝğġģǧǵǥḡꞡᵍ\par |
| 183 |
ss01: \Lss01{aªàáâãäåāăąǎǟǡǻȁȃȧḁẚạảấầẩẫậắằẳẵặⱥₐᵃ◌ͣgĝğġģǧǵǥḡꞡᵍ}\par |
| 184 |
ss11: \Lss11{aªàáâãäåāăąǎǟǡǻȁȃȧḁẚạảấầẩẫậắằẳẵặⱥₐᵃ◌ͣ}\par |
| 185 |
ss12: \Lss12{ĝğġģǧǵǥḡꞡᵍ}\par |
| 186 |
ss04: đƀǥ \Lss04{đƀǥ}\par |
| 187 |
default: aãàáâäåāăǎǟǡǻȁȃȧḁẚảấầẩẫậắằẳẵạặⱥɐæfḟiìíîïĩīĭįǐȉȋḭḯỉịılĺḷḹḻḽꝉₗvṽṿꝟzźżžẑẓẕғӻfiffi\par |
| 188 |
ss05: \Lss05{aãàáâäåāăǎǟǡǻȁȃȧḁẚảấầẩẫậắằẳẵạặⱥɐæfḟiìíîïĩīĭįǐȉȋḭḯỉịılĺḷḹḻḽꝉₗvṽṿꝟzźżžẑẓẕғӻfiffi}\par |
| 189 |
ss07: áàâǎāãäȧ \Lss05{áàâǎāãäȧ} also for e,o,\ldots |
| 190 |
\end{exampleM} |
| 191 |
|
| 192 |
|
| 193 |
\begingroup |
| 194 |
\selectlanguage{greek} |
| 195 |
|
| 196 |
\begin{exampleM}[]{Greek language -- exampleM} |
| 197 |
%%\usepackage[greek]{babel} |
| 198 |
Από τις 140 χώρες που υπάρχουν στο κόσμο, μόνον 19 έχουν πραγματική δημοκρατία. |
| 199 |
Τούτο σημαίνει ότι αυτό το θαυμάσιο και ευαίσθητο πολίτευμα είναι δύσκολο στην |
| 200 |
εφαρμογή του. Και προϋποθέτει ειδικές συνθήκες, χωρίς τις οποίες δεν ημπορεί να |
| 201 |
ανθίσει και να καρποφορήσει. |
| 202 |
|
| 203 |
Δημοκρατία θα ήθελαν να έχουν όλοι οι λαοί. Αλλά δεν την έχουν παρά μόνο εκείνοι |
| 204 |
που, εκτός από την συνειδητοποίηση των προτερημάτων της, σέβονται και τους όρους |
| 205 |
της λειτουργίας της. |
| 206 |
\end{exampleM} |
| 207 |
\endgroup |
| 208 |
|
| 209 |
\begingroup |
| 210 |
\selectlanguage{russian} |
| 211 |
\begin{exampleM}[]{Cyrillic language -- exampleM} |
| 212 |
%%\usepackage[russian]{babel} |
| 213 |
Из 140 стран мира только 19 имеют реальную демократию. |
| 214 |
Это означает, что эта замечательная и чувствительная система трудно реализовать. |
| 215 |
И это требует особых условий, без которых он не может цветут и принести фрукты. |
| 216 |
|
| 217 |
Демократия хотела бы, чтобы все народы имели. Но у них есть только те, кто, в дополнение |
| 218 |
к реализации его достижений, также уважают условия его работы. |
| 219 |
\end{exampleM} |
| 220 |
\endgroup |
| 221 |
|
| 222 |
\end{document} |
| 223 |
|