summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-11-09 22:02:31 +0000
committerKarl Berry <karl@freefriends.org>2023-11-09 22:02:31 +0000
commit2f55b10b524d38fb118dcc45d26c10ff3ec89248 (patch)
treee8c28eac85399437d5ac439eae7ae48d3d151f79 /Master
parent61db6be356363b8647d54397e03383e4615a2d95 (diff)
highlightx (9nov23)
git-svn-id: svn://tug.org/texlive/trunk@68756 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/highlightx/highlightx-doc.pdfbin180449 -> 181759 bytes
-rw-r--r--Master/texmf-dist/doc/latex/highlightx/highlightx-doc.tex73
-rw-r--r--Master/texmf-dist/tex/latex/highlightx/highlightx.sty51
3 files changed, 65 insertions, 59 deletions
diff --git a/Master/texmf-dist/doc/latex/highlightx/highlightx-doc.pdf b/Master/texmf-dist/doc/latex/highlightx/highlightx-doc.pdf
index 7409fe0f351..c842d6c8933 100644
--- a/Master/texmf-dist/doc/latex/highlightx/highlightx-doc.pdf
+++ b/Master/texmf-dist/doc/latex/highlightx/highlightx-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/highlightx/highlightx-doc.tex b/Master/texmf-dist/doc/latex/highlightx/highlightx-doc.tex
index 45115b309a9..71df6851a02 100644
--- a/Master/texmf-dist/doc/latex/highlightx/highlightx-doc.tex
+++ b/Master/texmf-dist/doc/latex/highlightx/highlightx-doc.tex
@@ -33,8 +33,8 @@
\hypersetup{pdfborder=0 0 0}
\usepackage[margin=1.5cm]{geometry}
\setlength{\parindent}{0pt}
-\def\TPversion{0.1.2}
-\def\TPdate{3 septembre 2023}
+\def\TPversion{0.1.5}
+\def\TPdate{9 novembre 2023}
\usepackage{tcolorbox}
\tcbuselibrary{skins,hooks}
\sethlcolor{lightgray!25}
@@ -75,6 +75,8 @@
\texttt{\url{https://github.com/cpierquet/highlightx}} \\
\\
\texttt{Merci à Antal Spector-Zabusky pour le code dédié aux paragraphes !}
+ \\
+ \texttt{Merci à Denis Bitouzé pour ses retours !}
\end{tabular}
\end{center}
@@ -168,18 +170,6 @@ L'idée du package \MontreCode{highlightx} est de proposer des commandes basique
{\small\faBomb}~Compte tenu du code utilisé pour le surlignage des paragraphes, il se peut que des dysfonctionnements apparaissent, notamment liés à \MontreCode{babel} et à l'utilisation de caractères \textit{actifs}.
-%{\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{;}.
-
-%{\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~
-
\subsection{Chargement}
Le package se charge dans le préambule, via \MontreCode{\textbackslash usepackage\{highlightx\}}.
@@ -189,9 +179,6 @@ Les seuls packages chargés sont :
\begin{itemize}
\item \MontreCode{soul}, \MontreCode{xstring} et \MontreCode{simplekv}.
\item \MontreCode{tikz} avec les librairies \MontreCode{tikzmark,calc,decorations.pathmorphing,nbabel}.
- %\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}
Si l'utilisateur ne souhaite pas charger la librairie \MontreCode{babel} de \TikZ, il suffit de charger le package avec l'option \MontreCode{[nobabel]}.
@@ -304,22 +291,28 @@ Le style \textit{main levée} est fixé par défaut, mais peut être modifié en
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
%Style main levée
-\tikzstyle{encadreformule}=[%
- decorate,decoration={random steps,amplitude=0.5pt,segment length=1em}]
+\tikzset{encadreformule/.style={%
+ decorate,decoration={random steps,amplitude=0.5pt,segment length=1em}}%
+}
\end{codehigh}
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
-\tikzstyle{encadreformule}=[%
- decorate,decoration={random steps,amplitude=4mm,segment length=10mm}]
+\tikzset{encadreformule/.style={%
+ decorate,decoration={random steps,amplitude=4mm,segment length=10mm}}%
+}
$\SurlignerFormule{f(x)=\displaystyle\frac{1}{1+x}}$
\end{codehigh}
-\tikzstyle{encadreformule}=[decorate,decoration={random steps,amplitude=4mm,segment length=10mm}]
+\tikzset{encadreformule/.style={%
+ decorate,decoration={random steps,amplitude=4mm,segment length=10mm}}%
+}
$\SurlignerFormule{f(x)=\displaystyle\frac{1}{1+x}}$
-\tikzstyle{encadreformule}=[decorate,decoration={random steps,amplitude=0.5pt,segment length=1em}]
+\tikzset{encadreformule/.style={%
+ decorate,decoration={random steps,amplitude=0.5pt,segment length=1em}}%
+}
\pagebreak
@@ -400,13 +393,15 @@ Le style \textit{main levée} est fixé par défaut, mais peut être modifié en
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
%Style main levée
-\tikzstyle{encadreformule}=[%
- decorate,decoration={random steps,amplitude=0.5pt,segment length=1em}]
+\tikzset{encadreformule/.style={%
+ decorate,decoration={random steps,amplitude=0.5pt,segment length=1em}}%
+}
\end{codehigh}
\begin{demohigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
-\tikzstyle{encadreformule}=[%
- decorate,decoration={random steps,amplitude=2mm,segment length=10mm}]
+\tikzset{encadreformule/.style={
+ decorate,decoration={random steps,amplitude=2mm,segment length=10mm}}%
+}
Un 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é
@@ -414,7 +409,9 @@ une seule fois à Mme de Rênal. L’autre jour en partant, cette femme m’a ra
distance infinie qui nous sépare, elle m’a traité comme le fils d’un ouvrier.} \fg
\end{demohigh}
-\tikzstyle{encadreformule}=[decorate,decoration={random steps,amplitude=0.5pt,segment length=1em}]
+\tikzset{encadreformule/.style={%
+ decorate,decoration={random steps,amplitude=0.5pt,segment length=1em}}%
+}
\pagebreak
@@ -428,7 +425,7 @@ There's also english versions of the commands and keys :
%Hightlight formula (math mode), with or without effect
\HighlightFormula
%Basic highlight text, with or without effect
-\TextHighlight
+\HighlightText
\end{codehigh}
\subsection{Highlight formula}
@@ -461,22 +458,28 @@ $\HighlightFormula*[text=red]{f(x)=\displaystyle\frac{1}{1+x}}$.
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
%handwriting style
-\tikzstyle{borderformula}=[%
- decorate,decoration={random steps,amplitude=0.5pt,segment length=1em}]
+\tikzset{borderformula/.style={%
+ decorate,decoration={random steps,amplitude=0.5pt,segment length=1em}}%
+}
\end{codehigh}
\begin{codehigh}[language=latex/latex2,style/main=cyan!10,style/code=cyan!10]
-\tikzstyle{borderformula}=[%
- decorate,decoration={random steps,amplitude=4mm,segment length=10mm}]
+\tikzset{borderformula/.style={%
+ decorate,decoration={random steps,amplitude=4mm,segment length=10mm}}%
+}
$\HighlightFormula{f(x)=\displaystyle\frac{1}{1+x}}$
\end{codehigh}
-\tikzstyle{borderformula}=[decorate,decoration={random steps,amplitude=4mm,segment length=10mm}]
+\tikzset{borderformula/.style={%
+ decorate,decoration={random steps,amplitude=4mm,segment length=10mm}}%
+}
$\HighlightFormula{f(x)=\displaystyle\frac{1}{1+x}}$
-\tikzstyle{borderformula}=[decorate,decoration={random steps,amplitude=0.5pt,segment length=1em}]
+\tikzset{borderformula/.style={%
+ decorate,decoration={random steps,amplitude=0.5pt,segment length=1em}}%
+}
\subsection{Highlight text or paragraphs, with or without effect}
diff --git a/Master/texmf-dist/tex/latex/highlightx/highlightx.sty b/Master/texmf-dist/tex/latex/highlightx/highlightx.sty
index caef0c0c569..d9af8868c2e 100644
--- a/Master/texmf-dist/tex/latex/highlightx/highlightx.sty
+++ b/Master/texmf-dist/tex/latex/highlightx/highlightx.sty
@@ -3,9 +3,12 @@
% licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{highlightx}[2023/09/03 0.1.2 Macros pour surligner du texte, meme en mode paragraphe]
+\ProvidesPackage{highlightx}[2023/11/09 0.1.5 Macros pour surligner du texte, meme en mode paragraphe]
%====HISTORIQUE
+% v 0.1.5 Mise à jour de la doc
+% v 0.1.4 Passage \tikzstyle vers \tikzset (merci à Sam C.)
+% v 0.1.3 Correction d'un bug avec le caractère ; (merci à Denis B.)
% v 0.1.2 Version étoilée pour \genhighlightpar afin d'activer \NoAutoSpacing + retour du code paragraphe main levée
% v 0.1.1 Suppression code paragraphe avec effet
% v 0.1.0 Version initiale [fr] et [en]
@@ -28,8 +31,8 @@
\colorlet{hlcolback}{yellow!35}
%====COMMANDES POUR FORMULES
-\tikzstyle{encadreformule}=[decorate,decoration={random steps,amplitude=0.5pt,segment length=1em}]
-\tikzstyle{borderformula}=[decorate,decoration={random steps,amplitude=0.5pt,segment length=1em}]
+\tikzset{encadreformule/.style={decorate,decoration={random steps,amplitude=0.5pt,segment length=1em}}}
+\tikzset{borderformula/.style={decorate,decoration={random steps,amplitude=0.5pt,segment length=1em}}}
\defKV[surlignformule]{%
Fond=\def\surlignformulefond{#1},%
@@ -145,15 +148,15 @@
}
\newcommand{\highlight@DoHighlight}{
- \fill[hlparhw] ($(begin highlight)+(-\surlignparoffsetH,1.05*\tmp@hauteur@char+\surlignparoffsetV)$) rectangle ($(end highlight)+(\surlignparoffsetH,-1.05*\tmp@profondeur@char-\surlignparoffsetV)$) ;
+ \fill[hlparhw] ($(begin highlight)+(-\surlignparoffsetH,1.05*\tmp@hauteur@char+\surlignparoffsetV)$) rectangle ($(end highlight)+(\surlignparoffsetH,-1.05*\tmp@profondeur@char-\surlignparoffsetV)$)
}
\newcommand{\highlight@BeginHighlight}{
- \coordinate (begin highlight) at (0,0) ;
+ \coordinate (begin highlight) at (0,0)
}
\newcommand{\highlight@EndHighlight}{
- \coordinate (end highlight) at (0,0) ;
+ \coordinate (end highlight) at (0,0)
}
\NewDocumentCommand\SurlignerTexte{ s O{} D<>{} }{%
@@ -184,15 +187,15 @@
%
\def\SOUL@preamble{%
\begin{tikzpicture}[overlay, remember picture]
- \highlight@BeginHighlight
- \highlight@EndHighlight
+ \highlight@BeginHighlight ;
+ \highlight@EndHighlight ;
\end{tikzpicture}%
}%
%
\def\SOUL@postamble{%
\begin{tikzpicture}[overlay, remember picture]
- \highlight@EndHighlight
- \highlight@DoHighlight
+ \highlight@EndHighlight ;
+ \highlight@DoHighlight ;
\end{tikzpicture}%
}%
%
@@ -200,7 +203,7 @@
\discretionary{%
\SOUL@setkern\SOUL@hyphkern
\SOUL@sethyphenchar
- \tikz[overlay, remember picture] \highlight@EndHighlight ;%
+ {\tikz[overlay, remember picture] \highlight@EndHighlight ;}%
}{%
}{%
\SOUL@setkern\SOUL@charkern
@@ -211,7 +214,7 @@
\SOUL@setkern\SOUL@hyphkern
\hbox{##1}%
\discretionary{%
- \tikz[overlay, remember picture] \highlight@EndHighlight ;%
+ {\tikz[overlay, remember picture] \highlight@EndHighlight ;}%
}{%
}{%
\SOUL@setkern\SOUL@charkern
@@ -225,12 +228,12 @@
\global\highlight@current =\y1
\endpgfextra (0,0) ;
\ifdim\highlight@current < \highlight@previous
- \highlight@DoHighlight
- \highlight@BeginHighlight
+ \highlight@DoHighlight ;
+ \highlight@BeginHighlight ;
\fi
\end{tikzpicture}%
\the\SOUL@syllable
- \tikz[overlay, remember picture] \highlight@EndHighlight ;%
+ {\tikz[overlay, remember picture] \highlight@EndHighlight ;}%
}%
\SOUL@
}
@@ -263,15 +266,15 @@
%
\def\SOUL@preamble{%
\begin{tikzpicture}[overlay, remember picture]
- \highlight@BeginHighlight
- \highlight@EndHighlight
+ \highlight@BeginHighlight ;
+ \highlight@EndHighlight ;
\end{tikzpicture}%
}%
%
\def\SOUL@postamble{%
\begin{tikzpicture}[overlay, remember picture]
- \highlight@EndHighlight
- \highlight@DoHighlight
+ \highlight@EndHighlight ;
+ \highlight@DoHighlight ;
\end{tikzpicture}%
}%
%
@@ -279,7 +282,7 @@
\discretionary{%
\SOUL@setkern\SOUL@hyphkern
\SOUL@sethyphenchar
- \tikz[overlay, remember picture] \highlight@EndHighlight ;%
+ {\tikz[overlay, remember picture] \highlight@EndHighlight ;}%
}{%
}{%
\SOUL@setkern\SOUL@charkern
@@ -290,7 +293,7 @@
\SOUL@setkern\SOUL@hyphkern
\hbox{##1}%
\discretionary{%
- \tikz[overlay, remember picture] \highlight@EndHighlight ;%
+ {\tikz[overlay, remember picture] \highlight@EndHighlight ;}%
}{%
}{%
\SOUL@setkern\SOUL@charkern
@@ -304,12 +307,12 @@
\global\highlight@current =\y1
\endpgfextra (0,0) ;
\ifdim\highlight@current < \highlight@previous
- \highlight@DoHighlight
- \highlight@BeginHighlight
+ \highlight@DoHighlight ;
+ \highlight@BeginHighlight ;
\fi
\end{tikzpicture}%
\the\SOUL@syllable
- \tikz[overlay, remember picture] \highlight@EndHighlight ;%
+ {\tikz[overlay, remember picture] \highlight@EndHighlight ;}%
}%
\SOUL@
}