Skip to content

Commit 673e49a

Browse files
authored
Merge pull request #1269 from muzimuzhi/short-verb
Adapt short verb usages
2 parents 72fe1f7 + 4e28977 commit 673e49a

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

doc/generic/pgf/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1818
### Changed
1919

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

2223
### Contributors
2324

doc/generic/pgf/pgfmanual-en-base-shadings.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ \subsubsection{General (Functional) Shadings}
357357
defined, which store the individual components of \meta{color name}.
358358
These can also be used in the \meta{type 4 function} argument.
359359
%
360-
\begin{codeexample}[]
360+
\begin{codeexample}[preamble={\usepackage{shortvrb} \MakeShortVerb{\|}}]
361361
\pgfshadecolortorgb{orange}{\mycol}
362362
|\mycol|=\mycol |\mycolred|=\mycolred |\mycolgreen|=\mycolgreen |\mycolblue|=\mycolblue
363363
\end{codeexample}

doc/generic/pgf/pgfmanual-en-pgfkeys.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -565,12 +565,12 @@ \subsubsection{Keys That Execute Commands}
565565
``\meta{text}|+|\meta{more text}'' and wishes to store \meta{text} and
566566
\meta{more text} in two different macros. This can be achieved as follows:
567567
%
568-
\begin{codeexample}[]
568+
\begin{codeexample}[preamble={\usepackage{shortvrb} \MakeShortVerb{\|}}]
569569
\def\mystore#1+#2\pgfeov{\def\a{#1}\def\b{#2}}
570570
\pgfkeyslet{/my key/.@cmd}{\mystore}
571571
\pgfkeys{/my key=hello+world}
572572

573-
|\a| is \a, |\b| is \b.
573+
|\a| is `\a', |\b| is `\b'.
574574
\end{codeexample}
575575

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

631-
|\a| is \a, |\b| is \b.
631+
|\a| is `\a', |\b| is `\b'.
632632
\end{codeexample}
633633
%
634634
Note that |\pgfkeysdefnargs| is \emph{better} when it comes to simple

doc/generic/pgf/pgfmanual-en-tikz-coordinates.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -380,11 +380,11 @@ \subsubsection{Node Coordinate System}
380380
Specifies an anchor of the node. Here is an example:
381381
%
382382
\begin{codeexample}[preamble={\usetikzlibrary{arrows.meta}}]
383-
\begin{tikzpicture}
384-
\node (shape) at (0,2) [draw] {|class Shape|};
385-
\node (rect) at (-2,0) [draw] {|class Rectangle|};
386-
\node (circle) at (2,0) [draw] {|class Circle|};
387-
\node (ellipse) at (6,0) [draw] {|class Ellipse|};
383+
\begin{tikzpicture}[node font=\ttfamily]
384+
\node (shape) at (0,2) [draw] {class Shape};
385+
\node (rect) at (-2,0) [draw] {class Rectangle};
386+
\node (circle) at (2,0) [draw] {class Circle};
387+
\node (ellipse) at (6,0) [draw] {class Ellipse};
388388

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

0 commit comments

Comments
 (0)