Skip to content

Commit

Permalink
version 0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
cgnieder committed Oct 6, 2019
1 parent dd22cf9 commit 10ee4b3
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 22 deletions.
2 changes: 1 addition & 1 deletion code/xsim.environments.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@
\xsim_if_write_to_files:TF
{
\NewDocumentEnvironment
{ \xsim_get_parameter:nn {#1} {#2-env} } {o}
{ \xsim_get_parameter:nn {#1} {#2-env} } {!o}
{
\IfNoValueTF {##1}
{
Expand Down
3 changes: 2 additions & 1 deletion code/xsim.sty
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
final .bool_gset:N = \g_xsim_final_bool ,
verbose .bool_gset:N = \g_xsim_verbose_bool ,
clear-aux .bool_gset:N = \g_xsim_clear_aux_bool ,
no-files .bool_gset_inverse:N = \g__xsim_write_to_file_bool
no-files .bool_gset_inverse:N = \g__xsim_write_to_file_bool ,
no-files .initial:n = false
}

\ProcessKeysPackageOptions {xsim/package}
Expand Down
15 changes: 10 additions & 5 deletions code/xsim.verbwrite.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,18 @@
% see http://tex.stackexchange.com/q/9035/5049 reasons
\use:nx
{ \__xsim_file_write_start:n {#2} }
{ \bool_if:nF {#1} { \c__xsim_active_eol_tl } }
{ \bool_if:nF {#1} { \exp_not:V \c__xsim_active_eol_tl } }
}
\cs_generate_variant:Nn \xsim_file_write_start:nn {nV}

\cs_new_protected:Npn \__xsim_set_verb_catcodes:
{
\seq_map_inline:Nn \l_char_special_seq
{ \char_set_catcode_other:N ##1 }
\int_step_inline:nnnn {128} {1} {255}
{ \char_set_catcode_letter:n {##1} }
}

\group_begin:
\char_set_catcode_active:n {13} % ^^M (carriage return, endlinechar)
\char_set_catcode_active:n {12} % ^^L (form feed)
Expand All @@ -130,10 +138,7 @@
{ \l_xsim_file_begin_tl } %
} %
} %
\seq_map_inline:Nn \l_char_special_seq %
{ \char_set_catcode_other:N ##1 } %
\int_step_inline:nnnn {128} {1} {255} %
{ \char_set_catcode_letter:n {##1} } %
\__xsim_set_verb_catcodes: %
\tl_set:Nx \l__xsim_tmpa_tl %
{ \c__xsim_backslash_char_tl end \cs_to_str:N \{ \@currenvir \cs_to_str:N \} } %
\use:x %
Expand Down
Binary file modified doc/examples/xsim.texsx-338165.pdf
Binary file not shown.
4 changes: 1 addition & 3 deletions doc/examples/xsim.texsx-338165.tex
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
\usepackage{xsim}
\usepackage{tcolorbox}
\tcbuselibrary{breakable, skins}
\settasks{
counter-format = tsk.
}
\settasks{ label = \arabic*. }

\DeclareExerciseEnvironmentTemplate{boxed}
{%
Expand Down
24 changes: 14 additions & 10 deletions doc/xsim-manual.cls
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@
}

\def\libertine@figurestyle{LF}
\RequirePackage{amsmath}
\undef\lvert \undef\lVert
\undef\rvert \undef\rVert
\RequirePackage[libertine]{newtxmath}
\def\libertine@figurestyle{OsF}

Expand Down Expand Up @@ -587,7 +590,7 @@
\RequirePackage{bookmark}

\xsimsetup{
clear-aux ,
% clear-aux ,
path = exercises
}

Expand Down Expand Up @@ -724,11 +727,11 @@
}
\newcommand*\listexamplefiles{%
\def\xsim@example@texfile@path##1{./examples/xsim.##1.tex}%
\def\xsim@example@pdffile@path##1{./examples/{xsim.##1}.pdf}%
\def\xsim@example@pdffile@path{./examples/xsim}%
\def\xsim@example@desc##1{\csuse{xsim@example@texfile@desc@##1}}%
\def\xsim@example@title##1{%
Example~\theexamplefile\ \xsim@example@desc{##1}
\\Links: \xsim@example@links{##1} (\code{xsim.##1.tex})%
Example~\theexamplefile: \xsim@example@desc{##1}
\\Links: \xsim@example@links{##1}\hfill File: \code{xsim.##1.tex}%
}%
\def\xsim@example@bookmark##1{Example~\theexamplefile\ (\xsim@example@desc{##1})}%
\def\do##1{%
Expand All @@ -739,30 +742,30 @@
sidebyside gap=1em,
lower separated=false,
bottom=1mm,
% rightlower=0pt,
% halign lower=flush right,
% clip lower,
title=\xsim@example@title{##1}%
]
\bookmark[level=2,dest=examplefile.\arabic{examplefile}]{\xsim@example@bookmark{##1}}%
\lstinputlisting[style=cnltx,firstline=7,lastline=15,firstnumber=7]{\xsim@example@texfile@path{##1}}
\tcblower
\fbox{%
\href
{\xsim@example@pdffile@path{##1}}
{\xsim@example@pdffile@path.##1.pdf}
{%
\includegraphics[
type=pdf,
ext=.##1.pdf,
read=.##1.pdf,
pagebox=cropbox,
viewport=4.5cm 18.6cm 8.7cm 23cm,
clip]{\xsim@example@pdffile@path{##1}}%
clip]{\xsim@example@pdffile@path}%
}%
}%
\end{cnltxcode}
}%
\dolistloop\xsim@examplefiles
}

\xsim@add@example{blanks}{Creat blank lines}
\xsim@add@example{blanks}{Create blank lines}
\xsim@add@example{boxed-headings}{Put headings in a box}
\xsim@add@example{code-and-output}{Create code examples}
\xsim@add@example{collections}{How to use collections}
Expand Down Expand Up @@ -833,6 +836,7 @@
\xsim@add@version{0.10a} {2017-10-04}
\xsim@add@version{0.11} {2018-02-12}
\xsim@add@version{0.12} {2019-09-26}
\xsim@add@version{0.13} {2019-10-06}

% ----------------------------------------------------------------------------
\endinput
Binary file modified doc/xsim_manual.pdf
Binary file not shown.
17 changes: 15 additions & 2 deletions doc/xsim_manual.tex
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ \subsection{Package Options}\label{sec:package-options}
The \option{final} option automatically disables this option. See also
sections~\vref{sec:how-exerc-envir} and~\vref{sec:resolve-getting}.
\opt{no-files}
\sinceversion{0.12a}This option prevents \xsim\ from writing the exercises
\sinceversion{0.13}This option prevents \xsim\ from writing the exercises
and solutions to external files. This will keep your working folder
``clean'' but will also prevent using verbatim material in exercises and
solutions and will probably slow processing further down. \emph{This
solutions and will possibly slow processing further down. \emph{This
option is considered experimental. Feedback is very welcome.}
\end{options}

Expand Down Expand Up @@ -305,6 +305,19 @@ \section{How the Exercise Environments Work}\label{sec:how-exerc-envir}
\end{exercise}
\end{sourcecode}

If\sinceversion{0.13} you don't like all the external files and the problems
which come with them \emph{and} if you don't need any verbatim or similar
material inside the exercises and solutions then you can use the following
package option:
\begin{options}
\opt{no-files}
This option prevents \xsim\ from writing the exercises and solutions to
external files. This will keep your working folder ``clean'' but will
also prevent using verbatim material in exercises and solutions and will
possibly slow processing further down. \emph{This option is considered
experimental. Feedback is very welcome.}
\end{options}

\begin{bewareofthedog}
\xsim\ writes a lot of stuff to the auxfile for re-using information on
subsequent compilations. If you add exercises, change properties \etc\ it
Expand Down

0 comments on commit 10ee4b3

Please sign in to comment.