texlive[72781] Master: inlinegraphicx (6nov24)
commits+karl at tug.org
commits+karl at tug.org
Wed Nov 6 22:23:47 CET 2024
Revision: 72781
https://tug.org/svn/texlive?view=revision&revision=72781
Author: karl
Date: 2024-11-06 22:23:47 +0100 (Wed, 06 Nov 2024)
Log Message:
-----------
inlinegraphicx (6nov24)
Modified Paths:
--------------
trunk/Master/tlpkg/bin/tlpkg-ctan-check
trunk/Master/tlpkg/libexec/ctan2tds
trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/inlinegraphicx/
trunk/Master/texmf-dist/doc/latex/inlinegraphicx/README.md
trunk/Master/texmf-dist/doc/latex/inlinegraphicx/inlinegraphicx-doc.pdf
trunk/Master/texmf-dist/doc/latex/inlinegraphicx/inlinegraphicx-doc.tex
trunk/Master/texmf-dist/doc/latex/inlinegraphicx/test_inlinegraphicx.pdf
trunk/Master/texmf-dist/tex/latex/inlinegraphicx/
trunk/Master/texmf-dist/tex/latex/inlinegraphicx/inlinegraphicx.sty
trunk/Master/tlpkg/tlpsrc/inlinegraphicx.tlpsrc
Added: trunk/Master/texmf-dist/doc/latex/inlinegraphicx/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/inlinegraphicx/README.md (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/inlinegraphicx/README.md 2024-11-06 21:23:47 UTC (rev 72781)
@@ -0,0 +1,5 @@
+inlinegraphicx is a package with 'inline graphicx insertion', with automatic size and position.
+-----------------------------------------------------------------------------------------------
+Author : Cédric Pierquet
+email : cpierquet at outlook.fr
+Licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/doc/latex/inlinegraphicx/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/inlinegraphicx/inlinegraphicx-doc.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/inlinegraphicx/inlinegraphicx-doc.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/inlinegraphicx/inlinegraphicx-doc.pdf 2024-11-06 21:22:42 UTC (rev 72780)
+++ trunk/Master/texmf-dist/doc/latex/inlinegraphicx/inlinegraphicx-doc.pdf 2024-11-06 21:23:47 UTC (rev 72781)
Property changes on: trunk/Master/texmf-dist/doc/latex/inlinegraphicx/inlinegraphicx-doc.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/inlinegraphicx/inlinegraphicx-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/inlinegraphicx/inlinegraphicx-doc.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/inlinegraphicx/inlinegraphicx-doc.tex 2024-11-06 21:23:47 UTC (rev 72781)
@@ -0,0 +1,267 @@
+% !TeX TXS-program:compile = txs:///arara
+% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode}
+% arara: pdflatex: {shell: no, synctex: no, interaction: batchmode}
+
+\documentclass[11pt,a4paper]{ltxdoc}
+\usepackage{bera}
+\usepackage{inconsolata}
+\usepackage[T1]{fontenc}
+\usepackage[scale=0.875]{cabin}
+\usepackage{inlinegraphicx}
+\usepackage{fancyvrb}
+\usepackage{fancyhdr}
+\usepackage{tabularray}
+\usepackage{fontawesome5}
+\fancyhf{}
+\renewcommand{\headrulewidth}{0pt}
+\lfoot{\sffamily\small [inlinegraphicx]}
+\cfoot{\sffamily\small - \thepage{} -}
+\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}}
+\usepackage{hologo}
+\providecommand\tikzlogo{Ti\textit{k}Z}
+\providecommand\TeXLive{\TeX{}Live\xspace}
+\let\TikZ\tikzlogo
+
+\usepackage{hyperref}
+\urlstyle{same}
+\hypersetup{pdfborder=0 0 0}
+\usepackage[margin=2cm]{geometry}
+\setlength{\parindent}{0pt}
+\def\TPversion{0.1.0}
+\def\TPdate{06/11/2024}
+\usepackage{tcolorbox}
+\usepackage{pgffor}
+\tcbuselibrary{breakable,skins,hooks,listingsutf8}
+%\usepackage{soul}
+%\sethlcolor{lightgray!25}
+
+\lstset{
+ language=[LaTeX]TeX,%
+ basicstyle=\ttfamily,%
+ keywordstyle={\color{blue}},%
+ classoffset=0,%
+ keywords={},%
+ alsoletter={-},%
+ keywordstyle={\color{blue}},%
+ classoffset=1,%
+ alsoletter={-},%
+ morekeywords={inlinegraphicx,calc,simplekv,graphicx},%
+ keywordstyle={\color{violet}},%
+ classoffset=2,%
+ alsoletter={-},%
+ morekeywords={\inlinegraphics,\includegraphics},%
+ keywordstyle={\color{green!50!black}},%
+ classoffset=3,%
+ morekeywords={scale,strut},%
+ keywordstyle={\color{orange!75!black}}
+}
+
+\newtcblisting{DemoCode}[1]{%
+ enhanced,width=\linewidth,%
+ bicolor,size=title,%
+ colback=cyan!10!white,%
+ colbacklower=cyan!5!white,%
+ colframe=cyan!75!black,%
+ listing options={%
+ breaklines=true,%
+ breakatwhitespace=true,%
+ style=tcblatex,basicstyle=\small\ttfamily,%
+ tabsize=4,%
+ commentstyle={\itshape\color{gray}},
+ keywordstyle={\color{blue}},%
+ classoffset=0,%
+ keywords={\usepackage,\includegraphics,xstring,listofitems,tikz,calc,simplekv,graphicx,\readlist,\showitems,\xintFor,\xintSeq,\draw,\node},%
+ alsoletter={-},%
+ keywordstyle={\color{blue}},%
+ classoffset=1,%
+ alsoletter={-},%
+ morekeywords={euromoney},%
+ keywordstyle={\color{violet}},%
+ classoffset=2,%
+ alsoletter={-},%
+ morekeywords={\inlinegraphics,\includegraphics},%
+ keywordstyle={\color{green!50!black}},%
+ classoffset=3,%
+ morekeywords={scale,strut},%
+ keywordstyle={\color{orange!75!black}}
+ },%
+ #1
+}
+
+\newtcbinputlisting\DemoCodeFile[1]{%
+ enhanced,width=\linewidth,%
+ bicolor,size=title,%
+ colback=lightgray!10!white,%
+ colbacklower=lightgray!5!white,%
+ colframe=lightgray!75!black,%
+ listing options={%
+ breaklines=true,%
+ breakatwhitespace=true,%
+ style=tcblatex,
+ basicstyle=\scriptsize\ttfamily,%
+ tabsize=4,%
+ commentstyle={\itshape\color{gray}},%
+ %lastline=148
+ },%
+ breakable,
+ listing only,%
+ listing file={#1}
+}
+
+\NewDocumentCommand\ShowCode{ m }{%
+ \colorbox{lightgray!50}{\lstinline!#1!}%
+}
+
+\begin{document}
+
+\thispagestyle{empty}
+
+\begin{center}
+ \begin{minipage}{0.88\linewidth}
+ \begin{tcolorbox}[colframe=yellow,colback=yellow!15]
+ \begin{center}
+ \renewcommand{\arraystretch}{1.25}%
+ \begin{tabular}{c}
+ {\Huge \texttt{inlinegraphicx}}\\
+ \\
+ {\LARGE Includegraphics, with an} \\
+ {\LARGE automatic inline positioning.} \\
+ \\
+ {\small \texttt{Version \TPversion{} -- \TPdate}}
+ \end{tabular}
+ \end{center}
+ \end{tcolorbox}
+ \end{minipage}
+\end{center}
+
+\begin{center}
+ \begin{tabular}{c}
+ \texttt{Cédric Pierquet}\\
+ {\ttfamily c pierquet -- at -- outlook . fr}\\
+ \texttt{\url{https://github.com/cpierquet/inlinegraphicx}} \\
+ \end{tabular}
+\end{center}
+
+\hrule
+
+\vfill
+
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
+{Inline insertion, \inlinegraphics{example-image-16x10} with automatic adjustments.}
+\end{tcolorbox}
+
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
+\sffamily{\LARGE Inline insertion, \inlinegraphics{example-image-16x10} with automatic adjustments.}
+\end{tcolorbox}
+
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
+{Inline insertion, \inlinegraphics*{example-image-16x10} with automatic adjustments but without depth.}
+\end{tcolorbox}
+
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
+\scalebox{2.25}[2.25]{Inline \inlinegraphics[scale=0.825]{example-image-16x10} proof with small resizing.}
+\end{tcolorbox}
+
+\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5]
+\sffamily{\LARGE Inline insertion, (\inlinegraphics[strut={()}]{example-image-16x10}) with automatic adjustments and choice of optimal height.}
+\end{tcolorbox}
+
+\vfill~
+
+\vspace*{5mm}
+
+\pagebreak
+
+\phantomsection
+
+\hypertarget{matoc}{}
+
+\tableofcontents
+
+\vspace*{5mm}
+
+%\hrule
+
+\pagebreak
+
+\section{Loading, useful packages}
+
+In order to load \ShowCode{inlinegraphicx}, simply use:
+
+\begin{DemoCode}{listing only}
+\usepackage{inlinegraphicx}
+\end{DemoCode}
+
+Loaded packages are \ShowCode{graphicx}, \ShowCode{simplekv} and \ShowCode{calc}.
+
+\section{Usage}
+
+The purpose of this package is to provide command, based on \ShowCode{\\includegraphics}, to insert graphic elements \textit{inline}, with automatic positioning and scaling.
+
+\smallskip
+
+The code determines (total)height and, if necessary, depth of letters in the current font, in order to position the image correctly :
+
+\begin{itemize}
+ \item (total)height is given by (total)height of {\setlength\fboxsep{0pt}\fbox{qH}} in the current font ;
+ \item depth is given by depth of {\setlength\fboxsep{0pt}\fbox{qH}} in the current font.
+\end{itemize}
+
+In order to adjust manually size/positioning, \ShowCode{[keys]} are available.
+
+\begin{DemoCode}{text only}
+\includegraphics[scale=3]{test_inlinegraphicx}
+\end{DemoCode}
+
+\section{The macro}
+
+\subsection{Arguments}
+
+The macro for inline insertion is \ShowCode{\\inlinegraphics}.
+
+\begin{DemoCode}{listing only}
+\inlinegraphics(*)[scale=...,strut=...]{image}
+\end{DemoCode}
+
+The starred version remove depth positioning, wheres normal version include depth.
+
+Available keys are:
+
+\begin{itemize}
+ \item \ShowCode{scale}: re-scaling of compute height (default \ShowCode{1}) ;
+ \item \ShowCode{strut}: characters for height/depth (default \ShowCode{qH}).
+\end{itemize}
+
+\subsection{Examples}
+
+\begin{DemoCode}{}
+Inline insertion, \inlinegraphics{example-image-16x10} with automatic adjustments.
+
+Inline insertion, \inlinegraphics[scale=0.75]{example-image-16x10} with automatic adjustments and scaling.
+
+Inline insertion, \inlinegraphics*{example-image-16x10} with automatic adjustments and without depth.
+\end{DemoCode}
+
+\begin{DemoCode}{}
+\scalebox{3}[3]{Inline (\inlinegraphics[strut={()}]{example-image-16x10}) q\inlinegraphics{example-image-16x10}H insertion}.
+\end{DemoCode}
+
+\begin{DemoCode}{}
+\sffamily{\Huge Inline (\inlinegraphics[strut={()}]{example-image-16x10}) q\inlinegraphics{example-image-16x9}H insertion}.
+\end{DemoCode}
+
+\begin{DemoCode}{}
+\ttfamily{\LARGE Inline (\inlinegraphics[strut={(É)}]{example-image-16x10}É) q\inlinegraphics{example-image-16x10}H insertion}.
+\end{DemoCode}
+
+\pagebreak
+
+\section{History}
+
+\texttt{0.1.0: Initial version}
+
+\section{The code}
+
+\DemoCodeFile{inlinegraphicx.sty}
+
+\end{document}
Property changes on: trunk/Master/texmf-dist/doc/latex/inlinegraphicx/inlinegraphicx-doc.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/inlinegraphicx/test_inlinegraphicx.pdf
===================================================================
(Binary files differ)
Index: trunk/Master/texmf-dist/doc/latex/inlinegraphicx/test_inlinegraphicx.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/inlinegraphicx/test_inlinegraphicx.pdf 2024-11-06 21:22:42 UTC (rev 72780)
+++ trunk/Master/texmf-dist/doc/latex/inlinegraphicx/test_inlinegraphicx.pdf 2024-11-06 21:23:47 UTC (rev 72781)
Property changes on: trunk/Master/texmf-dist/doc/latex/inlinegraphicx/test_inlinegraphicx.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/inlinegraphicx/inlinegraphicx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/inlinegraphicx/inlinegraphicx.sty (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/inlinegraphicx/inlinegraphicx.sty 2024-11-06 21:23:47 UTC (rev 72781)
@@ -0,0 +1,48 @@
+% Author : C. Pierquet
+% licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{inlinegraphicx}[2024/11/06 0.1.0 Insert inline graphicx]
+
+%====HISTORY
+% v 0.1.0 Initial version
+
+%====BASE
+\RequirePackage{graphicx}
+\RequirePackage{calc}
+\RequirePackage{simplekv}
+
+%====DIMENSIONS
+\newlength{\totheightinlinegraphicx}
+\newlength{\depthinlinegraphicx}
+\newlength{\inlinedepthgraphicsscale}
+
+%====KEYS
+\defKV[inlinegraphics]{scale=\def\inlinegraphicsscale{#1},strut=\def\inlinegraphicstrut{#1}}
+\setKVdefault[inlinegraphics]{scale=1,strut={qH}}
+
+%====MACRO
+\NewDocumentCommand\inlinegraphics{ s O{} m }{%
+ %1 = no depth/raisebox
+ %2 = keys (scale + strut)
+ %3 = file
+ \restoreKV[inlinegraphics]%
+ \setKV[inlinegraphics]{#2}%
+ \IfBooleanTF{#1}%
+ {%
+ \settoheight{\totheightinlinegraphicx}{\hbox{\inlinegraphicstrut}}%
+ \includegraphics[height=\inlinegraphicsscale\totheightinlinegraphicx]{#3}%
+ }%
+ {%
+ \settototalheight{\totheightinlinegraphicx}{\hbox{\inlinegraphicstrut}}%
+ \settodepth{\depthinlinegraphicx}{\hbox{\inlinegraphicstrut}}%
+ \xdef\inlinegraphicsinvscale{\fpeval{0.5*(1-\inlinegraphicsscale)}}%
+ \setlength{\inlinedepthgraphicsscale}%
+ {\dimexpr\depthinlinegraphicx-\inlinegraphicsinvscale\totheightinlinegraphicx\relax}%
+ \raisebox{-\inlinedepthgraphicsscale}{%
+ \includegraphics[height=\inlinegraphicsscale\totheightinlinegraphicx]{#3}%
+ }%
+ }%
+}
+
+\endinput
\ No newline at end of file
Property changes on: trunk/Master/texmf-dist/tex/latex/inlinegraphicx/inlinegraphicx.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check 2024-11-06 21:22:42 UTC (rev 72780)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check 2024-11-06 21:23:47 UTC (rev 72781)
@@ -443,7 +443,8 @@
imfellenglish impnattypo import imsproc imtekda
incgraph includernw inconsolata inconsolata-nerd-font
index indextools infwarerr
- initials inkpaper inline-images inlinebib inlinedef inlinelabel innerscript
+ initials inkpaper inline-images
+ inlinebib inlinedef inlinegraphicx inlinelabel innerscript
inputenx inputnormalization inputtrc
inriafonts insbox install-latex-guide-zh-cn installfont
intcalc inter interactiveworkbook
Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds 2024-11-06 21:22:42 UTC (rev 72780)
+++ trunk/Master/tlpkg/libexec/ctan2tds 2024-11-06 21:23:47 UTC (rev 72781)
@@ -1792,6 +1792,7 @@
'ibygrk' => '&POSTibygrk',
'impatient' => '&POSTimpatient',
'impatient-fr' => '&POSTimpatient_fr',
+ 'inlinegraphicx' => '&POST_onelevel',
'interactiveworkbook' => '&POSTinteractiveworkbook',
'ipsum' => '&POST_onelevel',
'isodoc' => '&POSTisodoc',
Modified: trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc 2024-11-06 21:22:42 UTC (rev 72780)
+++ trunk/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc 2024-11-06 21:23:47 UTC (rev 72781)
@@ -735,6 +735,7 @@
depend indextools
depend inline-images
depend inlinedef
+depend inlinegraphicx
depend inlinelabel
depend inputenx
depend inputtrc
Added: trunk/Master/tlpkg/tlpsrc/inlinegraphicx.tlpsrc
===================================================================
More information about the tex-live-commits
mailing list.