Skip to content

Commit

Permalink
added boxed formulas
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiomtzlosa committed Jan 14, 2022
1 parent e00a473 commit b19e1e2
Show file tree
Hide file tree
Showing 39 changed files with 343 additions and 21 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

\KittelEquationExpandedX

\KittelEquationExpandedXBoxed

\KittelEquationExpandedXBoxedSimple

\section{Section here}
\label{sec:section-here}

Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
\formatfalse
\contentsline {addequations}{\numberline {2.1}Theoretical Kittel equation expanded for a Permalloy thin-film for X-axe}{3}{eqfigure.caption.11}%
\contentsline {addequations}{\numberline {2.2}Theoretical Kittel equation expanded for a Permalloy thin-film for X-axe}{3}{eqfigure.caption.13}%
\contentsline {addequations}{\numberline {2.3}Theoretical Kittel equation expanded for a Permalloy thin-film for X-axe}{3}{eqfigure.caption.15}%
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
\formatfalse
~\hfill \textbf {Page}\par \thispagestyle {phdfancyempty}\vspace {0.4cm}
\contentsline {figure}{\numberline {2.1}{\ignorespaces Prism drawing\relax }}{2}{figure.caption.9}%
\contentsline {figure}{\numberline {2.2}{\ignorespaces Disc sample figure\relax }}{3}{figure.caption.13}%
\contentsline {figure}{\numberline {2.3}{\ignorespaces Set of two images\relax }}{4}{figure.caption.17}%
\contentsline {figure}{\numberline {2.2}{\ignorespaces Disc sample figure\relax }}{3}{figure.caption.17}%
\contentsline {figure}{\numberline {2.3}{\ignorespaces Set of two images\relax }}{4}{figure.caption.21}%
\contentsline {subfigure}{\numberline {(a)}{\ignorespaces {Image 1}}}{4}{subfigure.3.1}%
\contentsline {subfigure}{\numberline {(b)}{\ignorespaces {Image 2}}}{4}{subfigure.3.2}%
\contentsline {figure}{\numberline {2.4}{\ignorespaces This is a single image\relax }}{4}{figure.caption.18}%
\contentsline {figure}{\numberline {2.5}{\ignorespaces \nocitecaptionlink {Set of two images, this reference\citep {Josephson2012} will show up in this caption but it will hide in List Of Figures}}}{5}{figure.caption.19}%
\contentsline {figure}{\numberline {2.4}{\ignorespaces This is a single image\relax }}{4}{figure.caption.22}%
\contentsline {figure}{\numberline {2.5}{\ignorespaces \nocitecaptionlink {Set of two images, this reference\citep {Josephson2012} will show up in this caption but it will hide in List Of Figures}}}{5}{figure.caption.23}%
\contentsline {subfigure}{\numberline {(a)}{\ignorespaces {Image 1}}}{5}{subfigure.5.1}%
\contentsline {subfigure}{\numberline {(b)}{\ignorespaces {Image 2}}}{5}{subfigure.5.2}%
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\babel@toc {english}{}
\formatfalse
~\hfill \textbf {Page}\par \thispagestyle {phdfancyempty}\vspace {0.4cm}
\contentsline {table}{\numberline {2.1}{\ignorespaces Sample table\relax }}{3}{table.caption.12}%
\contentsline {table}{\numberline {2.2}{\ignorespaces Table with complex cells\relax }}{3}{table.caption.14}%
\contentsline {table}{\numberline {2.3}{\ignorespaces Complex table 2\relax }}{4}{table.caption.15}%
\contentsline {table}{\numberline {2.1}{\ignorespaces Sample table\relax }}{3}{table.caption.16}%
\contentsline {table}{\numberline {2.2}{\ignorespaces Table with complex cells\relax }}{3}{table.caption.18}%
\contentsline {table}{\numberline {2.3}{\ignorespaces Complex table 2\relax }}{4}{table.caption.19}%
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,26 @@
\small{\[\textit{f} = 28\cdot\sqrt{(B_{DC}+(N_y-N_x)\cdot0.86\cdot10^6\cdot4\pi\cdot10^{-7})\cdot(B_{DC}+(N_z-N_x)\cdot0.86\cdot10^6)\cdot4\pi\cdot10^{-7}}\]}
}{#2}{#1}
}

