Skip to content

Commit

Permalink
with this patch :idx: can be used for the index generation for LaTeX (n…
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq authored and PMunch committed Mar 28, 2022
1 parent 9c3a409 commit 944b97a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions config/nimdoc.tex.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# (c) 2012 Andreas Rumpf
# Feel free to edit the templates as you need.

split.item.toc = "20"
split.item.toc = "20"
# too long entries in the table of contents wrap around
# after this number of characters

Expand Down Expand Up @@ -97,12 +97,14 @@ doc.file = """
\usepackage{parskip} % paragraphs delimited by vertical space, no indent
\usepackage{graphicx}
\newcommand{\nimindexterm}[2]{#2\label{#1}}
\usepackage{dingbat} % for \carriagereturn, etc
\usepackage{fvextra} % for code blocks (works better than original fancyvrb)
\fvset{
breaklines,
breakafter={=}:|\_\{\}[](){,}.;+-*/'",
breaksymbolleft=\color{red}{\ensuremath{\hookrightarrow}},
breaksymbolleft=\color{red}{\ensuremath{\hookrightarrow}},
breaksymbolright=\color{red}{\small\carriagereturn}
}
\fvinlineset{%
Expand Down
2 changes: 1 addition & 1 deletion lib/packages/docutils/rstgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ proc renderIndexTerm*(d: PDoc, n: PRstNode, result: var string) =
var term = ""
renderAux(d, n, term)
setIndexTerm(d, changeFileExt(extractFilename(d.filename), HtmlExt), id, term, d.currentSection)
dispA(d.target, result, "<span id=\"$1\">$2</span>", "$2\\label{$1}",
dispA(d.target, result, "<span id=\"$1\">$2</span>", "\\nimindexterm{$2}{$1}",
[id, term])

type
Expand Down

0 comments on commit 944b97a

Please sign in to comment.