diff docs/lexer-algpseudocode.rst @ 187:418846a2623c

Also link to exampled from the PDF properly
author Franz Glasner <fzglas.hg@dom66.de>
date Tue, 12 May 2026 21:07:42 +0200
parents 95754197f5b3
children 156bcd310596
line wrap: on
line diff
--- a/docs/lexer-algpseudocode.rst	Tue May 12 20:22:47 2026 +0200
+++ b/docs/lexer-algpseudocode.rst	Tue May 12 21:07:42 2026 +0200
@@ -540,8 +540,15 @@
 Some Examples
 =============
 
-A synthetic example with many features
-(its source code is in :download:`examples/example-1.pseudocode`):
+A synthetic example with many features.
+
+.. only:: builder_html
+
+   Its source code is in :download:`examples/example-1.pseudocode`.
+
+.. raw:: latex
+
+   Its source code can be found at \url{example-1.pseudocode}.
 
 .. literalinclude:: examples/example-1.pseudocode
    :language: algpseudocode
@@ -556,15 +563,30 @@
 
 The second example is Wikipedia's description of *Dinic's Algorithm*
 (see https://en.wikipedia.org/wiki/Dinic%27s_algorithm).
-Its source code is in :download:`examples/algorithm-dinic.description`:
+
+.. only:: builder_html
+
+   Its source code is in :download:`examples/algorithm-dinic.pseudocode`.
 
-.. literalinclude:: examples/algorithm-dinic.description
+.. raw:: latex
+
+   Its source code can be found at \url{algorithm-dinic.pseudocode}
+
+.. literalinclude:: examples/algorithm-dinic.pseudocode
    :language: algpseudocode
    :lines: 2-
 
 The third example is Wikipedia's pseudocode of the *Ford–Fulkerson Algorithm*
 (see https://en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algorithm).
-Its source code is in :download:`examples/algorithm-ford-fulkerson.pseudocode`:
+
+.. only:: builder_html
+
+   Its source code is in
+   :download:`examples/algorithm-ford-fulkerson.pseudocode`.
+
+.. raw:: latex
+
+   Its source code can be found at \url{algorithm-ford-fulkerson.pseudocode}.
 
 .. literalinclude:: examples/algorithm-ford-fulkerson.pseudocode
    :language: algpseudocode
@@ -573,7 +595,15 @@
 The fourth example is Wikipedia's pseudocode of the *Edmonds–Karp Algorithm*
 (see https://en.wikipedia.org/wiki/Edmonds%E2%80%93Karp_algorithm)
 with a custom lexer that skip all ``ENDxxx`` keywords.
-Its source code is in :download:`examples/algorithm-edmonds-karp.pseudocode`:
+
+.. only:: builder_html
+
+   Its source code is in
+   :download:`examples/algorithm-edmonds-karp.pseudocode`.
+
+.. raw:: latex
+
+   Its source code can be found at \url{algorithm-edmonds-karp.pseudocode}.
 
 .. literalinclude:: examples/algorithm-edmonds-karp.pseudocode
    :language: NoEndAlgPseudocode