update project structure exercise

This commit is contained in:
Fradtschuk 2022-01-08 13:49:12 +01:00
parent eec4b468c2
commit d0ff1e467e
3 changed files with 54 additions and 64 deletions

View File

@ -126,7 +126,17 @@
}, },
postbreak=\mbox{{$\hookrightarrow$}\space}, postbreak=\mbox{{$\hookrightarrow$}\space},
emphstyle={\color{ForestGreen}\bfseries}, emphstyle={\color{ForestGreen}\bfseries},
commentstyle=\color{darkgray} commentstyle=\color{darkgray},
literate=
{Ö}{{\"O}}1
{Ä}{{\"A}}1
{Ü}{{\"U}}1
{ß}{{\ss}}2
{ü}{{\"u}}1
{ä}{{\"a}}1
{ö}{{\"o}}1
{é}{{\'e}}1
{}{\textellipsis}1
} }
\lstinputlisting{#2}% \lstinputlisting{#2}%
% %

View File

@ -1,21 +1,6 @@
\section{First section} \section{First section}
Jelly beans tiramisu chocolate bar chupa chups candy canes lollipop liquorice Jelly beans tiramisu chocolate bar chupa chups candy canes lollipop liquorice cheesecake tootsie roll. Marshmallow sugar plum cake tiramisu jelly cake bear claw. Croissant liquorice jelly lollipop carrot cake. Cheesecake danish chocolate halvah. Candy canes jujubes chupa chups jujubes candy canes tootsie roll toffee danish sesame snaps. Sugar plum gummi bears lollipop chocolate bar. Ice cream soufflé sweet lemon drops chocolate soufflé gingerbread cookie muffin.
cheesecake tootsie roll. Marshmallow sugar plum cake tiramisu jelly cake bear
claw. Croissant liquorice jelly lollipop carrot cake. Cheesecake danish
chocolate halvah. Candy canes jujubes chupa chups jujubes candy canes tootsie
roll toffee danish sesame snaps. Sugar plum gummi bears lollipop chocolate bar.
Ice cream soufflé sweet lemon drops chocolate soufflé gingerbread cookie muffin.
Sugar plum danish halvah jujubes pastry donut carrot cake dessert donut. Sweet Sugar plum danish halvah jujubes pastry donut carrot cake dessert donut. Sweet gingerbread gingerbread wafer gummi bears pastry. Tootsie roll donut powder cake. Brownie halvah lollipop gummi bears. Liquorice pie caramels jelly beans. Halvah danish brownie danish toffee cotton candy lemon drops.
gingerbread gingerbread wafer gummi bears pastry. Tootsie roll donut powder
cake. Brownie halvah lollipop gummi bears. Liquorice pie caramels jelly beans.
Halvah danish brownie danish toffee cotton candy lemon drops.
Donut jelly beans candy canes muffin lemon drops carrot cake sugar plum. Sesame Donut jelly beans candy canes muffin lemon drops carrot cake sugar plum. Sesame snaps pie bonbon cotton candy cookie caramels. Chupa chups dessert tootsie roll carrot cake candy cookie sweet roll jelly beans. Oat cake halvah gingerbread bonbon sweet sesame snaps dragée carrot cake. Bonbon pastry chupa chups. Chocolate cake macaroon jelly-o. Pastry pastry sugar plum jujubes lemon drops gummi bears sugar plum cheesecake fruitcake. Chocolate cake chocolate candy. Wafer carrot cake chocolate cake jujubes cupcake soufflé gingerbread chocolate cake donut.
snaps pie bonbon cotton candy cookie caramels. Chupa chups dessert tootsie roll
carrot cake candy cookie sweet roll jelly beans. Oat cake halvah gingerbread
bonbon sweet sesame snaps dragée carrot cake. Bonbon pastry chupa chups.
Chocolate cake macaroon jelly-o. Pastry pastry sugar plum jujubes lemon drops
gummi bears sugar plum cheesecake fruitcake. Chocolate cake chocolate candy.
Wafer carrot cake chocolate cake jujubes cupcake soufflé gingerbread chocolate
cake donut.

View File

@ -1,51 +1,46 @@
\begin{enumerate} \begin{enumerate}
\item \item First one
\textbf{Put the sections of the file into separate files, named
\file{section1.tex}, \file{section2.tex}, and
\file{section3.tex}.
Include them using the \code{latex}{\textbackslash include} command.}
\begin{figure}[H] \begin{figure}[H]
\inputminted[linenos=true]{latex}{exercises/project-structure/main-with-preamble.done.tex} \codeblock{latex}{exercises/project-structure/main-with-preamble.done.tex}
\caption{\mintinline{latex}{main.tex}} \caption{\file{main.tex}}
\end{figure} \end{figure}
\item Second one
\begin{figure}[H] \begin{figure}[H]
\inputminted[linenos=true,breaklines=true]{latex}{exercises/project-structure/section1.done.tex} \codeblock{latex}{exercises/project-structure/section1.done.tex}
\caption{\mintinline{latex}{section1.tex} (analogous for the other \caption{\file{section1.tex} (analogous for the other
sections)} sections)}
\end{figure} \end{figure}
\item \textbf{Which command becomes superfluous when you use \item \textbf{Which command becomes superfluous when you use
\code{latex}{\textbackslash include}?} \\ \code{latex}{\textbackslash include}?} \\
\code{latex}{\textbackslash include} makes every included file appear on a \code{latex}{\textbackslash include} makes every included file appear on a
new new page. Hence the command \code{latex}{\textbackslash newpage} becomes
page. Hence the command \code{latex}{\textbackslash newpage} becomes
superfluous. superfluous.
\item
\textbf{Can the preamble also be excluded? If no, why? If yes, when can \item \textbf{Can the preamble also be excluded? If no, why? If yes, when
outsourcing the preamble be useful?} \\ can outsourcing the preamble be useful?}
The preamble can also be outsourced, like in task 1. In real-world \LaTeX{}
projects we often make use of numerous packages that need to be configured The preamble can also be outsourced, like in task 1. In real-world
by additional commands within the preamble. Therefore, it is advisable to \LaTeX{} projects we often make use of numerous packages that need to be
outsource the preamble. On top of that, this is useful because the file configured by additional commands within the preamble. Therefore, it is
with the most-commonly used packages can be moved from one project to advisable to outsource the preamble. On top of that, this is useful
another without needing to rewrite the preamble every time. because the file with the most-commonly used packages can be moved from
one project to another without needing to rewrite the preamble every time.
\item \item
\textbf{Add the command \code{latex}{\textbackslash \textbf{Add the command \code{latex}{\textbackslash
includeonly\{section2\}} to the includeonly\{section2\}} to the preamble. Compile the document again, and
preamble. Compile the document again, and check what has changed. What does check what has changed. What does the command do and how can it be helpful
the command do and how can it be helpful in a larger project? } \\ in a larger project? }
The command \code{latex}{\textbackslash includeonly\{section2\}} does The command \code{latex}{\textbackslash includeonly\{section2\}} does
exactly what exactly what the name already says. During compilation, only the
the name already says. During compilation, only the \code{latex}{\textbackslash include} statements that contain file names
\code{latex}{\textbackslash include} that appear in \code{latex}{\textbackslash includeonly\{file1,file2, …\}}
statements that contain file names that appear in are included.
\code{latex}{\textbackslash includeonly\{file1,file2, …\}} are included.
This can be useful for larger projects, when the compile time becomes This can be useful for larger projects, when the compile time becomes
longer since by using the \code{latex}{\textbackslash includeonly} only the longer since by using the \code{latex}{\textbackslash includeonly} only the
files files can be included which we are currently working in. Before the final
can be included which we are currently working in. Before the final
compilation we can delete the \code{latex}{\textbackslash includeonly} compilation we can delete the \code{latex}{\textbackslash includeonly}
command and command and end up with our complete \acro{PDF}.
end up with our complete \acro{PDF}.
\end{enumerate} \end{enumerate}