Skip to content
Snippets Groups Projects
Commit f29a6781 authored by Ben Frank's avatar Ben Frank :snail:
Browse files

Introduce inversion control keys

When using the four corner cells, the automatically detected inversion
may be horizontal and vertical whereas the user most likely only wants
one of them.
parent 03351772
Branches
Tags v0.3.3
No related merge requests found
Pipeline #130262849 passed
% \iffalse meta-comment
% This is kvmap, (c) 2019 Ben Frank
% This is kvmap, (c) 2020 Ben Frank
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
......@@ -15,7 +15,7 @@
\input l3docstrip.tex
\askforoverwritefalse
\preamble
Copyright (C) 2019 Ben Frank
Copyright (C) 2020 Ben Frank
It may be distributed and/or modified under the conditions of
the LaTeX Project Public License (LPPL), either version 1.3c of
......@@ -102,7 +102,7 @@ End of file
%<*pkg>
%<@@=kvmap>
\RequirePackage{expl3}
\ProvidesExplPackage{kvmap}{2019/12/26}{0.3.2}{Drawing karnaugh maps with LaTeX}
\ProvidesExplPackage{kvmap}{2020/03/27}{0.3.3}{Drawing karnaugh maps with LaTeX}
%</pkg>
% \fi
%
......@@ -212,6 +212,10 @@ End of file
% With |color| you may change the color of the border and |reducespace|
% allows you to specify whether you want the package to be narrower or wider.
% \par
% When using |invert|, the package tries to determine where to invert
% automatically. Sometimes it fails with the guesswork. You can manually
% disable the horizontal inversion part with |hinvert=false| (idem for the
% vertical inversion part with |vinvert=false|).\par
% Warning: This package is unable to draw a bundle including all four corners
% this way. If you need this specific edge case, please use TikZ to draw it
% yourself (see the last example in \autoref{sec:examples}).
......@@ -447,7 +451,8 @@ End of file
% \subsection{Implicant-related code}
% \begin{macro}[updated=2018-03-17]{\bundle}
% \changes{v0.1.1}{2018/03/17}{Correct dimensions}
% \changes{v0.2.1}{2018/09/20}{Fix inversion}
% \changes{v0.2.1}{2018/09/20}{Fix inversion}
% \changes{v0.3.3}{2020/03/27}{Introduce hinvert and vinvert}
% Draw a bundle with given corners.
% \begin{arguments}
% \item key-value pairs
......@@ -476,6 +481,18 @@ End of file
invert .default:n = true,
invert .initial:n = false,
% \end{macrocode}
% |vinvert|: perform inversion vertically
% \begin{macrocode}
vinvert .bool_set:N = \l_@@_bundle_vinvert_bool,
vinvert .default:n = true,
vinvert .initial:n = true,
% \end{macrocode}
% |hinvert|: perform inversion horizontally
% \begin{macrocode}
hinvert .bool_set:N = \l_@@_bundle_hinvert_bool,
hinvert .default:n = true,
hinvert .initial:n = true,
% \end{macrocode}
% |overlapmargins|: intrude into margin (when inverted)
% \begin{macrocode}
overlapmargins .dim_set:N = \l_@@_bundle_overlapmargins_dim,
......@@ -525,6 +542,7 @@ End of file
{
\int_compare_p:n { \l_@@_matrix_height_int - 1 = \l_@@_bundle_maxy_int }
&& \int_compare_p:n { 0 = \l_@@_bundle_miny_int }
&& \l_@@_bundle_vinvert_bool
}
{
\draw[draw=\l_@@_bundle_color_tl,kvbundle] ~
......@@ -569,6 +587,7 @@ End of file
{
\int_compare_p:n { \l_@@_matrix_width_int - 1 = \l_@@_bundle_maxx_int }
&& \int_compare_p:n { 0 = \l_@@_bundle_minx_int }
&& \l_@@_bundle_hinvert_bool
}
{
\draw[draw=\l_@@_bundle_color_tl,kvbundle] ~
......
\input l3docstrip.tex
\askforoverwritefalse
\preamble
Copyright (C) 2019 Ben Frank
Copyright (C) 2020 Ben Frank
It may be distributed and/or modified under the conditions of
the LaTeX Project Public License (LPPL), either version 1.3c of
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment