texlive[68138] Master/texmf-dist: highlightx (1sep23)
commits+karl at tug.org
commits+karl at tug.org
Fri Sep 1 23:15:30 CEST 2023
Revision: 68138
http://tug.org/svn/texlive?view=revision&revision=68138
Author: karl
Date: 2023-09-01 23:15:30 +0200 (Fri, 01 Sep 2023)
Log Message:
-----------
highlightx (1sep23)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/highlightx/README.md
trunk/Master/texmf-dist/doc/latex/highlightx/highlightx-doc.pdf
trunk/Master/texmf-dist/doc/latex/highlightx/highlightx-doc.tex
trunk/Master/texmf-dist/tex/latex/highlightx/highlightx.sty
Modified: trunk/Master/texmf-dist/doc/latex/highlightx/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/highlightx/README.md 2023-09-01 21:15:20 UTC (rev 68137)
+++ trunk/Master/texmf-dist/doc/latex/highlightx/README.md 2023-09-01 21:15:30 UTC (rev 68138)
@@ -4,5 +4,4 @@
-------------------------------------------------------------------------
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
-Source : https://tex.stackexchange.com/questions/5959/cool-text-highlighting-in-latex
\ No newline at end of file
+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
Modified: trunk/Master/texmf-dist/doc/latex/highlightx/highlightx-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/highlightx/highlightx-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/highlightx/highlightx-doc.tex 2023-09-01 21:15:20 UTC (rev 68137)
+++ trunk/Master/texmf-dist/doc/latex/highlightx/highlightx-doc.tex 2023-09-01 21:15:30 UTC (rev 68138)
@@ -33,8 +33,8 @@
\hypersetup{pdfborder=0 0 0}
\usepackage[margin=1.5cm]{geometry}
\setlength{\parindent}{0pt}
-\def\TPversion{0.1.0}
-\def\TPdate{31 août 2023}
+\def\TPversion{0.1.1}
+\def\TPdate{1\up*{er} septembre 2023}
\usepackage{tcolorbox}
\tcbuselibrary{skins,hooks}
\sethlcolor{lightgray!25}
@@ -56,11 +56,11 @@
\begin{tabular}{c}
{\Huge \texttt{highlightx}}\\
\\
- {\LARGE Commandes pour surligner formules ou paragraphes,} \\
+ {\LARGE Commandes pour surligner de formules (avec un} \\
\\
- {\LARGE avec un effet main levée, à l'aide des packages} \\
+ {\LARGE effet main levée), ou des paragraphes, à l'aide} \\
\\
- {\LARGE \MontreCode{soul} ou \MontreCode{tikz}.} \\
+ {\LARGE des packages \MontreCode{soul} et/ou \MontreCode{tikz}.} \\
\\
{\LARGE $\rhd$ Commandes [fr] ou [en] $\lhd$} \\
\\
@@ -105,10 +105,10 @@
Et on peut même mettre en forme un paragraphe (dans une \MontreCode{tcbox}), généré aléatoirement grâce au site \url{https://ipsum.one/} par exemple : \og \genhighlightpar{Enfin, comme le dernier coup de dix heures retentissait encore, il étendit la main et prit celle de Mme Rênal, qui la retira aussitôt. Julien, sans trop savoir ce qu’il faisait, la saisit de nouveau. Quoique bien ému lui-même, il fut frappé de la froideur glaciale de la main qu’il prenait ; il la serrait avec une force convulsive ; on fit un dernier effort pour la lui ôter, mais enfin cette main lui resta.} \fg
\end{tcolorbox}
-\vspace*{5mm}
+%\vspace*{5mm}
+%
+%Et dans un paragraphe classique, on peut mettre des effets, comme par exemple avec le texte suivant, généré aléatoirement grâce au site \url{https://ipsum.one/} par exemple : \og \SurlignerTexte[orange!25,draw=teal]{Une scie à eau se compose d’un hangar au bord d’un ruisseau. Le toit est soutenu par une charpente qui porte sur quatre gros piliers en bois. À huit ou dix pieds d’élévation, au milieu du hangar, on voit une scie qui monte et descend, tandis qu’un mécanisme fort simple pousse contre cette scie une pièce de bois. C’est une roue mise en mouvement par le ruisseau qui fait aller ce double mécanisme ; celui de la scie qui monte et descend, et celui qui pousse doucement la pièce de bois vers la scie, qui la débite en planches.} \fg
-Et dans un paragraphe classique, on peut mettre des effets, comme par exemple avec le texte suivant, généré aléatoirement grâce au site \url{https://ipsum.one/} par exemple : \og \SurlignerTexte[orange!25,draw=teal]{Une scie à eau se compose d’un hangar au bord d’un ruisseau. Le toit est soutenu par une charpente qui porte sur quatre gros piliers en bois. À huit ou dix pieds d’élévation, au milieu du hangar, on voit une scie qui monte et descend, tandis qu’un mécanisme fort simple pousse contre cette scie une pièce de bois. C’est une roue mise en mouvement par le ruisseau qui fait aller ce double mécanisme ; celui de la scie qui monte et descend, et celui qui pousse doucement la pièce de bois vers la scie, qui la débite en planches.} \fg
-
\vfill~
\pagebreak
@@ -148,24 +148,26 @@
\subsection{Possibilités et limitations}
-L'idée du package \MontreCode{highlightx} est de proposer des commandes, simples et basiques, pour \textit{surligner} :
+L'idée du package \MontreCode{highlightx} est de proposer des commandes basiques, pour \textit{surligner} :
\begin{itemize}
\item du texte simple ou multi-lignes (paragraphes) ;
- \item des formules en mode math en ligne ou hors-ligne (grâce à \TikZ) ;
- \item avec un effet de bordure à \textit{main levée} (sauf pour un paragraphe dans une \MontreCode{tcbox}).
+ \item des formules en mode math en ligne ou hors-ligne (grâce à \TikZ) avec un effet de bordure à \textit{main levée}.
+ %\item avec un effet de bordure à \textit{main levée} (sauf pour un paragraphe dans une \MontreCode{tcbox}).
\end{itemize}
-{\small\faBomb}~Pour le moment le surlignement avec effet en mode paragraphe n'est pas compatible avec des environnements (comme \MontreCode{tcolorbox}), donc dans ce cas il n'y aura pas d'effet possible.
+{\small\faBomb}~En ce qui concerne les paragraphes, le package \MontreCode{soul} est performant dans le cas où la police courante est en \MontreCode{\textbackslash normalsize}, dans le cas contraire, il se peut que le rendu ne soit pas optimal. Il se peut également que le surlignage ne donne pas un résultat optimal avec certains caractères, comme par exemple \MontreCode{;}.
-\medskip
+%{\small\faBomb}~Pour le moment le surlignement avec effet en mode paragraphe n'est pas compatible avec des environnements (comme \MontreCode{tcolorbox}), donc dans ce cas il n'y aura pas d'effet possible.
+%
+%\medskip
+%
+%{\small\faAngellist}~Le code permettant de surligner un paragraphe avec effet vient d'une solution proposée par l'internaute \MontreCode{gusbrs}, dans un fil de discussion du site \MontreCode{tex.stackexchange}, et sous licence CC BY-SA :
+%
+%\smallskip
+%
+%\hfill\url{https://tex.stackexchange.com/questions/5959/cool-text-highlighting-in-latex}\hfill~
-{\small\faAngellist}~Le code permettant de surligner un paragraphe avec effet vient d'une solution proposée par l'internaute \MontreCode{gusbrs}, dans un fil de discussion du site \MontreCode{tex.stackexchange} :
-
-\smallskip
-
-\hfill\url{https://tex.stackexchange.com/questions/5959/cool-text-highlighting-in-latex}\hfill~
-
\subsection{Chargement}
Le package se charge dans le préambule, via \MontreCode{\textbackslash usepackage\{highlightx\}}.
@@ -173,9 +175,11 @@
Les seuls packages chargés sont :
\begin{itemize}
- \item \MontreCode{soul}, \MontreCode{atbegshi}, \MontreCode{etoolbox} ;
- \item \MontreCode{tikz} avec les librairies \MontreCode{tikzmark,calc,decorations.pathmorphing} ;
- \item \MontreCode{xstring} et \MontreCode{simplekv}.
+ \item \MontreCode{soul}, \MontreCode{xstring} et \MontreCode{simplekv}.
+ \item \MontreCode{tikz} avec les librairies \MontreCode{tikzmark,calc,decorations.pathmorphing}.
+ %\item \MontreCode{soul}, \MontreCode{atbegshi}, \MontreCode{etoolbox} ;
+ %\item \MontreCode{tikz} avec les librairies \MontreCode{tikzmark,calc,decorations.pathmorphing} ;
+ %\item \MontreCode{xstring} et \MontreCode{simplekv}.
\end{itemize}
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
@@ -184,10 +188,10 @@
{\small\faAngleDoubleRight}~\MontreCode{highlightx} est compatible avec les compilations usuelles en \textsf{latex}, \textsf{pdflatex}, \textsf{lualatex} ou \textsf{xelatex}.
-\medskip
+%\medskip
+%
+%{\small\faBomb}~Des erreurs peuvent apparaître lors de la compilation, dans ce cas une nouvelle compilation sera nécessaire afin de placer correctement les effets de surlignage !
-{\small\faBomb}~Des erreurs peuvent apparaître lors de la compilation, dans ce cas une nouvelle compilation sera nécessaire afin de placer correctement les effets de surlignage !
-
\subsection{Commandes disponibles}
Les commandes proposées par le package \MontreCode{highlightx} sont :
@@ -196,35 +200,36 @@
%Commande pour surligner une formule (mode math)
\SurlignerFormule
-%Commande pour surligner du texte
-\SurlignerTexte
-
%Commande pour surligner du texte de manière basique, sans effet
\genhighlightpar
\end{codehigh}
-\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
-Par exemple $\SurlignerFormule{f(x)=\displaystyle\frac{1}{1+x}}$.\\
-Ou bien :
+\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
+Par exemple une formule en ligne comme $\SurlignerFormule{f(x)=\displaystyle\frac{1}{1+x}}$.\\
+
+Ou bien encore une formule en mode hors-ligne comme :
+%
\[ \SurlignerFormule{A=\begin{pmatrix}1&2\\3&4\end{pmatrix}}. \]
+\end{demohigh}
-Et : \og \SurlignerTexte{Une scie à eau se compose d’un
+\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
+Et : \og \genhighlightpar{Une scie à eau se compose d’un
hangar au bord d’un ruisseau. Le toit est soutenu par une charpente qui porte sur quatre
gros piliers en bois. À huit ou dix pieds d’élévation, au milieu du hangar, on voit une
scie qui monte et descend, tandis qu’un mécanisme fort simple pousse contre cette scie
une pièce de bois.} \fg.
-\end{codehigh}
+\end{demohigh}
-Par exemple $\SurlignerFormule{f(x)=\displaystyle\frac{1}{1+x}}$.\\
-Ou bien :
-\[ \SurlignerFormule{A=\begin{pmatrix}1&2\\3&4\end{pmatrix}}. \]
+%Par exemple $\SurlignerFormule{f(x)=\displaystyle\frac{1}{1+x}}$.\\
+%Ou bien :
+%\[ \SurlignerFormule{A=\begin{pmatrix}1&2\\3&4\end{pmatrix}}. \]
+%
+%Et : \og \SurlignerTexte{Une scie à eau se compose d’un
+%hangar au bord d’un ruisseau. Le toit est soutenu par une charpente qui porte sur quatre
+%gros piliers en bois. À huit ou dix pieds d’élévation, au milieu du hangar, on voit une
+%scie qui monte et descend, tandis qu’un mécanisme fort simple pousse contre cette scie
+%une pièce de bois.} \fg.
-Et : \og \SurlignerTexte{Une scie à eau se compose d’un
-hangar au bord d’un ruisseau. Le toit est soutenu par une charpente qui porte sur quatre
-gros piliers en bois. À huit ou dix pieds d’élévation, au milieu du hangar, on voit une
-scie qui monte et descend, tandis qu’un mécanisme fort simple pousse contre cette scie
-une pièce de bois.} \fg.
-
\pagebreak
\section{Les commandes}
@@ -297,60 +302,62 @@
\tikzstyle{encadreformule}=[decorate,decoration={random steps,amplitude=0.5pt,segment length=1em}]
-\subsection{Surligner du texte, y compris multilignes}
+%\subsection{Surligner du texte, y compris multilignes}
+%
+%La commande dédiée à la mise en évidence d'une formule mathématique est \MontreCode{\textbackslash SurlignerTexte} :
+%
+%\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
+%%Commande pour surligner du texte
+%\SurlignerTexte[options tikz]{texte}
+%\end{codehigh}
+%
+%Concernant cette commande, pour laquelle le fonctionnement (interne) est très différent du mode \textit{math} :
+%
+%\begin{itemize}
+% \item les options tikz permettent de spécifier la couleur de fond et l'éventuelle couleur de bordure, grâce à \MontreCode{[couleurfond,draw=couleurbord]}.
+%\end{itemize}
+%
+%\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
+%%Paragraphes venant du site https://ipsum.one/
+%
+%Un premier paragraphe : \og \SurlignerTexte{Quand Julien aperçut les ruines pittoresques
+%de l’ancienne église de Vergy, il remarqua que depuis l’avant-veille il n’avait pas pensé
+%une seule fois à Mme de Rênal. L’autre jour en partant, cette femme m’a rappelé la distance
+%infinie qui nous sépare, elle m’a traité comme le fils d’un ouvrier. Sans doute elle a voulu
+%me marquer son repentir de m’avoir laissé sa main la veille... Elle est pourtant bien jolie,
+%cette main ! quel charme ! quelle noblesse dans les regards de cette femme !} \fg.
+%
+%Un deuxième paragraphe : \og \SurlignerTexte[teal!35,draw=red]{Ce ne fut que dans la nuit
+%du samedi au dimanche, après trois jours de pourparlers, que l’orgueil de l’abbé Maslon plia
+%devant la peur du maire qui se changeait en courage. Il fallut écrire une lettre mielleuse à
+%l’abbé Chélan, pour le prier d’assister à la cérémonie de la relique de Bray-le-Haut, si
+%toutefois son grand âge et ses infirmités le lui permettaient. M. Chélan demanda et obtint
+%une lettre d’invitation pour Julien qui devait l’accompagner en qualité de sous-diacre.} \fg.
+%\end{codehigh}
+%
+%Un premier paragraphe : \og \SurlignerTexte{Quand Julien aperçut les ruines pittoresques
+%de l’ancienne église de Vergy, il remarqua que depuis l’avant-veille il n’avait pas pensé
+%une seule fois à Mme de Rênal. L’autre jour en partant, cette femme m’a rappelé la distance
+%infinie qui nous sépare, elle m’a traité comme le fils d’un ouvrier. Sans doute elle a voulu
+%me marquer son repentir de m’avoir laissé sa main la veille... Elle est pourtant bien jolie,
+%cette main ! quel charme ! quelle noblesse dans les regards de cette femme !} \fg.
+%
+%\medskip
+%
+%Un deuxième paragraphe : \og \SurlignerTexte[teal!35,draw=red]{Ce ne fut que dans la nuit
+%du samedi au dimanche, après trois jours de pourparlers, que l’orgueil de l’abbé Maslon plia
+%devant la peur du maire qui se changeait en courage. Il fallut écrire une lettre mielleuse à
+%l’abbé Chélan, pour le prier d’assister à la cérémonie de la relique de Bray-le-Haut, si
+%toutefois son grand âge et ses infirmités le lui permettaient. M. Chélan demanda et obtint
+%une lettre d’invitation pour Julien qui devait l’accompagner en qualité de sous-diacre.} \fg.
-La commande dédiée à la mise en évidence d'une formule mathématique est \MontreCode{\textbackslash SurlignerTexte} :
+\pagebreak
-\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
-%Commande pour surligner du texte
-\SurlignerTexte[options tikz]{texte}
-\end{codehigh}
+\subsection{Surlignement \og classique \fg, d'un texte ou d'un paragraphe}
-Concernant cette commande, pour laquelle le fonctionnement (interne) est très différent du mode \textit{math} :
+Pour du surlignement multilignes, il est possible d'utiliser une commande \textit{générique}, qui utilise uniquement le package \MontreCode{soul} (donc pas d'effet !), qui est \MontreCode{\textbackslash genhighlightpar} (qui est basée \textit{basiquement} sur la commande \MontreCode{\textbackslash hl} du package \MontreCode{soul}).
-\begin{itemize}
- \item les options tikz permettent de spécifier la couleur de fond et l'éventuelle couleur de bordure, grâce à \MontreCode{[couleurfond,draw=couleurbord]}.
-\end{itemize}
-
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
-%Paragraphes venant du site https://ipsum.one/
-
-Un premier paragraphe : \og \SurlignerTexte{Quand Julien aperçut les ruines pittoresques
-de l’ancienne église de Vergy, il remarqua que depuis l’avant-veille il n’avait pas pensé
-une seule fois à Mme de Rênal. L’autre jour en partant, cette femme m’a rappelé la distance
-infinie qui nous sépare, elle m’a traité comme le fils d’un ouvrier. Sans doute elle a voulu
-me marquer son repentir de m’avoir laissé sa main la veille... Elle est pourtant bien jolie,
-cette main ! quel charme ! quelle noblesse dans les regards de cette femme !} \fg.
-
-Un deuxième paragraphe : \og \SurlignerTexte[teal!35,draw=red]{Ce ne fut que dans la nuit
-du samedi au dimanche, après trois jours de pourparlers, que l’orgueil de l’abbé Maslon plia
-devant la peur du maire qui se changeait en courage. Il fallut écrire une lettre mielleuse à
-l’abbé Chélan, pour le prier d’assister à la cérémonie de la relique de Bray-le-Haut, si
-toutefois son grand âge et ses infirmités le lui permettaient. M. Chélan demanda et obtint
-une lettre d’invitation pour Julien qui devait l’accompagner en qualité de sous-diacre.} \fg.
-\end{codehigh}
-
-Un premier paragraphe : \og \SurlignerTexte{Quand Julien aperçut les ruines pittoresques
-de l’ancienne église de Vergy, il remarqua que depuis l’avant-veille il n’avait pas pensé
-une seule fois à Mme de Rênal. L’autre jour en partant, cette femme m’a rappelé la distance
-infinie qui nous sépare, elle m’a traité comme le fils d’un ouvrier. Sans doute elle a voulu
-me marquer son repentir de m’avoir laissé sa main la veille... Elle est pourtant bien jolie,
-cette main ! quel charme ! quelle noblesse dans les regards de cette femme !} \fg.
-
-\medskip
-
-Un deuxième paragraphe : \og \SurlignerTexte[teal!35,draw=red]{Ce ne fut que dans la nuit
-du samedi au dimanche, après trois jours de pourparlers, que l’orgueil de l’abbé Maslon plia
-devant la peur du maire qui se changeait en courage. Il fallut écrire une lettre mielleuse à
-l’abbé Chélan, pour le prier d’assister à la cérémonie de la relique de Bray-le-Haut, si
-toutefois son grand âge et ses infirmités le lui permettaient. M. Chélan demanda et obtint
-une lettre d’invitation pour Julien qui devait l’accompagner en qualité de sous-diacre.} \fg.
-
-\subsection{Surlignement \og classique \fg, au cas où\ldots}
-
-Au cas où le surlignement multilignes précédent ne fonctionne pas (dans un environnement spécifique par exemple\ldots), il est possible d'utiliser une commande \textit{générique}, qui utilise uniquement le package \MontreCode{soul} (donc pas d'effet !), qui est \MontreCode{\textbackslash genhighlightpar}.
-
-\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
%Commande générique pour surligner du texte
\genhighlightpar[couleur]{texte}
\end{codehigh}
@@ -358,12 +365,12 @@
Concernant cette commande, le premier argument (optionnel) est la couleur de fond, et le second argument (obligatoire) est le texte à mettre en évidence.
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
-Un paragraphe : \og \genhighlightpar[orange!35]{Pour arriver à la considération publique
-à Verrières, l’essentiel est de ne pas adopter, tout en bâtissant beaucoup de murs, quelque
-plan apporté d’Italie par ces maçons, qui au printemps traversent les gorges du Jura pour
-gagner Paris. Une telle innovation vaudrait à l’imprudent bâtisseur une éternelle réputation
-de mauvaise tête, et il serait à jamais perdu auprès des gens sages et modérés qui distribuent
-la considération en Franche-Comté.} \fg.
+Un \genhighlightpar{paragraphe} : \og \genhighlightpar[orange!35]{Pour arriver à la
+considération publique à Verrières, l’essentiel est de ne pas adopter, tout en bâtissant
+beaucoup de murs, quelque plan apporté d’Italie par ces maçons, qui au printemps
+traversent les gorges du Jura pour gagner Paris. Une telle innovation vaudrait à
+l’imprudent bâtisseur une éternelle réputation de mauvaise tête, et il serait à jamais
+perdu auprès des gens sages et modérés qui distribuent la considération en Franche-Comté.} \fg.
\end{demohigh}
\pagebreak
@@ -378,9 +385,6 @@
%Hightlight formula (math mode)
\HighlightFormula
-%Highlight text
-\HighlightText
-
%Basic highlight text, without effect
\genhighlightpar
\end{codehigh}
@@ -432,51 +436,51 @@
\tikzstyle{borderformula}=[decorate,decoration={random steps,amplitude=0.5pt,segment length=1em}]
-\subsection{Highlight text}
+%\subsection{Highlight text}
+%
+%\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
+%%Highlight text, with effect
+%\HighlightText[tikz options]{text}
+%\end{codehigh}
+%
+%\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
+%%Paragraphs from https://ipsum.one/
+%
+%A first one : \HighlightText{In order to modify it, he has only to press his hand lightly
+%on a small wheel, measuring hardly a foot in diameter, and placed within his reach. Immediately
+%the valves open, the steam from the boilers rushes along the conducting tubes into the two
+%cylinders of the small engine, the pistons move rapidly, and the rudder instantly obeys.
+%If this plan succeeds, a man will be able to direct the gigantic body of the 'Great Eastern'
+%with one finge}.
+%
+%A second one : \HighlightText[teal!35,draw=red]{On Wednesday night the weather was very bad,
+%my balance was strangely variable, and I was obliged to lean with my knees and elbows against
+%the sideboard, to prevent myself from falling. Portmanteaus and bags came in and out of my cabin;
+%an unusual hubbub reigned in the adjoining saloon, in which two or three hundred packages were
+%making expeditions from one end to the other, knocking the tables and chairs with loud crashes;
+%doors slammed, the boards creaked, the partitions made that groaning noise peculiar to pine wood;
+%bottles and glasses jingled together in their racks, and a cataract of plates and dishes rolled
+%about on the pantry floors}.
+%\end{codehigh}
+%
+%A first one : \HighlightText{In order to modify it, he has only to press his hand lightly
+%on a small wheel, measuring hardly a foot in diameter, and placed within his reach. Immediately
+%the valves open, the steam from the boilers rushes along the conducting tubes into the two
+%cylinders of the small engine, the pistons move rapidly, and the rudder instantly obeys.
+%If this plan succeeds, a man will be able to direct the gigantic body of the 'Great Eastern'
+%with one finge}.
+%
+%\medskip
+%
+%A second one : \HighlightText[teal!35,draw=red]{On Wednesday night the weather was very bad,
+%my balance was strangely variable, and I was obliged to lean with my knees and elbows against
+%the sideboard, to prevent myself from falling. Portmanteaus and bags came in and out of my cabin ;
+%an unusual hubbub reigned in the adjoining saloon, in which two or three hundred packages were
+%making expeditions from one end to the other, knocking the tables and chairs with loud crashes ;
+%doors slammed, the boards creaked, the partitions made that groaning noise peculiar to pine wood ;
+%bottles and glasses jingled together in their racks, and a cataract of plates and dishes rolled
+%about on the pantry floors}.
-\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
-%Highlight text, with effect
-\HighlightText[tikz options]{text}
-\end{codehigh}
-
-\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
-%Paragraphs from https://ipsum.one/
-
-A first one : \HighlightText{In order to modify it, he has only to press his hand lightly
-on a small wheel, measuring hardly a foot in diameter, and placed within his reach. Immediately
-the valves open, the steam from the boilers rushes along the conducting tubes into the two
-cylinders of the small engine, the pistons move rapidly, and the rudder instantly obeys.
-If this plan succeeds, a man will be able to direct the gigantic body of the 'Great Eastern'
-with one finge}.
-
-A second one : \HighlightText[teal!35,draw=red]{On Wednesday night the weather was very bad,
-my balance was strangely variable, and I was obliged to lean with my knees and elbows against
-the sideboard, to prevent myself from falling. Portmanteaus and bags came in and out of my cabin;
-an unusual hubbub reigned in the adjoining saloon, in which two or three hundred packages were
-making expeditions from one end to the other, knocking the tables and chairs with loud crashes;
-doors slammed, the boards creaked, the partitions made that groaning noise peculiar to pine wood;
-bottles and glasses jingled together in their racks, and a cataract of plates and dishes rolled
-about on the pantry floors}.
-\end{codehigh}
-
-A first one : \HighlightText{In order to modify it, he has only to press his hand lightly
-on a small wheel, measuring hardly a foot in diameter, and placed within his reach. Immediately
-the valves open, the steam from the boilers rushes along the conducting tubes into the two
-cylinders of the small engine, the pistons move rapidly, and the rudder instantly obeys.
-If this plan succeeds, a man will be able to direct the gigantic body of the 'Great Eastern'
-with one finge}.
-
-\medskip
-
-A second one : \HighlightText[teal!35,draw=red]{On Wednesday night the weather was very bad,
-my balance was strangely variable, and I was obliged to lean with my knees and elbows against
-the sideboard, to prevent myself from falling. Portmanteaus and bags came in and out of my cabin ;
-an unusual hubbub reigned in the adjoining saloon, in which two or three hundred packages were
-making expeditions from one end to the other, knocking the tables and chairs with loud crashes ;
-doors slammed, the boards creaked, the partitions made that groaning noise peculiar to pine wood ;
-bottles and glasses jingled together in their racks, and a cataract of plates and dishes rolled
-about on the pantry floors}.
-
\subsection{Generic highlight, without effect}
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
Modified: trunk/Master/texmf-dist/tex/latex/highlightx/highlightx.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/highlightx/highlightx.sty 2023-09-01 21:15:20 UTC (rev 68137)
+++ trunk/Master/texmf-dist/tex/latex/highlightx/highlightx.sty 2023-09-01 21:15:30 UTC (rev 68138)
@@ -1,17 +1,15 @@
% Author : C. Pierquet
% licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
-% source : https://tex.stackexchange.com/questions/5959/cool-text-highlighting-in-latex
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{highlightx}[2023/08/31 0.1.0 Macros pour surligner du texte, meme en mode paragraphe]
+\ProvidesPackage{highlightx}[2023/09/01 0.1.1 Macros pour surligner du texte, meme en mode paragraphe]
%====HISTORIQUE
+% v 0.1.1 Suppression code paragraphe avec effet
% v 0.1.0 Version initiale [fr] et [en]
%====BASE
\RequirePackage{soul}
-\RequirePackage{atbegshi}
-\RequirePackage{etoolbox}
\RequirePackage{tikz}
\RequirePackage{xstring}
\RequirePackage{simplekv}
@@ -92,237 +90,9 @@
\end{tikzpicture}%
}
-%====COMMANDES POUR PARAGRAPHES SIMPLES (tcbox par exemple)
+%====COMMANDES POUR PARAGRAPHES SIMPLES (sans effet, pour du tcbox par exemple)
\NewDocumentCommand\genhighlightpar{ O{hlcolback} m }{%
{\sethlcolor{#1}\hl{#2}}%
}
-%====COMPTEURS ET VARIABLES
-\newlength{\txtdec at depth}
-\setlength{\txtdec at depth}{.5ex}
-\newlength{\txtdec at height}
-\setlength{\txtdec at height}{\f at size pt} % sensible default
-\newcounter{txtdec at hyphmark}
-\newcounter{txtdec at decormark}
-\setcounter{txtdec at decormark}{1}
-\newcounter{txtdec at hyphdraw}
-\setcounter{txtdec at hyphdraw}{1}
-\newcounter{txtdec at decordraw}
-\setcounter{txtdec at decordraw}{1}
-\newcounter{txtdec at thenextpage}
-\newtoggle{txtdec at unfinisheddecor}
-\newtoggle{txtdec at stayonpage}
-\newtoggle{txtdec at stayondecor}
-\newtoggle{txtdec at stayonline}
-
-%====COMMANDES AUXILIAIRES
-% from https://tex.stackexchange.com/a/33765/105447
-\newcommand{\gettikzxy}[3]{%
- \tikz at scan@one at point\pgfutil at firstofone#1\relax
- \edef#2{\the\pgf at x}%
- \edef#3{\the\pgf at y}%
-}
-
-% the drawing macros
-\tikzset{%
- defaultdecor/.style={%
- fill=hlcolback,
- decoration = {random steps, amplitude=0.5pt, segment length=1em},
- outer sep = -15pt,
- inner sep = 0pt,
- decorate}%
-}
-
-\newcommand{\txtdec at draw@all}{%
- \tikzset{thisdecor/.style/.expanded=\csuse{decor at tikz@style@\thetxtdec at decordraw}}%
- \path[defaultdecor, thisdecor]
- ($(\Xbegin,\Ybegin)+(0,-\txtdec at depth)$) rectangle
- ($(\Xend,\Yend)+(0,\txtdec at height-\txtdec at depth)$) ;
-}
-
-\newcommand{\txtdec at draw@begin}{%
- \tikzset{thisdecor/.style/.expanded=\csuse{decor at tikz@style@\thetxtdec at decordraw}}%
- \path[defaultdecor, thisdecor]
- ($(\Xbegin,\Ybegin)+(0,-\txtdec at depth)$) rectangle
- ($(\Xlineend,\Ylineend)+(0,\txtdec at height-\txtdec at depth)$) ;
-}
-
-\newcommand{\txtdec at draw@middle}{%
- \tikzset{thisdecor/.style/.expanded=\csuse{decor at tikz@style@\thetxtdec at decordraw}}%
- \path[defaultdecor, thisdecor]
- ($(\Xlinebegin,\Ylinebegin)+(0,-\txtdec at depth)$) rectangle
- ($(\Xlineend,\Ylineend)+(0,\txtdec at height-\txtdec at depth)$) ;
-}
-
-\newcommand{\txtdec at draw@end}{%
- \tikzset{thisdecor/.style/.expanded=\csuse{decor at tikz@style@\thetxtdec at decordraw}}%
- \path[defaultdecor, thisdecor]
- ($(\Xlinebegin,\Ylinebegin)+(0,-\txtdec at depth)$) rectangle
- ($(\Xend,\Yend)+(0,\txtdec at height-\txtdec at depth)$) ;
-}
-
-% using soul to set tikzmarks
-\def\SOUL at tdleaders{%
- \stepcounter{txtdec at hyphmark}%
- \tikzmark{p\thepage.d\arabic{txtdec at decormark}.\arabic{txtdec at hyphmark}}%
- \leaders\hrule\@depth\z@\@height\z@\relax
-}
-\def\SOUL at tdunderline#1{{%
- \setbox\z@\hbox{#1}%
- \dimen@=\wd\z@
- \dimen at i=\SOUL at uloverlap
- \advance\dimen at 2\dimen at i
- \rlap{%
- \null
- \kern-\dimen at i
- \SOUL at ulcolor{\SOUL at tdleaders\hskip\dimen@}%
- \hskip\dimen@
- }%
- \unhcopy\z@
-}}
-\def\SOUL at tdpreamble{%
- \spaceskip\SOUL at spaceskip
- \setcounter{txtdec at hyphmark}{0}%
- \tikzmark{p\thepage.d\arabic{txtdec at decormark}.begin}%
-}
-\def\SOUL at tdeverysyllable{%
- \SOUL at tdunderline{%
- \the\SOUL at syllable
- \SOUL at setkern\SOUL at charkern
- }%
- \stepcounter{txtdec at hyphmark}%
- \tikzmark{p\thepage.d\arabic{txtdec at decormark}.\arabic{txtdec at hyphmark}}%
-}
-\def\SOUL at tdeveryhyphen{%
- \discretionary{%
- \unkern
- \SOUL at tdunderline{%
- \SOUL at setkern\SOUL at hyphkern
- \SOUL at sethyphenchar
- }%
- \stepcounter{txtdec at hyphmark}%
- \tikzmark{p\thepage.d\arabic{txtdec at decormark}.\arabic{txtdec at hyphmark}}%
- }{}{}%
-}
-\def\SOUL at tdeveryexhyphen#1{%
- \SOUL at setkern\SOUL at hyphkern
- \SOUL at tdunderline{#1}%
- \stepcounter{txtdec at hyphmark}%
- \tikzmark{p\thepage.d\arabic{txtdec at decormark}.\arabic{txtdec at hyphmark}}%
- \discretionary{}{}{%
- \SOUL at setkern\SOUL at charkern
- }%
-}
-\def\SOUL at tdpostamble{%
- % create an extra mark, vertically displaced, to create an exit condition for the last line
- \stepcounter{txtdec at hyphmark}%
- \raisebox{-5pt}{\tikzmark{p\thepage.d\arabic{txtdec at decormark}.\arabic{txtdec at hyphmark}}}%
- \tikzmark{p\thepage.d\arabic{txtdec at decormark}.end}%
- \stepcounter{txtdec at decormark}%
-}
-\def\SOUL at tdsetup{%
- \SOUL at setup
- \let\SOUL at preamble\SOUL at tdpreamble
- \let\SOUL at everysyllable\SOUL at tdeverysyllable
- \let\SOUL at everyhyphen\SOUL at tdeveryhyphen
- \let\SOUL at everyexhyphen\SOUL at tdeveryexhyphen
- \let\SOUL at postamble\SOUL at tdpostamble
-}
-
-%====COMMANDES PRINCIPALES
-\DeclareRobustCommand*\SurlignerTexte[1][]{%
- \csxdef{decor at tikz@style@\thetxtdec at decormark}{#1}%
- \csxdef{decor at fsize@\thetxtdec at decormark}{\f at size pt}%
- \SOUL at tdsetup\SOUL@%
-}
-
-\DeclareRobustCommand*\HighlightText[1][]{%
- \csxdef{decor at tikz@style@\thetxtdec at decormark}{#1}%
- \csxdef{decor at fsize@\thetxtdec at decormark}{\f at size pt}%
- \SOUL at tdsetup\SOUL@%
-}
-
-\AtBeginShipout{%
- \AtBeginShipoutUpperLeft{%
- % getting the number of the next page
- \setcounter{txtdec at thenextpage}{\thepage}%
- \stepcounter{txtdec at thenextpage}%
- % if the current decoration occurs on this page, stay on it
- \iftikzmark{p\thepage.d\arabic{txtdec at decordraw}.\arabic{txtdec at hyphdraw}}{%
- \toggletrue{txtdec at stayonpage}}{}%
- \whileboolexpr{togl {txtdec at stayonpage}}{%
- \begin{tikzpicture}[remember picture, overlay]
- \setlength{\txtdec at height}{\csuse{decor at fsize@\thetxtdec at decordraw}}%
- \iftikzmark{p\thepage.d\arabic{txtdec at decordraw}.begin}{%
- % if current decor begins in current page, get coordinates
- \gettikzxy{(pic cs:p\thepage.d\arabic{txtdec at decordraw}.begin)}{\Xbegin}{\Ybegin}}{%
- % if current decor begins in previous page, set to top left of the page
- \gettikzxy{(current page.north west)}{\Xbegin}{\Ybegin}}%
- \iftikzmark{p\thepage.d\arabic{txtdec at decordraw}.end}{%
- % if current decor ends in current page, get coordinates
- \gettikzxy{(pic cs:p\thepage.d\arabic{txtdec at decordraw}.end)}{\Xend}{\Yend}}{%
- % if current decor ends in future page, set to bottom right of the page
- \gettikzxy{(current page.south east)}{\Xend}{\Yend}}%
- \ifdim\Ybegin=\Yend % the simplest case, a single line
- \txtdec at draw@all
- \stepcounter{txtdec at decordraw}%
- \else % current textdecor has a line break
- \toggletrue{txtdec at stayondecor}%
- \whileboolexpr{togl {txtdec at stayondecor}}{%
- \gettikzxy{(pic cs:p\thepage.d\arabic{txtdec at decordraw}.\arabic{txtdec at hyphdraw})}{\Xlinebegin}{\Ylinebegin}%
- \edef\Xcurrent{\Xlinebegin}%
- \edef\Ycurrent{\Ylinebegin}%
- \edef\Xnext{\Xcurrent}%
- \edef\Ynext{\Ycurrent}%
- \toggletrue{txtdec at stayonline}%
- \whileboolexpr{togl {txtdec at stayonline}}{%
- \ifdim\Ycurrent=\Ynext
- \stepcounter{txtdec at hyphdraw}%
- % if the following tikzmark exists, we are at a page break
- \iftikzmark{p\arabic{txtdec at thenextpage}.d\arabic{txtdec at decordraw}.\arabic{txtdec at hyphdraw}}{%
- \edef\Xcurrent{\Xnext}%
- \edef\Ycurrent{\Ynext}%
- \gettikzxy{(current page.south east)}{\Xnext}{\Ynext}
- \togglefalse{txtdec at stayondecor}%
- }{% else, we remain on the same page
- \iftikzmark{p\thepage.d\arabic{txtdec at decordraw}.\arabic{txtdec at hyphdraw}}{%
- \edef\Xcurrent{\Xnext}%
- \edef\Ycurrent{\Ynext}%
- \gettikzxy{(pic cs:p\thepage.d\arabic{txtdec at decordraw}.\arabic{txtdec at hyphdraw})}{\Xnext}{\Ynext}}{}%
- }%
- \else
- \edef\Xlineend{\Xcurrent}%
- \edef\Ylineend{\Ycurrent}%
- % if we are on the first line of the current decoration
- \ifdim\Ylinebegin=\Ybegin
- \txtdec at draw@begin
- \else
- % if we are on the last line of the current decoration
- \ifdim\Ycurrent=\Yend
- \txtdec at draw@end
- \stepcounter{txtdec at decordraw}%
- \setcounter{txtdec at hyphdraw}{1}%
- \togglefalse{txtdec at stayondecor}%
- % if we are in a middle line of the decoration
- \else
- \txtdec at draw@middle
- \fi
- \fi
- \togglefalse{txtdec at stayonline}%
- \fi
- }%
- }%
- \fi
- \end{tikzpicture}%
- % if the beginning of the next decor does not exist in this page, leave this page
- \iftikzmark{p\thepage.d\arabic{txtdec at decordraw}.begin}{}{%
- \togglefalse{txtdec at stayonpage}}%
- % if the continuation of the current decor exists in the next page, leave this page
- \iftikzmark{p\arabic{txtdec at thenextpage}.d\arabic{txtdec at decordraw}.\arabic{txtdec at hyphdraw}}{%
- \togglefalse{txtdec at stayonpage}}{}%
- }%
- }%
-}
-
-
\endinput
\ No newline at end of file
More information about the tex-live-commits
mailing list.