JavedA's picture
init
a67ae61
raw
history blame
6.59 kB
/* --------------------------------- chapter -------------------------------- */
Example:
\chapter{Further implemented dynamical systems}
\label{ch_Ap_Dyna}
regex:
\\chapter\{(.*?)\}
\\label\{(.*?)\}
replace with:
# $1 {#sec-$2}
/* --------------------------------- section -------------------------------- */
search:
\\section\{(.*)\}
\\label\{(.*?)\}
replace:
## $1 {#sec-$2}
/* ------------------------------- subsection ------------------------------- */
search:
\\subsection\{(.*)\}
\\label\{(.*?)\}
replace:
### $1 {#sec-$2}
/* -------------------------------- sections -------------------------------- */
[-@sec{chapers, sections, subsections}] --> without Quatroos Chapters, sections, Subsection.. see: https://quarto.org/docs/authoring/cross-references.html
regex:
(@sec-[\w\d]+)
replace
[-$1]
/* ------------------------------ ref sections ------------------------------ */
syntax
## Introduction {#sec-introduction}
See @sec-introduction for additional context.
latex syntax:
\ref{subsec_1_1_1_Principles}
search
make search non greedy
\\ref\{(.*?)\}
replace:
@sec-$1
/* ------------------ ref fig,eq,chapter and more with dot ------------------ */
example:
@eq-eq_1_1_MPV. --> @eq-eq_1_1_MPV .
search:
@([\w+\d+\.-]+)\.
replace
@$1 .
/* ---------------------------- ref sections dot ---------------------------- */
@sec-(.*?)\.
@sec-$1 .
/* ----------------------------- boldsymbol math ---------------------------- */
\\bm
\boldsymbol
/* -------------------------- equation Equation jb -------------------------- */
/* ------------------------------- equations_0 ------------------------------ */
match all that do not start with $$ like:
$$
\begin{equation}
F = \dot{\vec{x}}(t) = \frac{\vec{x}(t)}{dt} = f(\vec{x}(t))^
\label{eq_1_0_DGL}
\end{equation}
$${#eq-eq_1_0_DGL_}
match like:
\begin{equation}
\boldsymbol A_{3\times 3}\,(\vec{\beta}) =
\begin{bmatrix}
\beta_{1,1} & \beta_{1,2} & \beta_{1,3}\\
\beta_{2,1} &\beta_{2,2} & \beta_{2,3}\\
\beta_{3,1} & \beta_{3,2} &\beta_{3,3}
\end{bmatrix}
\label{eq_17_Dist_A}
\end{equation}
serach:
^(?!\$\$)
(\\begin\{equation\}
(.|\n)*?\\label\{(.*?)\}(.|\n)*?\\end\{equation\})
replace with:
$$$$
$1
$$$$ {#eq-$3}
/* ---------------------------------- eqref --------------------------------- */
\\eqref\{(.*?)\}
replace:
@eq-$1
/* ------------------------------ math sings_0 ------------------------------ */
/* -------------------------------- bold word ------------------------------- */
\\textbf\{(.*?)\}
replace:
**$1**
/* ---------------------------------- tags ---------------------------------- */
repeat label see:
$$
\begin{equation}
\boldsymbol {A_{i \mu}} \approx \boldsymbol A^{\prime}_{i \mu} = (\boldsymbol W \boldsymbol H)_{i \mu} = \sum_{a = 1}^{r}
\boldsymbol W_{ia} \boldsymbol H_{a \mu}
\end{equation}
$$
2_Task/7_QT.md
/* --------------------------------- italic --------------------------------- */
\\emph\{(.*?)\}
*$1*
/* -------------------------------- comments -------------------------------- */
tripple comment
search for
(%.*)
(%.*)
(%.*)
<!-- $1 -->
<!-- $2 -->
<!-- $3 -->
single advanced comment, includes tripple comment
(^%.*|^\s%.*|^\s+%.*)
<!--$1-->
/* ---------------------------------- cite ---------------------------------- */
single cite
\\cite\{([\d\s\w:-]+)\}
[@$1]
double cite
find:
\\cite\{([\d\s\w,]+)\}
replace manually --> see example
[@Silva2020; @Kaptanoglu2022]
regex abailites:
should not start with:[ --> negative look behind
should not coninue with: negative look ahead
(?<!\[)@(?!sec|eq)
/* ========================================================================== */
/* ================================= figures ================================ */
/* ========================================================================== */
/* ---------------------------------- fig 1 --------------------------------- */
\\begin\{figure\}\[.*\]
.*
\s+?\\includegraphics.*?\{(.*?)\}
\s+?\\caption\{(.*?)\}
\s+?\\label\{(.*?)\}
[\s+]?\\end\{figure\}
![$2](../../$1){#fig-$3}
/* ---------------------------------- fig 2 --------------------------------- */
fig Paths
../../2_Figures/(.*).pdf
../../3_Figs_Pyth/$1.svg
/* ------------------------------- fig naming ------------------------------- */
instead of @sec-fig_label get to fig-fig:Label
@sec-(fig.*?)\s
# make sure to add one spacing
@fig-$1
/* ------------------------ figure refering with dot ------------------------ */
exaomple:
depicted in figure @sec-fig_2_Lorenz_Example.\newline
search for:
@sec-(fig.*?)\.
replace with
@fig-$1 .
/* --------------------- minipages figures - be careful --------------------- */
\\begin\{figure\}\[.*?\]
\s+?\\begin\{minipage\}(\[.*?\])?.*
\s+?\\centering
\s+?\\includegraphics.*?\{(.*?)\}
\s+?\\caption.*?\{(.*?)\}
\s+?\\label.*?\{(.*?)\}.*?
\s+?\\end\{minipage\}.*?
\s+?\\hfill
\s+?\\begin\{minipage\}(\[.*?\])?.*
\s+?\\centering
\s+?\\includegraphics.*?\{(.*?)\}
\s+?\\caption.*?\{(.*?)\}
\s+?\\label.*?\{(.*?)\}.*?
\s+?\\end\{minipage\}.*?
(\s+)?\\end\{figure\}
replace with:
::: {layout-ncol=2}
![$3](../../$2){#fig-$4}
![$7](../../$6){#fig-$8}
:::
/* ------------------------------- subfigures ------------------------------- */
(\s+)?\\begin\{subfigure\}.*?
((\s+)?\\centering)?.*?
((\s+)?\\caption)\{(.*)\}.*?
\s+\\includegraphics.*?
\s+\{2_Figures/(.*?)\}
\s+\\label\{(.*?)\}.*?
\s+\\end\{subfigure\}
replace with:
\n![$6](../../3_Figs_Pyth/$7){#fig-$8}\n
next part:
\s+\\smallskip
\s+\\centering
\s+\\begin\{subfigure\}.*?
\s+\\caption\{(.*?)\}.*?
\s+\\includegraphics.*?\{2_Figures(.*?)\}
\s+\\label\{(.*?)\}.*?
\s+\\end\{subfigure\}.*?
\s+\\vspace\{.*?\}.*?
\s+\\caption\{(.)
/* ------------------------------- six figures ------------------------------ */
(\s+)?\\begin\{subfigure\}.*?
((\s+)?\\centering)?.*?
((\s+)?\\caption)\{(.*)\}.*?
\s+\\includegraphics.*?
\s+\{2_Figures/(.*?)\}
\s+\\end\{subfigure\}
replace:
\n![$6](../../3_Figs_Pyth/$7)\n
/* ------------------------------- subfigure_2 ------------------------------ */
(\s+)?\\begin\{subfigure\}.*?
((\s+)?\\centering)?.*?
((\s+)?\\caption)\{(.*)\}.*?
\s+\\includegraphics.*?\{2_Figures/(.*?)\}.*
.*?
\s+\\label\{(.*?)\}.*?
\s+\\end\{subfigure\}
replace with:
\n![$6](../../3_Figs_Pyth/$7){#fig-$8}\n
/* ------------------------------- subfigure_3 ------------------------------ */
(\s+)?\\begin\{subfigure\}.*?
((\s+)?\\centering)?.*?
((\s+)?\\caption)\{(.*)\}.*?
\s+\\includegraphics.*?\{2_Figures/(.*?)\}.*
.*?
\s+\\end\{subfigure\}
replace with:
\n![$6](../../3_Figs_Pyth/$7)\n