From 740a11f29a3551babe3d7edbb57ac3baa2280a3f Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 26 Feb 2022 03:00:34 +0000 Subject: CTAN sync 202202260300 --- .../contrib/stex/source/extensions/tikzinput.dtx | 146 +++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 macros/latex/contrib/stex/source/extensions/tikzinput.dtx (limited to 'macros/latex/contrib/stex/source/extensions/tikzinput.dtx') diff --git a/macros/latex/contrib/stex/source/extensions/tikzinput.dtx b/macros/latex/contrib/stex/source/extensions/tikzinput.dtx new file mode 100644 index 0000000000..51a3a7c06a --- /dev/null +++ b/macros/latex/contrib/stex/source/extensions/tikzinput.dtx @@ -0,0 +1,146 @@ +% \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> +\providecommand\bibfolder{../../lib/bib} +\input{../../doc/docheader} + +\begin{document} + \DocInput{\jobname.dtx} +\end{document} +% +% \fi +% +% \title{Tikzinput +% \thanks{Version {\fileversion} (last revised {\filedate})} +% } +% +% \author{Michael Kohlhase, Dennis Müller\\ +% FAU Erlangen-Nürnberg\\ +% \url{http://kwarc.info/} +% } +% +% \maketitle +% +%\ifinfulldoc\else +% This is the documentation for the \pkg{tikzinput} package. +% For a more high-level introduction, +% see \href{\basedocurl/manual.pdf}{the \sTeX Manual} or the +% \href{\basedocurl/stex.pdf}{full \sTeX documentation}. +% +% \input{../../doc/packages/tikzinput} +% \fi +% +% \begin{documentation}\label{pkg:tikzinput:doc} +% +% +% \section{Macros and Environments}\label{pkg:tikzinput:doc:macros} +% +% \end{documentation} +% +% \begin{implementation}\label{pkg:tikzinput:impl} +% +% \section{Tikzinput Implementation} +% +% \begin{macrocode} +%<*package> + +%%%%%%%%%%%%% tikzinput.dtx %%%%%%%%%%%%% + +% \end{macrocode} +% +% \begin{macrocode} +\ProvidesExplPackage{tikzinput}{2022/02/24}{3.0.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} +} + +\@ifpackageloaded{stex}{ + \RequirePackage{stex-tikzinput} +}{} + +% \end{macrocode} +% +% +% \begin{macrocode} +% +%<*stex> +% \end{macrocode} +% +% \begin{macrocode} +\ProvidesExplPackage{stex-tikzinput}{2022/02/24}{3.0.0}{stex-tikzinput} +\RequirePackage{stex} +\RequirePackage{tikzinput} + +\newcommand\mhtikzinput[2][]{% + \def\Gin@mhrepos{}\setkeys{Gin}{#1}% + \stex_in_repository:nn\Gin@mhrepos{ + \tikzinput[#1]{\mhpath{##1}{#2}} + } +} +\newcommand\cmhtikzinput[2][]{\begin{center}\mhtikzinput[#1]{#2}\end{center}} +% \end{macrocode} +% +% \begin{macrocode} +% +% \end{macrocode} +% +% \end{implementation} +% +% \PrintIndex + +% LocalWords: bibfolder jobname.dtx tikzinput.dtx usetikzlibrary Gin@ewidth Gin@eheight +% LocalWords: resizebox ctikzinput mhtikzinput Gin@mhrepos mhpath -- cgit v1.2.3