Skip to content

Commit c9f7baf

Browse files
committed
Updates from Overleaf
1 parent dcddcd6 commit c9f7baf

File tree

4 files changed

+73
-18
lines changed

4 files changed

+73
-18
lines changed

delft-hyperloop.cls

Lines changed: 61 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
\NeedsTeXFormat{LaTeX2e}
22
\newcommand\@classname{delft-hyperloop}
3-
\newcommand\@classversion{2024/11/29}
3+
\newcommand\@classversion{2024/12/02}
44
\ProvidesClass{\@classname}[\@classversion\ Delft Hyperloop Document]
55
\newcommand\@templatelink{https://www.overleaf.com/read/xkdvnhndtwwg\#fadb5a}
66

7-
\newcommand\@baseclass{article}
7+
\newcommand\@baseclass{report}
88
\newcommand\@final{false}
99
\newcommand\iffinalelse[2]{#2}
1010

@@ -80,7 +80,7 @@
8080

8181
% TikZ
8282
\RequirePackage{tikz}
83-
\usetikzlibrary{positioning}
83+
\usetikzlibrary{arrows.meta,decorations.pathmorphing,backgrounds,positioning,fit,petri,intersections}
8484
% \usetikzlibrary{external}
8585

8686
% Pgfplots
@@ -291,13 +291,15 @@
291291
}}}
292292
}
293293

294+
\newcommand\@usefulsnippetslinks{\hyperref[chapter:useful-snippets]{\color{HyperloopGreen} Useful snippets} (and \hyperref[chapter:useful-snippets-tikz]{\textbf{\color{HyperloopGreen} TikZ}})}
295+
294296
\newcommand\@onesidedpagestyles{
295297
\fancypagestyle{ournormal}{
296298
%... then configure it.
297299
\fancyhead{} % clear all header fields
298300
\fancyhead[C]{\textbf{\@title}}
299301
\fancyfoot{} % clear all footer fields
300-
\fancyfoot[L]{\ifnotfinal{\hyperref[chapter:useful-snippets]{\color{HyperloopGreen} Go to useful snippets}}}
302+
\fancyfoot[L]{\ifnotfinal{\@usefulsnippetslinks}}
301303
\fancyfoot[R]{\@pageidx}
302304
\fancyfoot[C]{\@companyandgen}
303305
\renewcommand\footrulewidth{0.4pt}% Line at the footer visible
@@ -311,7 +313,7 @@
311313
\fancyhf{}%
312314
\fancyfoot[R]{\@pageidx}
313315
\fancyfoot[C]{\@companyandgen}
314-
\fancyfoot[L]{\ifnotfinal{\hyperref[chapter:useful-snippets]{\color{HyperloopGreen} Go to useful snippets}}}
316+
\fancyfoot[L]{\ifnotfinal{\@usefulsnippetslinks}}
315317
\renewcommand\headrulewidth{0pt}% Line at the header invisible
316318
\renewcommand\footrulewidth{0.4pt}% Line at the footer visible
317319
}
@@ -324,7 +326,7 @@
324326
\fancyfoot{} % clear all footer fields
325327
\fancyfoot[LE,RO]{\@pageidx}
326328
\fancyfoot[C]{\@companyandgen}
327-
\fancyfoot[LO,RE]{\ifnotfinal{\hyperref[chapter:useful-snippets]{\color{HyperloopGreen} Go to useful snippets}}}
329+
\fancyfoot[LO,RE]{\ifnotfinal{\@usefulsnippetslinks}}
328330
\renewcommand\footrulewidth{0.4pt}% Line at the footer visible
329331

330332
\fancyhead[LE]{\nouppercase{\rightmark\hfill\leftmark}}
@@ -337,7 +339,7 @@
337339
\fancyhf{}%
338340
\fancyfoot[LE,RO]{\@pageidx}
339341
\fancyfoot[C]{\@companyandgen}
340-
\fancyfoot[LO,RE]{\ifnotfinal{\hyperref[chapter:useful-snippets]{\color{HyperloopGreen} Go to useful snippets}}}
342+
\fancyfoot[LO,RE]{\ifnotfinal{\@usefulsnippetslinks}}
341343
\renewcommand\headrulewidth{0pt}% Line at the header invisible
342344
\renewcommand\footrulewidth{0.4pt}% Line at the footer visible
343345
}
@@ -531,11 +533,40 @@
531533
\input{rsc/how-to-template}
532534

533535
\chapter*{Useful snippets} \label{chapter:useful-snippets}
534-
\addcontentsline{toc-useful-snippets}{chapter}{Useful snippets}
536+
\addcontentsline{toc-useful-snippets}{chapter}{Useful general \LaTeX\ snippets}
535537
\@starttoc{toc-useful-snippets}
536538
\newpage
537539

538540
\@renderusefultemplates
541+
542+
\chapter*{Useful TikZ snippets} \label{chapter:useful-snippets-tikz}
543+
\addcontentsline{toc-useful-snippets}{chapter}{Useful TikZ snippets}
544+
% \addcontentsline{toc-useful-snippets-tikz}{chapter}{Useful TikZ snippets}
545+
546+
\@starttoc{toc-useful-snippets-tikz}
547+
548+
\section*{Introduction}
549+
\addcontentsline{toc-useful-snippets-tikz}{section}{Introduction}
550+
551+
Here you can find useful TikZ / Pgfplots snippets. TikZ is a \LaTeX\ package that can create graphical elements from \LaTeX\ code, and Pgfplots is a \LaTeX\ package based on TikZ that can automatically render plots from formulas alone. These snippets come from Overleaf's documentation on TikZ and Pgfplots. For explanations on what the options to those commands do, refer to those resources:
552+
553+
\textbf{For TikZ}:
554+
\begin{itemize}
555+
\item \url{https://www.overleaf.com/learn/latex/TikZ_package}
556+
\item \url{https://cremeronline.com/LaTeX/minimaltikz.pdf} for a small introduction to TikZ.
557+
\item \url{https://mirror.koddos.net/CTAN/graphics/pgf/base/doc/pgfmanual.pdf} for the in-depth manual on how to use TikZ / pgf.
558+
\item \url{https://ctan.org/pkg/tikz?lang=en} for the CTAN page of tikz.
559+
\end{itemize}
560+
561+
\textbf{For Pgfplots}:
562+
\begin{itemize}
563+
\item \url{https://www.overleaf.com/learn/latex/Pgfplots_package}
564+
\item \url{https://ftp.snt.utwente.nl/pub/software/tex/graphics/pgf/contrib/pgfplots/doc/pgfplots.pdf} for the in-depth manual on how to use Pgfplots.
565+
\item \url{https://ctan.org/pkg/pgfplots?lang=en} for the CTAN page of pgfplots.
566+
\end{itemize}
567+
568+
\newpage
569+
539570
\@renderusefultemplatestikz
540571
\vfill
541572
\begin{center}
@@ -554,15 +585,35 @@
554585
\input{#1}
555586
}
556587

557-
\newcommand\@codeandoutputtikz[4]{%
558-
\def\tikzpage{\the\numexpr#4+1\relax}
588+
\newcommand\@codeandoutputtikzrender[4]{
589+
\begin{listing}[!ht]
590+
\inputminted{tex}{#1.tex}
591+
\caption{#3}
592+
\label{listing:#2}
593+
\end{listing}
594+
595+
% \begin{figure}[tph!]
596+
% \centering
597+
\input{#1}
598+
% \caption{#4}
599+
% \label{fig:#2}
600+
% \end{figure}
601+
}
602+
603+
\newcommand\@codeandoutputtikz[5]{%
604+
\def\tikzpage{\the\numexpr#5+1\relax}
559605
\begin{listing}[!ht]
560606
\inputminted{tex}{#1.tex}
561607
\caption{#3}
562608
\label{listing:#2}
563609
\end{listing}
564610

611+
% \begin{figure}[tph]
612+
% \centering
565613
\includegraphics[page=\tikzpage, clip]{rsc/useful-templates-tikz.pdf}
614+
% \caption{#4}
615+
% \label{fig:#2}
616+
% \end{figure}
566617
}
567618

568619
\input{rsc/useful-templates}

meta.tex

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
%
3838
%\author{...}
3939
%
40-
% Or if it's the entire team, you could use, which changes the structure of the title page a little bit.
40+
% Or if it's the entire team, you could use this, which changes the structure of the top of the title page a little bit.
4141
\makeauthorsentireteam
4242

4343

@@ -67,8 +67,3 @@
6767
\abstract{Describe the essence of this paper / report in a couple of words. What can your readers expect to learn by reading this?}
6868
%
6969
% To remove the abstract, comment the line above.
70-
71-
72-
% =====================================
73-
% ========= Glossaries setup ==========
74-
% =====================================

rsc/changelog.tex

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
\chapter*{Template Changelog}
22

3+
\section*{2nd Dec 2024} \label{sec:changelog:2024/12/02}
4+
\begin{itemize}
5+
\item Changed default base class in the template itself to report.
6+
\item Made useful tikz snippets a separate chapter and added a short introduction with links to articles / documentation where people can learn more about them.
7+
\item Added a separate TOC for TikZ snippets at the beginning of the chapter, and linked it at the bottom of every page.
8+
\end{itemize}
9+
310
\section*{29th Nov 2024} \label{sec:changelog:2024/11/29}
411
\begin{itemize}
512
\item Used externalized TikZ figures for the TikZ / Pgfplots useful templates, so that the document renders much faster (with also the option to render everything manually, if we change any of the templates for example).

rsc/useful-templates-tikz.tex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
\newpage
1111
\section*{\@nameuse{usefultemplatetikztitle\therenderusefultemplatestikzcnt}}
1212
\addcontentsline{toc-useful-snippets}{section}{\@nameuse{usefultemplatetikztitle\therenderusefultemplatestikzcnt}}
13-
\@codeandoutput{__useful_templates_tikz-\therenderusefultemplatestikzcnt}{useful-snippets-tikz-\therenderusefultemplatestikzcnt}{Code listing for \@nameuse{usefultemplatetikztitle\therenderusefultemplatestikzcnt}}
13+
\addcontentsline{toc-useful-snippets-tikz}{section}{\@nameuse{usefultemplatetikztitle\therenderusefultemplatestikzcnt}}
14+
\@codeandoutputtikzrender{__useful_templates_tikz-\therenderusefultemplatestikzcnt}{useful-snippets-tikz-\therenderusefultemplatestikzcnt}{Code listing for \@nameuse{usefultemplatetikztitle\therenderusefultemplatestikzcnt}}{Output figure of \@nameuse{usefultemplatetikztitle\therenderusefultemplatestikzcnt}}
1415
\stepcounter{renderusefultemplatestikzcnt}
1516
}
1617
}
@@ -20,7 +21,8 @@
2021
\newpage
2122
\section*{\@nameuse{usefultemplatetikztitle\therenderusefultemplatestikzcnt}}
2223
\addcontentsline{toc-useful-snippets}{section}{\@nameuse{usefultemplatetikztitle\therenderusefultemplatestikzcnt}}
23-
\@codeandoutputtikz{__useful_templates_tikz-\therenderusefultemplatestikzcnt}{useful-snippets-tikz-\therenderusefultemplatestikzcnt}{Code listing for \@nameuse{usefultemplatetikztitle\therenderusefultemplatestikzcnt}}{\therenderusefultemplatestikzcnt}
24+
\addcontentsline{toc-useful-snippets-tikz}{section}{\@nameuse{usefultemplatetikztitle\therenderusefultemplatestikzcnt}}
25+
\@codeandoutputtikz{__useful_templates_tikz-\therenderusefultemplatestikzcnt}{useful-snippets-tikz-\therenderusefultemplatestikzcnt}{Code listing for \@nameuse{usefultemplatetikztitle\therenderusefultemplatestikzcnt}}{Output figure of \@nameuse{usefultemplatetikztitle\therenderusefultemplatestikzcnt}}{\therenderusefultemplatestikzcnt}
2426
\stepcounter{renderusefultemplatestikzcnt}
2527
}
2628
}

0 commit comments

Comments
 (0)