Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions backend/src/Tools/MathComps.Cli.Handouts/BuildCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 6 additions & 2 deletions data/handouts/_template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 0 additions & 2 deletions data/handouts/angle-basics-1.sk.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

\setlanguage{SK}

\ReviewModetrue

\Title{Základy počítania uhlov}

\MathcompsLink{zaklady-pocitania-uhlov-1}
Expand Down
Loading