\newcommandtwoopt{\KittelEquationExpandedXBoxed}[2][Theoretical Kittel equation expanded for a Permalloy thin-film for X-axe][fig:kittel-x-box]{
\vspace{-0.5cm}
\setequationboxed{0cm}{0cm}{
\colorboxed{red}{11pt}{
\begin{aligned}
&f = 28\cdot\sqrt{(B_{DC}+(N_y-N_x)\cdot0.86\cdot10^6\cdot4\pi\cdot10^{-7})\cdot(B_{DC}+(N_z-N_x)\cdot0.86\cdot10^6)\cdot4\pi\cdot10^{-7}} \\
&\text{This line is a comment in boxed formula}
\end{aligned}
}
}{#2}{#1}{0.11cm}
\vspace{0.8cm}
}

\newcommandtwoopt{\KittelEquationExpandedXBoxedSimple}[2][Theoretical Kittel equation expanded for a Permalloy thin-film for X-axe][fig:kittel-x-box-simple]{
\vspace{-0.5cm}
\setequationboxed{0cm}{0cm}{
\colorboxed{red}{11pt}{
f = 28\cdot\sqrt{(B_{DC}+(N_y-N_x)\cdot0.86\cdot10^6\cdot4\pi\cdot10^{-7})\cdot(B_{DC}+(N_z-N_x)\cdot0.86\cdot10^6)\cdot4\pi\cdot10^{-7}}
}
}{#2}{#1}{0.11cm}
\vspace{0.8cm}
}
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,25 @@
\end{equ}
}

\newcommand{\setequationboxed}[6] {

\begin{equ}[H]
% https://tex.stackexchange.com/questions/316646/renaming-the-label-of-figure-just-in-some-cases
% \renewcommand{\figurename}{Equation}
\begin{changemargin}{#1}{#2}
\begin{eqfigure}[H]
#3
\vspace{#6}
\centercaptionequation{#5}
% \centercaptionformula{#5}
\label{#4}
\addequations{#5} % this is for equations listing
\end{eqfigure}
\end{changemargin}
\vspace{-1.5cm}
\end{equ}
}

\newcommand{\centerformula}[1]{
\vspace{-0.8cm}
\begin{align}
Expand Down Expand Up @@ -642,6 +661,39 @@
\DeclareRobustCommand\nocitecaptionlink[1]{{\def\citep##1{}#1}}
\newcommand\nocitecaption[1]{\caption[\nocitecaptionlink{#1}]{#1}}

%% Colour boxing equations

\makeatletter
\renewcommand{\boxed}[2][\fboxsep]{{%
\setlength{\fboxsep}{#1}\fbox{\m@th$\displaystyle#2$}}}
\makeatother

% https://tex.stackexchange.com/questions/326375/boxed-border-color
% Syntax: \colorboxed[<color model>]{<color specification>}{<math formula>}

\newcommand*{\colorboxed}{}
\def\colorboxed#1#{%
\colorboxedAux{#1}%
}

\newcommand{\colorboxedAux}[4]{%
% #1: optional argument for color model
% #3: color specification
% #4: formula
\begingroup
\colorlet{cb@saved}{.}%
\color#1{#2}%
\begin{center}
\boxed[#3]{%
\color{cb@saved}%
#4%
}%
\end{center}
\endgroup
}

%% END Colour boxing equations

%%% Affirmation
\input{utils/declaration}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

\KittelEquationExpandedX

\KittelEquationExpandedXBoxed

\KittelEquationExpandedXBoxedSimple

\section{Section here}
\label{sec:section-here}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,26 @@
\small{\[\textit{f} = 28\cdot\sqrt{(B_{DC}+(N_y-N_x)\cdot0.86\cdot10^6\cdot4\pi\cdot10^{-7})\cdot(B_{DC}+(N_z-N_x)\cdot0.86\cdot10^6)\cdot4\pi\cdot10^{-7}}\]}
}{#2}{#1}
}

\newcommandtwoopt{\KittelEquationExpandedXBoxed}[2][Theoretical Kittel equation expanded for a Permalloy thin-film for X-axe][fig:kittel-x-box]{
\vspace{-0.5cm}
\setequationboxed{0cm}{0cm}{
\colorboxed{red}{11pt}{
\begin{aligned}
&f = 28\cdot\sqrt{(B_{DC}+(N_y-N_x)\cdot0.86\cdot10^6\cdot4\pi\cdot10^{-7})\cdot(B_{DC}+(N_z-N_x)\cdot0.86\cdot10^6)\cdot4\pi\cdot10^{-7}} \\
&\text{This line is a comment in boxed formula}
\end{aligned}
}
}{#2}{#1}{0.11cm}
\vspace{0.8cm}
}

\newcommandtwoopt{\KittelEquationExpandedXBoxedSimple}[2][Theoretical Kittel equation expanded for a Permalloy thin-film for X-axe][fig:kittel-x-box-simple]{
\vspace{-0.5cm}
\setequationboxed{0cm}{0cm}{
\colorboxed{red}{11pt}{
f = 28\cdot\sqrt{(B_{DC}+(N_y-N_x)\cdot0.86\cdot10^6\cdot4\pi\cdot10^{-7})\cdot(B_{DC}+(N_z-N_x)\cdot0.86\cdot10^6)\cdot4\pi\cdot10^{-7}}
}
}{#2}{#1}{0.11cm}
\vspace{0.8cm}
}
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,25 @@
\end{equ}
}

\newcommand{\setequationboxed}[6] {

\begin{equ}[H]
% https://tex.stackexchange.com/questions/316646/renaming-the-label-of-figure-just-in-some-cases
% \renewcommand{\figurename}{Equation}
\begin{changemargin}{#1}{#2}
\begin{eqfigure}[H]
#3
\vspace{#6}
\centercaptionequation{#5}
% \centercaptionformula{#5}
\label{#4}
\addequations{#5} % this is for equations listing
\end{eqfigure}
\end{changemargin}
\vspace{-1.5cm}
\end{equ}
}

\newcommand{\centerformula}[1]{
\vspace{-0.8cm}
\begin{align}
Expand Down Expand Up @@ -642,6 +661,39 @@
\DeclareRobustCommand\nocitecaptionlink[1]{{\def\citep##1{}#1}}
\newcommand\nocitecaption[1]{\caption[\nocitecaptionlink{#1}]{#1}}

%% Colour boxing equations

\makeatletter
\renewcommand{\boxed}[2][\fboxsep]{{%
\setlength{\fboxsep}{#1}\fbox{\m@th$\displaystyle#2$}}}
\makeatother

% https://tex.stackexchange.com/questions/326375/boxed-border-color
% Syntax: \colorboxed[<color model>]{<color specification>}{<math formula>}

\newcommand*{\colorboxed}{}
\def\colorboxed#1#{%
\colorboxedAux{#1}%
}

\newcommand{\colorboxedAux}[4]{%
% #1: optional argument for color model
% #3: color specification
% #4: formula
\begingroup
\colorlet{cb@saved}{.}%
\color#1{#2}%
\begin{center}
\boxed[#3]{%
\color{cb@saved}%
#4%
}%
\end{center}
\endgroup
}

%% END Colour boxing equations

%%% Affirmation
\input{utils/declaration}

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

\KittelEquationExpandedX

\KittelEquationExpandedXBoxed

\KittelEquationExpandedXBoxedSimple

\section{Section here}
\label{sec:section-here}

Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
\formatfalse
\contentsline {addequations}{\numberline {2.1}Theoretical Kittel equation expanded for a Permalloy thin-film for X-axe}{3}{eqfigure.caption.11}%
\contentsline {addequations}{\numberline {2.2}Theoretical Kittel equation expanded for a Permalloy thin-film for X-axe}{3}{eqfigure.caption.13}%
\contentsline {addequations}{\numberline {2.3}Theoretical Kittel equation expanded for a Permalloy thin-film for X-axe}{3}{eqfigure.caption.15}%
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
\formatfalse
~\hfill \textbf {Page}\par \thispagestyle {phdfancyempty}\vspace {0.4cm}
\contentsline {figure}{\numberline {2.1}{\ignorespaces Prism drawing\relax }}{2}{figure.caption.9}%
\contentsline {figure}{\numberline {2.2}{\ignorespaces Disc sample figure\relax }}{3}{figure.caption.13}%
\contentsline {figure}{\numberline {2.3}{\ignorespaces Set of two images\relax }}{4}{figure.caption.17}%
\contentsline {figure}{\numberline {2.2}{\ignorespaces Disc sample figure\relax }}{3}{figure.caption.17}%
\contentsline {figure}{\numberline {2.3}{\ignorespaces Set of two images\relax }}{4}{figure.caption.21}%
\contentsline {subfigure}{\numberline {(a)}{\ignorespaces {Image 1}}}{4}{subfigure.3.1}%
\contentsline {subfigure}{\numberline {(b)}{\ignorespaces {Image 2}}}{4}{subfigure.3.2}%
\contentsline {figure}{\numberline {2.4}{\ignorespaces This is a single image\relax }}{4}{figure.caption.18}%
\contentsline {figure}{\numberline {2.5}{\ignorespaces \nocitecaptionlink {Set of two images, this reference\cite {Li2019} will show up in this caption but it will hide in List Of Figures}}}{5}{figure.caption.19}%
\contentsline {figure}{\numberline {2.4}{\ignorespaces This is a single image\relax }}{4}{figure.caption.22}%
\contentsline {figure}{\numberline {2.5}{\ignorespaces \nocitecaptionlink {Set of two images, this reference\cite {Li2019} will show up in this caption but it will hide in List Of Figures}}}{5}{figure.caption.23}%
\contentsline {subfigure}{\numberline {(a)}{\ignorespaces {Image 1}}}{5}{subfigure.5.1}%
\contentsline {subfigure}{\numberline {(b)}{\ignorespaces {Image 2}}}{5}{subfigure.5.2}%
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\babel@toc {english}{}
\formatfalse
~\hfill \textbf {Page}\par \thispagestyle {phdfancyempty}\vspace {0.4cm}
\contentsline {table}{\numberline {2.1}{\ignorespaces Sample table\relax }}{3}{table.caption.12}%
\contentsline {table}{\numberline {2.2}{\ignorespaces Table with complex cells\relax }}{3}{table.caption.14}%
\contentsline {table}{\numberline {2.3}{\ignorespaces Complex table 2\relax }}{4}{table.caption.15}%
\contentsline {table}{\numberline {2.1}{\ignorespaces Sample table\relax }}{3}{table.caption.16}%
\contentsline {table}{\numberline {2.2}{\ignorespaces Table with complex cells\relax }}{3}{table.caption.18}%
\contentsline {table}{\numberline {2.3}{\ignorespaces Complex table 2\relax }}{4}{table.caption.19}%
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,26 @@
\small{\[\textit{f} = 28\cdot\sqrt{(B_{DC}+(N_y-N_x)\cdot0.86\cdot10^6\cdot4\pi\cdot10^{-7})\cdot(B_{DC}+(N_z-N_x)\cdot0.86\cdot10^6)\cdot4\pi\cdot10^{-7}}\]}
}{#2}{#1}
}

\newcommandtwoopt{\KittelEquationExpandedXBoxed}[2][Theoretical Kittel equation expanded for a Permalloy thin-film for X-axe][fig:kittel-x-box]{
\vspace{-0.5cm}
\setequationboxed{0cm}{0cm}{
\colorboxed{red}{11pt}{
\begin{aligned}
&f = 28\cdot\sqrt{(B_{DC}+(N_y-N_x)\cdot0.86\cdot10^6\cdot4\pi\cdot10^{-7})\cdot(B_{DC}+(N_z-N_x)\cdot0.86\cdot10^6)\cdot4\pi\cdot10^{-7}} \\
&\text{This line is a comment in boxed formula}
\end{aligned}
}
}{#2}{#1}{0.11cm}
\vspace{0.8cm}
}

\newcommandtwoopt{\KittelEquationExpandedXBoxedSimple}[2][Theoretical Kittel equation expanded for a Permalloy thin-film for X-axe][fig:kittel-x-box-simple]{
\vspace{-0.5cm}
\setequationboxed{0cm}{0cm}{
\colorboxed{red}{11pt}{
f = 28\cdot\sqrt{(B_{DC}+(N_y-N_x)\cdot0.86\cdot10^6\cdot4\pi\cdot10^{-7})\cdot(B_{DC}+(N_z-N_x)\cdot0.86\cdot10^6)\cdot4\pi\cdot10^{-7}}
}
}{#2}{#1}{0.11cm}
\vspace{0.8cm}
}
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,25 @@
\end{equ}
}

\newcommand{\setequationboxed}[6] {

\begin{equ}[H]
% https://tex.stackexchange.com/questions/316646/renaming-the-label-of-figure-just-in-some-cases
% \renewcommand{\figurename}{Equation}
\begin{changemargin}{#1}{#2}
\begin{eqfigure}[H]
#3
\vspace{#6}
\centercaptionequation{#5}
% \centercaptionformula{#5}
\label{#4}
\addequations{#5} % this is for equations listing
\end{eqfigure}
\end{changemargin}
\vspace{-1.5cm}
\end{equ}
}

\newcommand{\centerformula}[1]{
\vspace{-0.8cm}
\begin{align}
Expand Down Expand Up @@ -659,6 +678,39 @@
\endgroup
\makeatother

%% Colour boxing equations

\makeatletter
\renewcommand{\boxed}[2][\fboxsep]{{%
\setlength{\fboxsep}{#1}\fbox{\m@th$\displaystyle#2$}}}
\makeatother

% https://tex.stackexchange.com/questions/326375/boxed-border-color
% Syntax: \colorboxed[<color model>]{<color specification>}{<math formula>}

\newcommand*{\colorboxed}{}
\def\colorboxed#1#{%
\colorboxedAux{#1}%
}

\newcommand{\colorboxedAux}[4]{%
% #1: optional argument for color model
% #3: color specification
% #4: formula
\begingroup
\colorlet{cb@saved}{.}%
\color#1{#2}%
\begin{center}
\boxed[#3]{%
\color{cb@saved}%
#4%
}%
\end{center}
\endgroup
}

%% END Colour boxing equations

%%% Affirmation
\input{utils/declaration}

Expand Down
Binary file modified book-cover/universal/book_cover.dvi
Binary file not shown.
Binary file modified book-cover/universal/book_cover.pdf
Binary file not shown.
Binary file modified book_cover.pdf
Binary file not shown.
4 changes: 4 additions & 0 deletions chapters/01_first_chapter.tex
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

\KittelEquationExpandedX

\KittelEquationExpandedXBoxed

\KittelEquationExpandedXBoxedSimple

\section{Section here}
\label{sec:section-here}

Expand Down
Binary file modified report-combine.pdf
Binary file not shown.
Binary file modified report-reduced.pdf
Binary file not shown.
2 changes: 2 additions & 0 deletions report.equ
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
\formatfalse
\contentsline {addequations}{\numberline {2.1}Theoretical Kittel equation expanded for a Permalloy thin-film for X-axe}{3}{eqfigure.caption.11}%
\contentsline {addequations}{\numberline {2.2}Theoretical Kittel equation expanded for a Permalloy thin-film for X-axe}{3}{eqfigure.caption.13}%
\contentsline {addequations}{\numberline {2.3}Theoretical Kittel equation expanded for a Permalloy thin-film for X-axe}{3}{eqfigure.caption.15}%
Loading

0 comments on commit b19e1e2

Please sign in to comment.