Skip to content

Commit

Permalink
add \hide{ } for only compiled, not shown code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
m4lvin committed May 30, 2024
1 parent 00ddc4d commit be6a33d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
9 changes: 7 additions & 2 deletions latexmacros.tex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
\usepackage[pdftex]{hyperref}
\usepackage[margin=2cm,bottom=3cm,footskip=15mm]{geometry}
\parindent0cm
\parskip1em
\parskip0.5em

\usepackage{tikz}
\usetikzlibrary{arrows,trees,positioning,shapes,patterns}
Expand Down Expand Up @@ -38,7 +38,12 @@
belowskip = 8pt plus 3pt
}
\lstnewenvironment{code}[0]{}{}
\lstnewenvironment{showCode}[0]{\lstset{numbers=none}}{} % only shown, not compiled

% only shown, not compiled:
\lstnewenvironment{showCode}[0]{\lstset{numbers=none}}{}

% only compiled, not shown:
\newcommand{\hide}[1]{}

% will the real phi please stand up
\renewcommand{\phi}{\varphi}
Expand Down
13 changes: 13 additions & 0 deletions lib/Basics.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,17 @@ myreverse [] = []
myreverse (x:xs) = myreverse xs ++ [x]
\end{code}

If you look at the \texttt{.lhs} file then below this line you can find some Haskell code.

\hide{
\begin{code}
secret :: Int
secret = 4
\end{code}
}

But it does not show up in the PDF document.
Please only use this for boring or repetitive parts of your code.
Do not hide too much from your reader.

That's it, for now.
Binary file modified report.pdf
Binary file not shown.

0 comments on commit be6a33d

Please sign in to comment.