m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Chrzanowski <mc370754@students.mimuw.edu.pl>2021-08-07 14:34:07 -0400
committerMarcin Chrzanowski <mc370754@students.mimuw.edu.pl>2021-08-07 14:34:07 -0400
commitce335794a175e28e7de356d41dfd20bf2b88766e (patch)
treea7995e8a302875d419e078ecb5490533f2179f71
parentc1885675cedfee307890c7a01ecc78cab5c0cb34 (diff)
Add an optional 'fixed parameters' parameter
-rw-r--r--definitions.sty20
1 files changed, 11 insertions, 9 deletions
diff --git a/definitions.sty b/definitions.sty
index f6d2e94..f21eb49 100644
--- a/definitions.sty
+++ b/definitions.sty
@@ -1,12 +1,14 @@
-\newtheorem{definition}{Definition}[chapter]
-
-% #1: Name of query problem
-% #2: The structure to preprocess
-% #3: Queries to handle
-\newcommand{\queryproblem}[3]{
- \textsc{#1}
+\usepackage{ifthen}
- \textbf{Given:} #2
+\newtheorem{definition}{Definition}[chapter]
- \textbf{Queries:} #3
+% #1 (optional): Fixed parameters of the problem
+% #2: Name of query problem
+% #3: The structure to preprocess
+% #4: Queries to handle
+\newcommand{\queryproblem}[4][]{
+ \textsc{#2} \\
+ \ifthenelse{\equal{#1}{}}{}{\textbf{Fixed:} #1 \\}
+ \textbf{Given:} #3 \\
+ \textbf{Queries:} #4
}