diff --git a/backend/src/Tools/MathComps.Cli.Handouts/BuildCommand.cs b/backend/src/Tools/MathComps.Cli.Handouts/BuildCommand.cs index 8378db4..961d338 100644 --- a/backend/src/Tools/MathComps.Cli.Handouts/BuildCommand.cs +++ b/backend/src/Tools/MathComps.Cli.Handouts/BuildCommand.cs @@ -519,8 +519,11 @@ private static void CompileTexFile( var compilerParts = compiler.Split(' ', StringSplitOptions.RemoveEmptyEntries); var compilerExecutable = compilerParts[0]; - // Pass each flag as its own argv entry plus the input .tex filename at the end - string[] arguments = [.. compilerParts.Skip(1), texFile.Name]; + // Pass each flag as its own argv entry, then inject \def\PUBLISH{} before \input + // reads the .tex. The template defaults \ReviewModetrue so manual local compiles + // render inline review content; the \PUBLISH sentinel flips it off, producing + // the publish form (where hints and solutions are not below statements but at the end) + string[] arguments = [.. compilerParts.Skip(1), $@"\def\PUBLISH{{}}\input {texFile.Name}"]; // Run the compiler; ProcessRunner drains stdout/stderr and reports the exit code var result = ProcessRunner.Run(compilerExecutable, arguments, workingDirectory.FullName); diff --git a/data/handouts/_template.tex b/data/handouts/_template.tex index ed3ee29..da4e06e 100644 --- a/data/handouts/_template.tex +++ b/data/handouts/_template.tex @@ -24,9 +24,13 @@ \newif\ifDisplayTexts \DisplayTextstrue -% Toggle to inline hints/solutions under each Problem and Exercise (review mode) +% Toggle to inline hints/solutions under each Problem and Exercise (review mode). +% Defaults to TRUE so manual local compiles render the inline review form; the +% Handouts CLI defines \PUBLISH before it reads the handout via \input, which +% flips this off and produces the publish form. \newif\ifReviewMode -\ReviewModefalse +\ReviewModetrue +\ifdefined\PUBLISH\ReviewModefalse\fi % Render #1 if solutions should be inline (review mode OR display-texts), else #2 \long\def\IfShowingTexts#1#2{\ifReviewMode#1\else\ifDisplayTexts#1\else#2\fi\fi} diff --git a/data/handouts/angle-basics-1.sk.tex b/data/handouts/angle-basics-1.sk.tex index ae442b4..b27efda 100644 --- a/data/handouts/angle-basics-1.sk.tex +++ b/data/handouts/angle-basics-1.sk.tex @@ -2,8 +2,6 @@ \setlanguage{SK} -\ReviewModetrue - \Title{Základy počítania uhlov} \MathcompsLink{zaklady-pocitania-uhlov-1}