From ce335794a175e28e7de356d41dfd20bf2b88766e Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Sat, 7 Aug 2021 14:34:07 -0400 Subject: Add an optional 'fixed parameters' parameter --- definitions.sty | 20 +++++++++++--------- 1 file 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 } -- cgit v1.2.3