Skip to content

Commit 6c7aaa6

Browse files
committed
Trying to get LaTeX to show the internal links
Without success, so far
1 parent 09f021a commit 6c7aaa6

9 files changed

Lines changed: 22 additions & 10 deletions

File tree

04_data.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,8 @@ function)))As we've seen, `Math` is a grab-bag of number-related
975975
utility functions, such as `Math.max` (maximum), `Math.min` (minimum),
976976
and `Math.sqrt` (square root).
977977

978-
[[namespace_pollution]](((namespace)))(((namespace pollution)))The
978+
[[namespace_pollution]]
979+
(((namespace)))(((namespace pollution)))The
979980
`Math` object is used simply as a container to group a bunch of
980981
related functionality. There is only one `Math` object, and it is
981982
almost never useful as a value. Rather, it provides a _namespace_ so

06_object.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,8 @@ console.log(drawTable(dataTable(MOUNTAINS)));
786786
// … etcetera
787787
----
788788

789-
[[keys]]The standard `Object.keys` function returns an array of
789+
[[keys]]
790+
The standard `Object.keys` function returns an array of
790791
property names in an object. The top row of the table must contain
791792
underlined cells that give the names of the columns. Below that, the
792793
values of all the objects in the data set appear as normal cells—we

10_modules.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ and distributes hundreds of thousands of such libraries, allowing you to
128128
search for the functionality you need, and, once you find it, set up
129129
your project to automatically download it.
130130

131-
[[modules_npm]](((NPM)))This service exists. It is called _NPM_ (http://npmjs.org[_npmjs.org_]).
131+
[[modules_npm]]
132+
(((NPM)))This service exists. It is called _NPM_ (http://npmjs.org[_npmjs.org_]).
132133
NPM consists of an online database of modules, and a tool for
133134
downloading and upgrading the modules your program depends on. It grew
134135
out of Node.js, the browser-less JavaScript environment we will discuss in

14_event.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ mouse as you moved it across the page.
904904

905905
In this exercise, I want you to implement a mouse trail. Use
906906
absolutely positioned `<div>` elements with a fixed size and
907-
background color (refer back to the link:#mouse_drawing[code] in the
907+
background color (refer back to the link:14_event.html#mouse_drawing[code] in the
908908
section on mouse click events for an example). Create twelve such
909909
elements, and when the mouse moves, display them in the wake of the
910910
mouse pointer, somehow.

asciidoc_html.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ rdquo=”
1818

1919
[macros]
2020
(?su)(?<!\w)indexsee:\[(?P<attrlist>[^\]]*?)\]=indexsee
21-
\(!html (?P<text>.*?)!\)=htmlonly
22-
\(!tex (?P<text>.*?)!\)=texonly
21+
\(!html (?P<text>(?:.|\n)*?)!\)=htmlonly
22+
\(!tex (?P<text>(?:.|\n)*?)!\)=texonly
2323

2424
[replacements]
2525
(\w)\'(\w)=\1’\2

asciidoc_latex.conf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ rdquo=”
1919

2020
[macros]
2121
(?su)(?<!\w)indexsee:\[(?P<attrlist>[^\]]*?)\]=indexsee
22-
\(!html (?P<text>.*?)!\)=htmlonly
23-
\(!tex (?P<text>.*?)!\)=texonly
22+
\(!html (?P<text>(?:.|\n)*?)!\)=htmlonly
23+
\(!tex (?P<text>(?:.|\n)*?)!\)=texonly
2424

2525
[tags]
2626
superscript=^!..braceleft..!|!..braceright..!
@@ -29,6 +29,9 @@ subscript=_!..braceleft..!|!..braceright..!
2929
[quotes]
3030
`=#monospaced
3131

32+
[link-inlinemacro]
33+
!..backslash..!hyperlink!..braceleft..!{target}!..braceright..!!..braceleft..!{0}!..braceright..!
34+
3235
[indexsee-inlinemacro]
3336
!..backslash..!index!..braceleft..!{1}|see!..braceleft..!{2}!..braceright..!!..braceright..!
3437

bin/clean_latex.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ process.stdin.on("data", function(chunk) {
1818
});
1919
process.stdin.on("end", function() {
2020
checkUnicode(input);
21-
input = input.replace(/(\n\n\\end{Code})|(\n{3,})|(_why,)|(\\chapter\{Introduction\})/g, function(all, codeSpace, manyBlanks, why, intro) {
21+
input = input.replace(/(\n\n\\end{Code})|(\n{3,})|(_why,)|(\\chapter\{Introduction\})|\\hyperlink\{((?:[^{]|\\_\{\})+)\}/g, function(all, codeSpace, manyBlanks, why, intro, link) {
2222
if (codeSpace)
2323
return codeSpace.slice(1);
2424
if (manyBlanks)
@@ -27,6 +27,8 @@ process.stdin.on("end", function() {
2727
return "\\_why,";
2828
if (intro)
2929
return "\\chapter*{Introduction}";
30+
if (link)
31+
return "\\hyperlink{" + link.replace(/\\_\{\}/g, "_") + "}";
3032
});
3133
input = input.replace(/({\\hspace\*\{.+?\}\\itshape``)\s*([^]+?)\s*('')/g, "$1$2$3");
3234

bin/pre_latex.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ process.stdin.on("data", function(chunk) {
1111
input += chunk;
1212
});
1313
process.stdin.on("end", function() {
14-
process.stdout.write(input.replace(/\n===? (.*?) ===?|([.,:;])|\nimage::img\/(.+?)\.(svg)/g, function(match, title, quoted, imgName, imgType) {
14+
process.stdout.write(input.replace(/\n===? (.*?) ===?|([.,:;])|\nimage::img\/(.+?)\.(svg)|link:[^\.]+\.html#(.*?)\[/g, function(match, title, quoted, imgName, imgType, link) {
1515
if (title) { // Section title, must be converted to title case
1616
var kind = /^\n(=*)/.exec(match)[1];
1717
return "\n" + kind + " " + title.split(" ").map(function(word) {
@@ -24,6 +24,8 @@ process.stdin.on("end", function() {
2424
return quoted + "”";
2525
} else if (imgName) { // Image file
2626
return "\nimage::" + convertImage(imgName, imgType);
27+
} else if (link) {
28+
return "link:" + link + "[";
2729
}
2830
}));
2931
});

tex/book/book.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@
127127
128128
\input{../20_node.tex}
129129
130+
\input{../21_skillsharing.tex}
131+
130132
\backmatter
131133
132134
\nocite{*}

0 commit comments

Comments
 (0)