From d399556ddf48e6447e6019d8d5158864ad105f98 Mon Sep 17 00:00:00 2001 From: zaikoslorandaf Date: Wed, 11 Sep 2024 02:22:37 -0400 Subject: packages in folder not working with overleaf --- document.sty | 51 +++++++++++++++++++++++++++---- french.sty | 28 +++++++++++++++++ main.tex | 96 ++++++++++++++++++++--------------------------------------- something.tex | 57 +++++++++++++++++++++++++++++++++++ toolbox.sty | 33 ++++++++++++++++++++ 5 files changed, 195 insertions(+), 70 deletions(-) create mode 100644 french.sty create mode 100644 something.tex create mode 100644 toolbox.sty diff --git a/document.sty b/document.sty index f4ea5c2..ffc8c7c 100644 --- a/document.sty +++ b/document.sty @@ -1,6 +1,5 @@ \ProvidesPackage{document} - %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% % Packages % %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% @@ -16,21 +15,37 @@ \RequirePackage{pdfpages} % Allow to add pdf documents to your latex file \RequirePackage{hyperref} % Allow references and hyperlinks +% Useful packages for engineering students +\RequirePackage{amsmath} % Mathematics environments +\RequirePackage{amssymb} % Mathematical symbols +\RequirePackage{siunitx} % SI Units +\RequirePackage{cleveref} % To make eqation reference better + % Allows the creations of appendices \RequirePackage[title,toc,titletoc,page]{appendix} + %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% -% Headers/Footers % +% Equations/Math % %~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% +% Number equation with section number (ex: First equation in section 3 is 3.1) +\numberwithin{equation}{section} +% Use french commas when writing numbers +\sisetup{locale=FR} -%\let\oldhref\href -%\renewcommand{\href}[2]{\oldhref{#1}{\bfseries#2}} + +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% +% Hyperlinks management % +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% + +\let\oldhref\href +\renewcommand{\href}[2]{\oldhref{#1}{\bfseries#2}} \hypersetup{ colorlinks=true, - linkcolor=cyan, - filecolor=magenta, + linkcolor=black, + filecolor=black, urlcolor=gray, pdfpagemode=FullScreen, } @@ -78,3 +93,27 @@ \renewcommand{\thefigure}{\thesection-\arabic{figure}} \renewcommand{\thetable}{\thesection-\arabic{table}} +\usepackage{csquotes} +\usepackage[style=numeric,backend=biber,sorting=nty]{biblatex} +\DeclareNameAlias{author}{family-given} % Display the Bibliography as: Surename, Name +\addbibresource{references.bib} + + +% Caption +\usepackage{capt-of} + +% Page layout +%\pagestyle{fancy} +\lhead{\suni\hseparator\studyprogram} +\rhead{\doctitle} + + +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% +% Appendix % +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% +\RequirePackage[title,toc,titletoc,page]{appendix} + +\addto\captionsfrench{% + \renewcommand\appendixname{Annexe} + \renewcommand\appendixpagename{Annexe} +} diff --git a/french.sty b/french.sty new file mode 100644 index 0000000..9e67a50 --- /dev/null +++ b/french.sty @@ -0,0 +1,28 @@ +\ProvidesPackage{french} +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% +% Packages % +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% + +\RequirePackage[utf8]{inputenc} % Sensible text encoding +\RequirePackage[T1]{fontenc} % French compatibility +\RequirePackage[french]{babel} % French document environment +\RequirePackage[french]{cleveref} % To make eqation reference better + + + + +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% +% French Table Naming % +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% +% Sets the "Table - xx" to "Tableau - xx" +\renewcommand{\frenchtablename}{Tableau} +\renewcommand{\thetable}{\thesection-\arabic{table}} + +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% +% French Table Naming % +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% +% Sets "Appendix" to "Annexe" +\addto\captionsfrench{ + \renewcommand\appendixname{Annexe} + \renewcommand\appendixpagename{Annexe} +} diff --git a/main.tex b/main.tex index 52256df..b7b052a 100644 --- a/main.tex +++ b/main.tex @@ -6,43 +6,58 @@ \usepackage[french]{babel} % Optional packages and tools (Uncomment to your needs) -\usepackage{tools/bibliography} -\usepackage{tools/toolbox} -\usepackage{tools/engineering} -\usepackage{tools/french} +\usepackage{toolbox} +\usepackage{french} + +% Image insertion template: +% +% \begin{figure}[t!] +% \centering +% \includegraphics[width=0.45\textwidth]{/path/to/image.jpg} +% \caption{Caption Text} +% \label{fig: A Relateble Name} +% \end{figure} + % To add a bibliography, first make sure that your file % is named "bibliography.bib" and then uncomment the % following line. - +% %\addbibresource{bibliography.bib} % Uncomment to compile links and references... +% %\nofiles +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% +% Title Page Parameters % +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% \institution{Université de Sherbrooke} -\faculty{Faculté de...} -\department{Département de...} +\faculty{Faculté de ...} +\department{Département de ...} \title{Titre du document} \class{Nom du cour} \classnb{ABC123} \author{ \addtolength{\tabcolsep}{-0.4em} \begin{tabular}{rcl} % Ajouter des auteurs au besoin - Prénom Nom & -- & CIP \\ - Prénom2 Nom & - & CIP \\ + Prénom1 Nom & -- & CIP \\ + Prénom2 Nom & -- & CIP \\ \end{tabular} } \teacher{John Doe} \location{Sherbrooke} \date{\today} +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% +% Begin Document % +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% + \begin{document} \maketitle \newpage \tableofcontents -\newpage \section{This is the first section} This is some text... @@ -51,64 +66,17 @@ This is some text... This is some more text! -\section{Here are Some Exemples} - -\subsection{Making a Table} - -Tables are a scary subject to start with in latex. -This is mostly because their systax seems strange to an untrained eye. -Fortunately there are tools to make this step easier. -Consider visiting \href{https://www.tablesgenerator.com/} {tables generator}. - +\subsubsection{You probably guessed whthat this is a subsubsection} -Here is an exemple of a complex table directly copied from \href{https://www.tablesgenerator.com/} {tables generator}. -\\ -Note how the site advices the use of some packages in the commented section. -Good practice would want these packages added in the \textit{document.sty} file but they can also be added at the begining -of your \textit{main.tex} file. Adding these lines at a wrong location may result in a warning or your -document failing to compile. - - -% Please add the following required packages to your document preamble: -% \usepackage[table,xcdraw]{xcolor} -% Beamer presentation requires \usepackage{colortbl} instead of \usepackage[table,xcdraw]{xcolor} -% \usepackage[normalem]{ulem} -% \useunder{\uline}{\ul}{} \begin{table}[h!] -\begin{tabular}{ccc} -\multicolumn{3}{c}{A Not So Randomly Generated Title} \\ \hline -\multicolumn{1}{c|}{\textbf{Yeah}} & - \multicolumn{1}{c|}{\textbf{Yah}} & - \textbf{Yea} \\ \hline -\multicolumn{1}{c|}{{\color[HTML]{656565} \textit{Lawful Good}}} & - \multicolumn{1}{c|}{{\color[HTML]{656565} \textit{Neutral Good}}} & - {\color[HTML]{656565} \textit{Chaotic Good}} \\ \hline -\multicolumn{1}{c|}{\textbf{Yes}} & - \multicolumn{1}{c|}{\textbf{Ya}} & - \textbf{Yeet} \\ \hline -\multicolumn{1}{c|}{{\color[HTML]{656565} \textit{Lawful Neutral}}} & - \multicolumn{1}{c|}{{\color[HTML]{656565} \textit{True Neutral}}} & - {\color[HTML]{656565} \textit{Chaotic Neutral}} \\ \hline -\multicolumn{1}{c|}{\textbf{Yep}} & - \multicolumn{1}{c|}{\textbf{Ye}} & - \textbf{Yuh} \\ \hline -\multicolumn{1}{c|}{{\color[HTML]{656565} \textit{Lawful Evil}}} & - \multicolumn{1}{c|}{{\color[HTML]{656565} \textit{Neutral Evil}}} & - {\color[HTML]{656565} \textit{Chaotic Evil}} -\end{tabular} + \begin{tabular}{c c c} + \hline + item 1 & item 2 & item 3 \\ \hline \hline + item 1 & item 2 & item 3 \\ + item 1 & item 2 & item 3 \\ + \end{tabular} \end{table} - -% How to insert an image: - -% \begin{figure}[t!] -% \centering -% \includegraphics[width=0.45\textwidth]{/path/to/image.jpg} -% \caption{Caption Text} -% \label{fig: A Relateble Name} -% \end{figure} - - % \newpage % \printbibliography[heading=bibintoc] \end{document} diff --git a/something.tex b/something.tex new file mode 100644 index 0000000..1628bdc --- /dev/null +++ b/something.tex @@ -0,0 +1,57 @@ + +\subsection{Making a Table} + +Tables are a scary subject to start with in latex. +This is mostly because their systax seems strange to an untrained eye. +Fortunately there are tools to make this step easier. +Consider visiting \href{https://www.tablesgenerator.com/} {tables generator}. + +You will find a breakdown of the syntax below. + + +Here is an exemple of a complex table directly copied from \href{https://www.tablesgenerator.com/} {tables generator}. +\\ +Note how the site advices the use of some packages in the commented section. +Good practice would want these packages added in the \textit{document.sty} file but they can also be added at the begining +of your \textit{main.tex} file. Adding these lines at a wrong location may result in a warning or your +document failing to compile. + + +% Please add the following required packages to your document preamble: +% \usepackage[table,xcdraw]{xcolor} +% Beamer presentation requires \usepackage{colortbl} instead of \usepackage[table,xcdraw]{xcolor} +% \usepackage[normalem]{ulem} +% \useunder{\uline}{\ul}{} +\begin{table}[h!] +\begin{tabular}{ccc} +\multicolumn{3}{c}{A Not So Randomly Generated Title} \\ \hline +\multicolumn{1}{c|}{\textbf{Yeah}} & + \multicolumn{1}{c|}{\textbf{Yah}} & + \textbf{Yea} \\ \hline +\multicolumn{1}{c|}{{\color[HTML]{656565} \textit{Lawful Good}}} & + \multicolumn{1}{c|}{{\color[HTML]{656565} \textit{Neutral Good}}} & + {\color[HTML]{656565} \textit{Chaotic Good}} \\ \hline +\multicolumn{1}{c|}{\textbf{Yes}} & + \multicolumn{1}{c|}{\textbf{Ya}} & + \textbf{Yeet} \\ \hline +\multicolumn{1}{c|}{{\color[HTML]{656565} \textit{Lawful Neutral}}} & + \multicolumn{1}{c|}{{\color[HTML]{656565} \textit{True Neutral}}} & + {\color[HTML]{656565} \textit{Chaotic Neutral}} \\ \hline +\multicolumn{1}{c|}{\textbf{Yep}} & + \multicolumn{1}{c|}{\textbf{Ye}} & + \textbf{Yuh} \\ \hline +\multicolumn{1}{c|}{{\color[HTML]{656565} \textit{Lawful Evil}}} & + \multicolumn{1}{c|}{{\color[HTML]{656565} \textit{Neutral Evil}}} & + {\color[HTML]{656565} \textit{Chaotic Evil}} +\end{tabular} +\end{table} + + +Here is a simpler table made by hand: +\begin{table}[h!] + \begin{tabular}{c|c|c} + item 1 & item 2 & item 3 \\ \hline + item 1 & item 2 & item 3 \\ \hline + item 1 & item 2 & item 3 + \end{tabular} +\end{table} diff --git a/toolbox.sty b/toolbox.sty new file mode 100644 index 0000000..9231c82 --- /dev/null +++ b/toolbox.sty @@ -0,0 +1,33 @@ + +\ProvidesPackage{toolbox} +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% +% Required Packages for the Module % +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% +\RequirePackage{xcolor} % Addition of colors and color boxes + +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% +% Useful Functions for Team Work % +%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~% +% The following should NEVER apprear in a final document. +% +% Their goal is to provide a better team work experience by adding +% colorful/highlighted keywords into the pdfdocument. + + +%% Usage (These function require a user input) +% \todo{Something to be done...} +% \note{A note to communicate to your team} +% \fixme{An error you wish to higlight for later fix} + +\newcommand{\todo}[1]{\colorbox{red}{\textbf{TODO}:}#1} +\newcommand{\note}[1]{\colorbox{orange}{\textbf{NOTE}:}#1} +\newcommand{\fixme}[1]{\colorbox{purple}{\textbf{FIXME}:}#1} + +%% Usage (These function DON'T require a user input) +% \addref --> Displays "addref" highlighted in magenta +% \addcite --> Displays "addcite" highlighted in magenta +% \addimg --> Displays "addimg" highlighted in cyan +\newcommand{\addref}{\colorbox{magenta}{add ref}} +\newcommand{\addcite}{\colorbox{magenta}{add citation}} +\newcommand{\addimg}{\colorbox{cyan}{add image!}} + -- cgit v1.2.3