diff options
author | Norbert Preining <norbert@preining.info> | 2023-03-22 03:01:52 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-03-22 03:01:52 +0000 |
commit | cbbc6dbdbf08b70a7e7d8d184ca51c57c835415a (patch) | |
tree | 97ded8ca7095c54f6ff9b661be6b93f80bf792c4 /macros/latex/contrib/stex/source/tikzinput.dtx | |
parent | de9a0afa47c2ee09e1d4704821cad2b231d36b3f (diff) |
CTAN sync 202303220301
Diffstat (limited to 'macros/latex/contrib/stex/source/tikzinput.dtx')
-rw-r--r-- | macros/latex/contrib/stex/source/tikzinput.dtx | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/macros/latex/contrib/stex/source/tikzinput.dtx b/macros/latex/contrib/stex/source/tikzinput.dtx new file mode 100644 index 0000000000..988d483b12 --- /dev/null +++ b/macros/latex/contrib/stex/source/tikzinput.dtx @@ -0,0 +1,114 @@ +% \iffalse meta-comment +% An Infrastructure for Semantic Macros and Module Scoping +% Copyright (c) 2019 Michael Kohlhase, all rights reserved +% this file is released under the +% LaTeX Project Public License (LPPL) +% +% The original of this file is in the public repository at +% http://github.com/sLaTeX/sTeX/ +% +% TODO update copyright +% +%<*driver> +\def\stexdocpath{../doc} +\input{\stexdocpath/stex-docheader} +\stextoptitle{Tikzinput: Treating TIKZ code as images}{tikzinput} +\docmodule +%</driver> +% \fi +% +% \begin{stexmanual} +% \begin{sfragment}{Tikzinput Manual} + % \input{\stexdocpath/packages/stex-tikzinput} +% \end{sfragment} +% \end{stexmanual} +% +% \begin{documentation} +% \begin{sfragment}{Tikzinput Documentation} +% TODO +% \end{sfragment} +% \end{documentation} +% +% \begin{implementation}\label{pkg:tikzinput:impl} +% +% \begin{sfragment}{Tikzinput Implementation} +% +% \begin{macrocode} +%<@@=tikzinput> +%<*package> + +%%%%%%%%%%%%% tikzinput.dtx %%%%%%%%%%%%% + +% \end{macrocode} +% +% \begin{macrocode} +\ProvidesExplPackage{tikzinput}{2023/03/19}{3.3.0}{tikzinput package} +\RequirePackage{l3keys2e} + +\keys_define:nn { tikzinput } { + image .bool_set:N = \c_tikzinput_image_bool, + image .default:n = false , + unknown .code:n = {} +} + +\ProcessKeysOptions { tikzinput } + +\bool_if:NTF \c_tikzinput_image_bool { + \RequirePackage{graphicx} + + \providecommand\usetikzlibrary[]{} + \newcommand\tikzinput[2][]{\includegraphics[#1]{#2}} +}{ + \RequirePackage{tikz} + \RequirePackage{standalone} + + \newcommand \tikzinput [2] [] { + \setkeys{Gin}{#1} + \ifx \Gin@ewidth \Gin@exclamation + \ifx \Gin@eheight \Gin@exclamation + \input { #2 } + \else + \resizebox{!}{ \Gin@eheight }{ + \input { #2 } + } + \fi + \else + \ifx \Gin@eheight \Gin@exclamation + \resizebox{ \Gin@ewidth }{!}{ + \input { #2 } + } + \else + \resizebox{ \Gin@ewidth }{ \Gin@eheight }{ + \input { #2 } + } + \fi + \fi + } +} + +\newcommand \ctikzinput [2] [] { + \begin{center} + \tikzinput [#1] {#2} + \end{center} +} +% \end{macrocode} +% +% +% \begin{macrocode} +%</package> +% \end{macrocode} +% +% \end{sfragment} +% \end{implementation} +% +\endinput +% Local Variables: +% mode: doctex +% TeX-master: t +% End: + +% LocalWords: libfolder jobname.dtx tikzinput.dtx usetikzlibrary Gin@ewidth Gin@eheight +% LocalWords: ctikzinput mhpath pgfkeys@spdef pgfutil@empty 1@atcode catcode l_tmpa_str +% LocalWords: pgfutil@InputIfFileExists libusetikzlibrary msg_error:nnn notinarchive +% LocalWords: seq_clear:N seq_set_eq:NN l_tmpa_seq c_stex_mathhub_seq seq_set_split:NnV +% LocalWords: l_tmpb_seq seq_if_empty_p:N tikzlibrary seq_put_right:No seq_pop_left:NN |