|
1 | 1 | \NeedsTeXFormat{LaTeX2e} |
2 | 2 | \newcommand\@classname{delft-hyperloop} |
3 | | -\newcommand\@classversion{2024/11/29} |
| 3 | +\newcommand\@classversion{2024/12/02} |
4 | 4 | \ProvidesClass{\@classname}[\@classversion\ Delft Hyperloop Document] |
5 | 5 | \newcommand\@templatelink{https://www.overleaf.com/read/xkdvnhndtwwg\#fadb5a} |
6 | 6 |
|
7 | | -\newcommand\@baseclass{article} |
| 7 | +\newcommand\@baseclass{report} |
8 | 8 | \newcommand\@final{false} |
9 | 9 | \newcommand\iffinalelse[2]{#2} |
10 | 10 |
|
|
80 | 80 |
|
81 | 81 | % TikZ |
82 | 82 | \RequirePackage{tikz} |
83 | | -\usetikzlibrary{positioning} |
| 83 | +\usetikzlibrary{arrows.meta,decorations.pathmorphing,backgrounds,positioning,fit,petri,intersections} |
84 | 84 | % \usetikzlibrary{external} |
85 | 85 |
|
86 | 86 | % Pgfplots |
|
291 | 291 | }}} |
292 | 292 | } |
293 | 293 |
|
| 294 | +\newcommand\@usefulsnippetslinks{\hyperref[chapter:useful-snippets]{\color{HyperloopGreen} Useful snippets} (and \hyperref[chapter:useful-snippets-tikz]{\textbf{\color{HyperloopGreen} TikZ}})} |
| 295 | + |
294 | 296 | \newcommand\@onesidedpagestyles{ |
295 | 297 | \fancypagestyle{ournormal}{ |
296 | 298 | %... then configure it. |
297 | 299 | \fancyhead{} % clear all header fields |
298 | 300 | \fancyhead[C]{\textbf{\@title}} |
299 | 301 | \fancyfoot{} % clear all footer fields |
300 | | - \fancyfoot[L]{\ifnotfinal{\hyperref[chapter:useful-snippets]{\color{HyperloopGreen} Go to useful snippets}}} |
| 302 | + \fancyfoot[L]{\ifnotfinal{\@usefulsnippetslinks}} |
301 | 303 | \fancyfoot[R]{\@pageidx} |
302 | 304 | \fancyfoot[C]{\@companyandgen} |
303 | 305 | \renewcommand\footrulewidth{0.4pt}% Line at the footer visible |
|
311 | 313 | \fancyhf{}% |
312 | 314 | \fancyfoot[R]{\@pageidx} |
313 | 315 | \fancyfoot[C]{\@companyandgen} |
314 | | - \fancyfoot[L]{\ifnotfinal{\hyperref[chapter:useful-snippets]{\color{HyperloopGreen} Go to useful snippets}}} |
| 316 | + \fancyfoot[L]{\ifnotfinal{\@usefulsnippetslinks}} |
315 | 317 | \renewcommand\headrulewidth{0pt}% Line at the header invisible |
316 | 318 | \renewcommand\footrulewidth{0.4pt}% Line at the footer visible |
317 | 319 | } |
|
324 | 326 | \fancyfoot{} % clear all footer fields |
325 | 327 | \fancyfoot[LE,RO]{\@pageidx} |
326 | 328 | \fancyfoot[C]{\@companyandgen} |
327 | | - \fancyfoot[LO,RE]{\ifnotfinal{\hyperref[chapter:useful-snippets]{\color{HyperloopGreen} Go to useful snippets}}} |
| 329 | + \fancyfoot[LO,RE]{\ifnotfinal{\@usefulsnippetslinks}} |
328 | 330 | \renewcommand\footrulewidth{0.4pt}% Line at the footer visible |
329 | 331 |
|
330 | 332 | \fancyhead[LE]{\nouppercase{\rightmark\hfill\leftmark}} |
|
337 | 339 | \fancyhf{}% |
338 | 340 | \fancyfoot[LE,RO]{\@pageidx} |
339 | 341 | \fancyfoot[C]{\@companyandgen} |
340 | | - \fancyfoot[LO,RE]{\ifnotfinal{\hyperref[chapter:useful-snippets]{\color{HyperloopGreen} Go to useful snippets}}} |
| 342 | + \fancyfoot[LO,RE]{\ifnotfinal{\@usefulsnippetslinks}} |
341 | 343 | \renewcommand\headrulewidth{0pt}% Line at the header invisible |
342 | 344 | \renewcommand\footrulewidth{0.4pt}% Line at the footer visible |
343 | 345 | } |
|
531 | 533 | \input{rsc/how-to-template} |
532 | 534 |
|
533 | 535 | \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} |
535 | 537 | \@starttoc{toc-useful-snippets} |
536 | 538 | \newpage |
537 | 539 |
|
538 | 540 | \@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 | + |
539 | 570 | \@renderusefultemplatestikz |
540 | 571 | \vfill |
541 | 572 | \begin{center} |
|
554 | 585 | \input{#1} |
555 | 586 | } |
556 | 587 |
|
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} |
559 | 605 | \begin{listing}[!ht] |
560 | 606 | \inputminted{tex}{#1.tex} |
561 | 607 | \caption{#3} |
562 | 608 | \label{listing:#2} |
563 | 609 | \end{listing} |
564 | 610 |
|
| 611 | + % \begin{figure}[tph] |
| 612 | + % \centering |
565 | 613 | \includegraphics[page=\tikzpage, clip]{rsc/useful-templates-tikz.pdf} |
| 614 | + % \caption{#4} |
| 615 | + % \label{fig:#2} |
| 616 | + % \end{figure} |
566 | 617 | } |
567 | 618 |
|
568 | 619 | \input{rsc/useful-templates} |
|
0 commit comments