Skip to content

Commit

Permalink
Merge pull request #1269 from muzimuzhi/short-verb
Browse files Browse the repository at this point in the history
Adapt short verb usages
  • Loading branch information
hmenke authored Oct 23, 2023
2 parents 72fe1f7 + 4e28977 commit 673e49a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions doc/generic/pgf/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed

- Typo fixes in the manual
- Simplify short verb `|...|` or add required preamble for it

### Contributors

Expand Down
2 changes: 1 addition & 1 deletion doc/generic/pgf/pgfmanual-en-base-shadings.tex
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ \subsubsection{General (Functional) Shadings}
defined, which store the individual components of \meta{color name}.
These can also be used in the \meta{type 4 function} argument.
%
\begin{codeexample}[]
\begin{codeexample}[preamble={\usepackage{shortvrb} \MakeShortVerb{\|}}]
\pgfshadecolortorgb{orange}{\mycol}
|\mycol|=\mycol |\mycolred|=\mycolred |\mycolgreen|=\mycolgreen |\mycolblue|=\mycolblue
\end{codeexample}
Expand Down
10 changes: 5 additions & 5 deletions doc/generic/pgf/pgfmanual-en-pgfkeys.tex
Original file line number Diff line number Diff line change
Expand Up @@ -565,12 +565,12 @@ \subsubsection{Keys That Execute Commands}
``\meta{text}|+|\meta{more text}'' and wishes to store \meta{text} and
\meta{more text} in two different macros. This can be achieved as follows:
%
\begin{codeexample}[]
\begin{codeexample}[preamble={\usepackage{shortvrb} \MakeShortVerb{\|}}]
\def\mystore#1+#2\pgfeov{\def\a{#1}\def\b{#2}}
\pgfkeyslet{/my key/.@cmd}{\mystore}
\pgfkeys{/my key=hello+world}

|\a| is \a, |\b| is \b.
|\a| is `\a', |\b| is `\b'.
\end{codeexample}

Naturally, defining the code to be stored in a key in the above manner is too
Expand Down Expand Up @@ -604,7 +604,7 @@ \subsubsection{Keys That Execute Commands}
This command works like |\pgfkeysdef|, but it allows you to provide an
arbitrary \meta{argument count} between $0$ and $9$ (inclusive).
%
\begin{codeexample}[]
\begin{codeexample}[preamble={\usepackage{shortvrb} \MakeShortVerb{\|}}]
\pgfkeysdefnargs{/my key}{2}{\def\a{#1}\def\b{#2}}
\pgfkeys{/my key=
{hello}
Expand All @@ -624,11 +624,11 @@ \subsubsection{Keys That Execute Commands}
This command works like |\pgfkeysdefnargs|, but it allows you to provide an
arbitrary \meta{argument pattern} rather than just a number of arguments.
%
\begin{codeexample}[]
\begin{codeexample}[preamble={\usepackage{shortvrb} \MakeShortVerb{\|}}]
\pgfkeysdefargs{/my key}{#1+#2}{\def\a{#1}\def\b{#2}}
\pgfkeys{/my key=hello+world}

|\a| is \a, |\b| is \b.
|\a| is `\a', |\b| is `\b'.
\end{codeexample}
%
Note that |\pgfkeysdefnargs| is \emph{better} when it comes to simple
Expand Down
10 changes: 5 additions & 5 deletions doc/generic/pgf/pgfmanual-en-tikz-coordinates.tex
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,11 @@ \subsubsection{Node Coordinate System}
Specifies an anchor of the node. Here is an example:
%
\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
\begin{tikzpicture}
\node (shape) at (0,2) [draw] {|class Shape|};
\node (rect) at (-2,0) [draw] {|class Rectangle|};
\node (circle) at (2,0) [draw] {|class Circle|};
\node (ellipse) at (6,0) [draw] {|class Ellipse|};
\begin{tikzpicture}[node font=\ttfamily]
\node (shape) at (0,2) [draw] {class Shape};
\node (rect) at (-2,0) [draw] {class Rectangle};
\node (circle) at (2,0) [draw] {class Circle};
\node (ellipse) at (6,0) [draw] {class Ellipse};

\draw (node cs:name=circle,anchor=north) |- (0,1);
\draw (node cs:name=ellipse,anchor=north) |- (0,1);
Expand Down

0 comments on commit 673e49a

Please sign in to comment.