├── crashes.org ├── .gitignore ├── progs ├── icon-stop.png ├── icon-stop.xcf ├── icon-notice.png ├── icon-notice.xcf ├── icon-caution.png ├── icon-caution.xcf ├── icon-notice-24.png ├── icon-notice-48.png ├── icon-stop-24.png ├── icon-stop-48.png ├── icon-caution-24.png ├── icon-caution-48.png ├── tm-zotero-kbd.scm ├── init-tm-zotero.scm ├── convert │ └── rtf │ │ ├── init-rtf.scm │ │ ├── rtftm.scm │ │ ├── latex.conf │ │ └── html.conf ├── init-legal-brief.scm ├── tm-zotero-menu.scm ├── compat │ └── guile-2.scm ├── tm-zotero │ ├── json │ │ ├── syntax.scm │ │ ├── builder.scm │ │ └── parser.scm │ ├── json.scm │ └── profile.scm ├── term │ └── ansi-color.scm ├── md5.scm └── legal-brief.scm ├── packages ├── tm-zotero.ts └── semantic-lawsuit.ts ├── styles └── legal-brief.ts ├── doc ├── tm-zotero-tutorial.en.pdf ├── tm-zotero.en.tm ├── tm-zotero-abstract.en.tm └── a-design-discussion-and-exploration.tm ├── .jshintrc ├── tests ├── test-clipboard-cut-paste-01 │ ├── test-clipboard-cut-paste.ts │ ├── test-clipboard-cut-paste.tm │ └── test-clipboard-cut-paste.scm ├── debug-ctrl-pagedown.tm └── sample-document-from-screencast.tm ├── .gitmodules ├── CSL-Citation.md ├── texmacs-zotero-bibtex ├── .dir-locals.el ├── README.md └── Notes.md /crashes.org: -------------------------------------------------------------------------------- 1 | ../../OrgzlyNotes/crashes.org -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | examples/temp.bbl 2 | api_key.txt 3 | api_secret.txt 4 | tests 5 | -------------------------------------------------------------------------------- /progs/icon-stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KarlHegbloom/zotero-texmacs-integration/HEAD/progs/icon-stop.png -------------------------------------------------------------------------------- /progs/icon-stop.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KarlHegbloom/zotero-texmacs-integration/HEAD/progs/icon-stop.xcf -------------------------------------------------------------------------------- /packages/tm-zotero.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KarlHegbloom/zotero-texmacs-integration/HEAD/packages/tm-zotero.ts -------------------------------------------------------------------------------- /progs/icon-notice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KarlHegbloom/zotero-texmacs-integration/HEAD/progs/icon-notice.png -------------------------------------------------------------------------------- /progs/icon-notice.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KarlHegbloom/zotero-texmacs-integration/HEAD/progs/icon-notice.xcf -------------------------------------------------------------------------------- /styles/legal-brief.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KarlHegbloom/zotero-texmacs-integration/HEAD/styles/legal-brief.ts -------------------------------------------------------------------------------- /progs/icon-caution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KarlHegbloom/zotero-texmacs-integration/HEAD/progs/icon-caution.png -------------------------------------------------------------------------------- /progs/icon-caution.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KarlHegbloom/zotero-texmacs-integration/HEAD/progs/icon-caution.xcf -------------------------------------------------------------------------------- /progs/icon-notice-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KarlHegbloom/zotero-texmacs-integration/HEAD/progs/icon-notice-24.png -------------------------------------------------------------------------------- /progs/icon-notice-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KarlHegbloom/zotero-texmacs-integration/HEAD/progs/icon-notice-48.png -------------------------------------------------------------------------------- /progs/icon-stop-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KarlHegbloom/zotero-texmacs-integration/HEAD/progs/icon-stop-24.png -------------------------------------------------------------------------------- /progs/icon-stop-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KarlHegbloom/zotero-texmacs-integration/HEAD/progs/icon-stop-48.png -------------------------------------------------------------------------------- /progs/icon-caution-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KarlHegbloom/zotero-texmacs-integration/HEAD/progs/icon-caution-24.png -------------------------------------------------------------------------------- /progs/icon-caution-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KarlHegbloom/zotero-texmacs-integration/HEAD/progs/icon-caution-48.png -------------------------------------------------------------------------------- /doc/tm-zotero-tutorial.en.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KarlHegbloom/zotero-texmacs-integration/HEAD/doc/tm-zotero-tutorial.en.pdf -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "moz": true, 3 | "esnext": true, 4 | "globals": {}, 5 | "globalstrict": false, 6 | "quotmark": true, 7 | "smarttabs": true, 8 | "trailing": true, 9 | "undef": true, 10 | "unused": true, 11 | "maxerr": 10000, 12 | "devel": true, 13 | "predef" : [ "require", "exports" ] 14 | } 15 | -------------------------------------------------------------------------------- /tests/test-clipboard-cut-paste-01/test-clipboard-cut-paste.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <\body> 6 | |>>> 7 | 8 | :>> 9 | 10 | \; 11 | 12 | 13 | <\initial> 14 | <\collection> 15 | 16 | 17 | -------------------------------------------------------------------------------- /progs/tm-zotero-kbd.scm: -------------------------------------------------------------------------------- 1 | ;;; coding: utf-8 2 | ;;; ✠ ✞ ♼ ☮ ☯ ☭ ☺ 3 | ;; 4 | ;; MODULE : tm-zotero-kbd.scm 5 | ;; DESCRIPTION : Zotero Connector Plugin, Key bindings 6 | ;; COPYRIGHT : (C) 2016 Karl M. Hegbloom 7 | ;; 8 | ;; This software falls under the GNU general public license version 3 or 9 | ;; later. It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file 10 | ;; LICENSE in the root directory or 11 | ;; 12 | ;;; 13 | 14 | (texmacs-module (tm-zotero-kbd) 15 | (:use (tm-zotero))) 16 | 17 | ;; NOT USED 18 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "propachi-texmacs"] 2 | path = propachi-texmacs 3 | url = git@github.com:KarlHegbloom/propachi-texmacs.git 4 | branch = propachi-texmacs-master 5 | [submodule "citeproc-js"] 6 | path = citeproc-js 7 | url = git@github.com:KarlHegbloom/citeproc-js.git 8 | branch = KarlHegbloom-propachi-texmacs 9 | [submodule "zotero"] 10 | path = zotero 11 | url = https://github.com/Juris-M/zotero.git 12 | branch = jurism-5.0 13 | [submodule "zotero-build"] 14 | path = zotero-build 15 | url = git@github.com:KarlHegbloom/zotero-build.git 16 | [submodule "zotero-standalone-build"] 17 | path = zotero-standalone-build 18 | url = git@github.com:KarlHegbloom/zotero-standalone-build.git 19 | -------------------------------------------------------------------------------- /progs/init-tm-zotero.scm: -------------------------------------------------------------------------------- 1 | ;;; coding: utf-8 2 | ;;; ✠ ✞ ♼ ☮ ☯ ☭ ☺ 3 | ;;; 4 | ;;; MODULE : init-tm-zotero.scm 5 | ;;; DESCRIPTION : Initialize Zotero Connector Plugin 6 | ;;; COPYRIGHT : (C) 2016 Karl M. Hegbloom 7 | ;;; 8 | ;;; This software falls under the GNU general public license version 3 or 9 | ;;; later. It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file 10 | ;;; LICENSE in the root directory or 11 | ;;; 12 | ;;;; 13 | 14 | (plugin-configure tm-zotero 15 | (:require #t)) 16 | 17 | 18 | ;; The tm-zotero.ts will load the tm-zotero.scm module, so simply adding it to 19 | ;; your document as a style package will cause the Zotero menu to appear, etc. 20 | ;; 21 | (when (supports-tm-zotero?) 22 | (import-from (tm-zotero)) 23 | (lazy-keyboard (tm-zotero-kbd) in-tm-zotero-style?) 24 | (lazy-menu (tm-zotero-menu) in-tm-zotero-style?) 25 | (extend-table style-menu-name 26 | ("tm-zotero" "Juris-M or Zotero Integration")) 27 | (extend-table style-synopsis 28 | ("tm-zotero" "TeXmacs Integration with Juris-M or Zotero Reference Manager"))) 29 | -------------------------------------------------------------------------------- /doc/tm-zotero.en.tm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <\body> 6 | <\tmdoc-title> 7 | > Juris-M / Zotero integration. 8 | 9 | Juris-M or Zotero refreence manager.> 11 | 12 | 13 | <\traverse> 14 | 15 | 16 | 17 | 18 | 19 | Hegbloom 20 | karl.hegbloom@gmail.com\>|mailto:karl.hegbloom@gmail.com>> 21 | 22 | 28 | 29 | 30 | <\initial> 31 | <\collection> 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /tests/test-clipboard-cut-paste-01/test-clipboard-cut-paste.tm: -------------------------------------------------------------------------------- 1 | 2 | 3 | > 4 | 5 | <\body> 6 | <\session|scheme|default> 7 | <\input|Scheme] > 8 | (load "test-clipboard-cut-paste.scm") 9 | 10 | 11 | <\unfolded-io|Scheme] > 12 | has-testtags? 13 | <|unfolded-io> 14 | #\procedure has-testtags? (t)\ 15 | 16 | 17 | <\input|Scheme] > 18 | (use-modules (test-clipboard-cut-paste)) 19 | 20 | 21 | <\unfolded-io|Scheme] > 22 | (in-test-clipboard-cut-paste-style?) 23 | <|unfolded-io> 24 | #f 25 | 26 | 27 | <\unfolded-io|Scheme] > 28 | (style-has? "test-clipboard-cut-paste-dtd") 29 | <|unfolded-io> 30 | #f 31 | 32 | 33 | <\input|Scheme] > 34 | \; 35 | 36 | 37 | 38 | |false>|Text> 39 | 40 | |false>|Text> 41 | 42 | <\testtag|+HMWPT2B3fKGXnK||false>> 43 | Text 44 | 45 | 46 | |false>|Text> 47 | 48 | \; 49 | 50 | \; 51 | 52 | 53 | <\initial> 54 | <\collection> 55 | 56 | 57 | -------------------------------------------------------------------------------- /progs/convert/rtf/init-rtf.scm: -------------------------------------------------------------------------------- 1 | ;;; coding: utf-8 2 | 3 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 4 | ;; 5 | ;; MODULE : init-rtf.scm 6 | ;; DESCRIPTION : setup rtf converters 7 | ;; COPYRIGHT : (C) 2016 Karl M Hegbloom 8 | ;; 9 | ;; This software falls under the GNU general public license version 3 or later. 10 | ;; It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 11 | ;; in the root directory or . 12 | ;; 13 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 14 | 15 | (texmacs-module (convert rtf init-rtf)) 16 | 17 | 18 | (define (rtf-recognizes-at? s pos) 19 | (set! pos (format-skip-spaces s pos)) 20 | (cond ((format-test? s pos "{\\rtf ") #t) 21 | (else #f))) 22 | 23 | (define (rtf-recognizes? s) 24 | (and (string? s) (rtf-recognizes-at? s 0))) 25 | 26 | 27 | (define-format rtf 28 | (:name "RTF") 29 | (:suffix "rtf") 30 | (:recognize rtf-recognizes?)) 31 | 32 | 33 | ;; (lazy-define (convert rtf rtftm) parse-rtf-snippet) 34 | ;; (lazy-define (convert rtf rtftm) parse-rtf-document) 35 | ;; (lazy-define (convert rtf rtftm) rtf->texmacs) 36 | 37 | ;; (converter rtf-snippet latex-snippet 38 | ;; `(:shell "unrtf -P " ,(dirname (%search-load-path "convert/rtf/latex.conf")) 39 | ;; " -t latex " from " > " to) 40 | 41 | -------------------------------------------------------------------------------- /progs/init-legal-brief.scm: -------------------------------------------------------------------------------- 1 | ;;; coding: utf-8 2 | ;;; ✠ ✞ ♼ ☮ ☯ ☭ ☺ 3 | ;;; 4 | ;;; MODULE : init-legal-brief.scm 5 | ;;; DESCRIPTION : Initialize Legal Brief Style and Support Code 6 | ;;; COPYRIGHT : (C) 2016 Karl M. Hegbloom 7 | ;;; 8 | ;;; This software falls under the GNU general public license version 3 or 9 | ;;; later. It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file 10 | ;;; LICENSE in the root directory or 11 | ;;;;;; 12 | 13 | (plugin-configure legal-brief 14 | (:require #t)) 15 | 16 | 17 | (when (supports-legal-brief?) 18 | (import-from (legal-brief)) 19 | (extend-table style-menu-name 20 | ("legal-brief" "Legal Brief Style")) 21 | (extend-table style-synopsis 22 | ("legal-brief" "Legal Brief Style"))) 23 | 24 | ;;; You can put your own customized copy of the legal-brief style, etc. ahead 25 | ;;; of the normal path this is installed in, to shadow this, or you can create 26 | ;;; a new style that loads this one and overrides things... 27 | ;;;; 28 | ;;; Todo: explain that better in documentation. 29 | 30 | 31 | ;;; This is magic that lets it know that when the main style is legal-brief, 32 | ;;; then the tm-zotero style is also active. It ought to be able to do that on 33 | ;;; it's own but does not for some reason; I have to declare it this way. 34 | ;;; 35 | (tm-define (style-includes? p q) 36 | (:require (and (== p "legal-brief") 37 | (== q "tm-zotero"))) 38 | #t) 39 | -------------------------------------------------------------------------------- /progs/tm-zotero-menu.scm: -------------------------------------------------------------------------------- 1 | ;;; coding: utf-8 2 | ;;; ✠ ✞ ♼ ☮ ☯ ☭ ☺ 3 | ;;; 4 | ;;; MODULE : tm-zotero-menu.scm 5 | ;;; DESCRIPTION : Zotero Connector Plugin Menu definitions 6 | ;;; COPYRIGHT : (C) 2016 Karl M. Hegbloom 7 | ;;; 8 | ;;; This software falls under the GNU general public license version 3 or 9 | ;;; later. It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file 10 | ;;; LICENSE in the root directory or 11 | ;;; 12 | ;;;; 13 | 14 | 15 | (texmacs-module (tm-zotero-menu) 16 | (:use (tm-zotero))) 17 | 18 | 19 | (menu-bind tm-zotero-menu 20 | (=> "Zotero" 21 | ("Add Citation" (tm-zotero-addCitation)) 22 | ("Edit Citation" (tm-zotero-editCitation)) 23 | ;;("Add or Edit Citation" (tm-zotero-addEditCitation)) 24 | ("Affirm Citation" (tm-zotero-affirmCitation)) 25 | --- 26 | ("Add Bibliography" (tm-zotero-addBibliography)) 27 | ("Edit Bibliography" (tm-zotero-editBibliography)) 28 | --- 29 | ("Refresh" (tm-zotero-refresh)) 30 | ;; ("Remove Codes" (tm-zotero-removeCodes)) 31 | --- 32 | ("Set Document Prefs" (tm-zotero-setDocPrefs)) 33 | --- 34 | ("Debug: Protocol trace to stdout?" (toggle-preference 35 | "zt-debug-trace?")))) 36 | 37 | 38 | 39 | ;;; How do I add to or replace a menu? Such as: Insert -> Link -> Citation 40 | 41 | 42 | ;; The tm-zotero.ts will load the zotero.scm module. 43 | (tm-menu (texmacs-extra-menu) 44 | (:mode in-tm-zotero-style?) 45 | (former) 46 | (link tm-zotero-menu)) 47 | 48 | ;; (menu-bind texmacs-extra-menu 49 | ;; (:mode in-tm-zotero-style?) 50 | ;; (link tm-zotero-menu)) 51 | ;; (former)) 52 | -------------------------------------------------------------------------------- /progs/compat/guile-2.scm: -------------------------------------------------------------------------------- 1 | ;; (compat guile-2) -- guile 2.0 interface for older guiles 2 | ;; Copyright (C) 2009, 2010 Andy Wingo 3 | 4 | ;; This program is free software: you can redistribute it and/or modify 5 | ;; it under the terms of the GNU General Public License as published by 6 | ;; the Free Software Foundation, either version 3 of the License, or 7 | ;; (at your option) any later version. 8 | ;; 9 | ;; This program is distributed in the hope that it will be useful, 10 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | ;; GNU General Public License for more details. 13 | ;; 14 | ;; You should have received a copy of the GNU General Public License 15 | ;; along with this program. If not, see . 16 | 17 | ;;; Commentary: 18 | ;; 19 | ;; Compatibility library, so that users may write code for the Guile 2.0 20 | ;; interface and have it run on older guiles. 21 | ;; 22 | ;;; Code: 23 | 24 | (define-module (compat guile-2)) 25 | 26 | (cond-expand 27 | (guile-2 28 | ;; have to define something, so we don't get "no code for module" 29 | (define hello #t)) 30 | (else 31 | (use-modules (ice-9 syncase)) 32 | (module-use! (module-public-interface (current-module)) 33 | (resolve-interface '(ice-9 syncase))) 34 | (define-public guile-2 syncase) 35 | 36 | (export eval-when) 37 | (define-macro (eval-when conditions . body) 38 | (if (or (memq 'eval conditions) 39 | (memq 'load conditions) 40 | (memq 'expand conditions)) 41 | `(begin . ,body) 42 | '(begin))) 43 | 44 | (read-hash-extend #\' (lambda (chr port) 45 | (list 'syntax (read port)))))) 46 | -------------------------------------------------------------------------------- /tests/test-clipboard-cut-paste-01/test-clipboard-cut-paste.scm: -------------------------------------------------------------------------------- 1 | ;;; coding: utf-8 2 | ;;; ✠ ✞ ♼ ☮ ☯ ☭ ☺ 3 | 4 | (texmacs-module (test-clipboard-cut-paste) 5 | (:use (kernel texmacs tm-modes) 6 | (kernel library content) 7 | (kernel library list) 8 | (utils base environment) 9 | (utils edit selections) 10 | (utils library cursor) 11 | (generic document-edit) 12 | (text text-structure) 13 | (generic document-part) 14 | ;;(part part-shared) ;; for buffer-initialize and buffer-notify 15 | (generic document-style) 16 | (generic generic-edit) 17 | (generic format-edit) 18 | (convert tools sxml))) 19 | 20 | 21 | (kbd-commands 22 | ("testtag" "Insert testtag tag." 23 | (insert-testtag))) 24 | 25 | (tm-define (insert-testtag) 26 | (insert `(testtag ,(create-unique-id) (tuple "3" (raw-data "") "false") "Text"))) 27 | 28 | 29 | (tm-define (clipboard-cut which) 30 | (:require (selection-active-any?)) 31 | (let ((selection-t (selection-tree))) 32 | (tm-output (format #f "~s" (tree->stree selection-t))) 33 | (newline) 34 | (former which))) 35 | 36 | 37 | (tm-define (has-testtags? t) 38 | (tm-find t (cut tm-is? <> 'testtag))) 39 | 40 | 41 | ;;; untested 42 | (tm-define (clipboard-paste which) 43 | (:require (has-testtags? (clipboard-get which))) 44 | (let* ((t (tree-ref (clipboard-get which) 1)) 45 | (testtags (map tree->stree (tm-search t (cut tm-is? <> 'testtag))))) 46 | (tm-output (format #f "~s" (tree->stree t))) (newline) 47 | (tm-output (format #f "~s" testtags)) (newline) 48 | (map (lambda (subtree) 49 | (let* ((st (tree->stree subtree))) 50 | (cons (car subtree) 51 | (cons (create-unique-id) 52 | (cddr subtree)))))) 53 | testtags) 54 | (insert t) 55 | ;; todo: maintain the new data-structures here. 56 | )) 57 | -------------------------------------------------------------------------------- /progs/tm-zotero/json/syntax.scm: -------------------------------------------------------------------------------- 1 | ;;; coding: utf-8 2 | ;;; ¶ 3 | ;;; (tm-zotero json syntax) --- Guile JSON implementation. 4 | 5 | ;; Copyright (C) 2013 Aleix Conchillo Flaque 6 | ;; 7 | ;; This file is part of guile-json. 8 | ;; 9 | ;; guile-json is free software; you can redistribute it and/or 10 | ;; modify it under the terms of the GNU Lesser General Public 11 | ;; License as published by the Free Software Foundation; either 12 | ;; version 3 of the License, or (at your option) any later version. 13 | ;; 14 | ;; guile-json is distributed in the hope that it will be useful, 15 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | ;; Lesser General Public License for more details. 18 | ;; 19 | ;; You should have received a copy of the GNU Lesser General Public 20 | ;; License along with guile-json; if not, write to the Free Software 21 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 | ;; 02110-1301 USA 23 | 24 | ;;; Commentary: 25 | 26 | ;; JSON module for Guile 27 | 28 | ;;; Code: 29 | 30 | (define-module (tm-zotero json syntax) 31 | #:use-module (ice-9 match) 32 | #:use-module (ice-9 syncase) 33 | #:export (json list->hash-table)) 34 | 35 | (define (list->hash-table lst) 36 | (let loop ((table (make-hash-table)) 37 | (lst lst)) 38 | (match lst 39 | (((key value) . rest) 40 | (hash-set! table key value) 41 | (loop table rest)) 42 | (() table)))) 43 | 44 | (define-syntax json 45 | (syntax-rules (unquote unquote-splicing array object) 46 | ((_ (unquote val)) 47 | val) 48 | ((_ ((unquote-splicing val) . rest)) 49 | (append val (json rest))) 50 | ((_ (array val . rest)) 51 | (cons (json val) (json rest))) 52 | ((_ (object key+val ...)) 53 | (list->hash-table 54 | (json (array key+val ...)))) 55 | ((_ (val . rest)) 56 | (cons (json val) (json rest))) 57 | ((_ val) 58 | (quote val)))) 59 | 60 | ;;; (json syntax) ends here 61 | -------------------------------------------------------------------------------- /progs/convert/rtf/rtftm.scm: -------------------------------------------------------------------------------- 1 | ;;; coding: utf-8 2 | 3 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 4 | ;; 5 | ;; MODULE : rtftm.scm 6 | ;; DESCRIPTION : conversion of RTF trees to TeXmacs trees 7 | ;; COPYRIGHT : (C) 2016 Karl M Hegbloom 8 | ;; 9 | ;; This software falls under the GNU general public license version 3 or later. 10 | ;; It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE 11 | ;; in the root directory or . 12 | ;; 13 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 14 | 15 | ;;; 16 | ;;; This is not a full RTF document converter. For now, all it knows how to do 17 | ;;; is convert the citeproc.js RTF output into TeXmacs. 18 | ;;; 19 | 20 | (texmacs-module (convert rtf rtftm) 21 | (:use (kernel texmacs tm-convert))) 22 | 23 | ;; (:use 24 | ;; (convert tools tmlength) 25 | ;; (convert tools tmcolor) 26 | ;; (convert tools old-tmtable) 27 | ;; (convert tools stm) 28 | ;; (convert tools environment))) 29 | 30 | (define (url-temp-ext ext) 31 | (url-glue (url-temp) (string-append "." ext))) 32 | 33 | (tm-define (rtf-snippet->latex-snippet rtf_str) 34 | (let ((temp_rtf (url-temp-ext "rtf")) 35 | (temp_tex (url-temp-ext "tex"))) 36 | 37 | (string-save rtf_str temp_rtf) 38 | (system (string-append 39 | "unrtf -P " (dirname (%search-load-path "convert/rtf/latex.conf")) 40 | " -t latex " (url->unix temp_rtf) 41 | " | sed -re 's,(\\w\\.}?) ,\\1\\\\hspace{1spc},g'" 42 | " > " (url->unix temp_tex))) 43 | (system-remove temp_rtf) 44 | (let ((tex (string-load temp_tex))) 45 | (system-remove temp_tex) 46 | tex))) 47 | 48 | (tm-define (rtf-snippet->texmacs s) 49 | (latex->texmacs 50 | (parse-latex 51 | (rtf-snippet->latex-snippet s)))) 52 | 53 | 54 | ;; (converter rtf-document rtf-stree 55 | ;; (:function parse-rtf-document)) 56 | 57 | ;; (converter rtf-stree texmacs-stree 58 | ;; (:function rtf->texmacs)) 59 | -------------------------------------------------------------------------------- /progs/tm-zotero/json.scm: -------------------------------------------------------------------------------- 1 | ;;; coding: utf-8 2 | ;;; ¶ 3 | ;;; (tm-zotero json) --- Guile JSON implementation (for Guile 1.8) 4 | 5 | ;; Copyright (C) 2013 Aleix Conchillo Flaque 6 | ;; 7 | ;; This file is part of guile-json. 8 | ;; 9 | ;; guile-json is free software; you can redistribute it and/or 10 | ;; modify it under the terms of the GNU Lesser General Public 11 | ;; License as published by the Free Software Foundation; either 12 | ;; version 3 of the License, or (at your option) any later version. 13 | ;; 14 | ;; guile-json is distributed in the hope that it will be useful, 15 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | ;; Lesser General Public License for more details. 18 | ;; 19 | ;; You should have received a copy of the GNU Lesser General Public 20 | ;; License along with guile-json; if not, write to the Free Software 21 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 | ;; 02110-1301 USA 23 | 24 | ;;; Commentary: 25 | 26 | ;; JSON module for Guile 27 | 28 | ;;; Modified for TeXmacs and Guile 1.8 by Karl M. Hegbloom 29 | ;;; for use in the zotero-texmacs-integration. 30 | 31 | ;;; Code: 32 | 33 | (define-module (tm-zotero json) 34 | #:use-module (ice-9 syncase) 35 | #:use-module (tm-zotero json builder) 36 | #:use-module (tm-zotero json parser) 37 | #:use-module (tm-zotero json syntax) 38 | #:re-export (scm->json 39 | scm->json-string 40 | json->scm 41 | json-string->scm 42 | json-parser? 43 | json-parser-port 44 | json 45 | list->hash-table)) 46 | 47 | ;; (define-syntax re-export-modules 48 | ;; (syntax-rules () 49 | ;; ((_ (mod ...) ...) 50 | ;; (begin 51 | ;; (module-use! (module-public-interface (current-module)) 52 | ;; (resolve-interface '(mod ...))) 53 | ;; ...)))) 54 | ;; 55 | ;; (re-export-modules (json builder) 56 | ;; (json parser) 57 | ;; (json syntax)) 58 | 59 | ;;; (json) ends here 60 | -------------------------------------------------------------------------------- /packages/semantic-lawsuit.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <\body> 6 | <\active*> 7 | <\src-title> 8 | 9 | 10 | <\src-purpose> 11 | The semantic-lawsuit package is for adding semantic markup to legal 12 | documents so that things such as, the 13 | set of (potentially prioritized) factual claims can be easily gleaned 14 | from the document. 15 | 16 | 17 | <\src-copyright|2015, 2016> 18 | Karl M.Hegbloom 19 | 20 | 21 | <\src-license> 22 | This software falls under the . It comes WITHOUT ANY 24 | WARRANTY WHATSOEVER. You should have received a copy of the license 25 | which the software. If not, see . 26 | 27 | 28 | 29 | 30 | <\active*> 31 | <\src-comment> 32 | Any ideas? 33 | 34 | Automatic spelling correction as-you-type; 35 | 36 | Automatic abbrev expansion, with template variable dialogs. 37 | 38 | Boilerplate contract construction? 39 | 40 | Integration with DMS. 41 | 42 | For now these are just one argument `wrappers'. Later they may be in 43 | need of a way to make an optional toc label, or brief-form label for a 44 | table of factual-claims, or table of ...? whatever turns out to be what 45 | is needed for this. 46 | 47 | For needs-citation and probably others, there ought to be a satellite 48 | buffer or menu, like Emacs' Speedbar or Imenu, to help find the "loose 49 | ends". 50 | 51 | What about a proof-assistant style\ 52 | 53 | 54 | 55 | >> 56 | 57 | >> 58 | 59 | >> 61 | 62 | \; 63 | 64 | 65 | <\initial> 66 | <\collection> 67 | 68 | 69 | -------------------------------------------------------------------------------- /CSL-Citation.md: -------------------------------------------------------------------------------- 1 | CSL Embedded Citation Object Format 2 | ----------------------------------- 3 | 4 | The JSON schema "csl-citation.json" describes a format for embedding citation 5 | objects in documents. The JSON schema references "csl-data.json", which 6 | describes the CSL citation data object format for CSL processors (documented at 7 | http://gsl-nagoya-u.net/http/pub/citeproc-doc.html#citation-data-object). 8 | 9 | Support for the CSL Embedded Citation Object format is available in 10 | Mendeley Desktop 1.0 and later. 11 | 12 | The CSL citation data object consists of: 13 | 14 | * a required "schema" element of type "string", set to the URI of the schema 15 | * a required "citationID" element of type "string" or "number", set to ??? 16 | * a "citationItems" element of type "array", containing "objects" with the data 17 | of the individual cites. The individual cite object are structured as: 18 | 19 | * a required "id" element of type "string" or "number", set to an unique cite 20 | ID 21 | * a "itemData" element of type "object", described in "csl-data.json/#/items", 22 | containing the metadata of a single bibliographic item (this object is 23 | returned in citeproc-js by "sys.retrieveItem()") 24 | * an "uris" element of type "array", which can contain any number of URIs (of 25 | type "string") to the bibliographic item 26 | * a "prefix" element of type "string" 27 | * a "suffix" element of type "string" 28 | * a "locator" element of type "string" 29 | * a "label" element of type "string", set to one of the CSL locator types (see 30 | http://citationstyles.org/downloads/specification.html#locators) 31 | * a "suppress-author" element of type "string", "boolean" or "number" 32 | * a "author-only" element of type "string", "boolean" or "number" 33 | * a "properties" element of type "object" containing: 34 | * a "noteIndex" element of type "number", set to the index of the footnote or 35 | endnote 36 | * (Mendeley-specific) a "mendeley" element of type "object" containing: 37 | * a "previouslyFormattedCitation" element of type "string", set to the 38 | rendered output of the cite of the previous rendering round (this can be 39 | used to determine if the user manually altered the output) 40 | * a "manualFormatting" element of type "string", set to the user-customized 41 | output of the cite (this output will be used in favor of the generated 42 | output) 43 | 44 | The method to embed metadata for citations and bibliographies typically varies 45 | between word processors. Currently Mendeley uses: 46 | 47 | * For Word for Windows: in-text citations and bibliographies are represented by 48 | a field code of type "wdFieldAddin" or temporarily represented as a bookmark 49 | if exporting to OpenOffice 50 | * For OpenOffice: in-text citations are of type 51 | "com.sun.star.text.ReferenceMark", bibliographies are of type 52 | "com.sun.star.text.TextSection" or temporarily represented as a bookmark if 53 | exporting to Word 54 | 55 | If you are trying to implement this and want help ensuring compatibility or have 56 | suggestions for changes, please use the xbiblio mailing list: 57 | https://lists.sourceforge.net/lists/listinfo/xbiblio-devel 58 | 59 | An example of an embedded citation object from Mendeley (the "Mendeley 60 | Citation{970e7ce0-8a21-482e-b7d6-e77794a2d37d}" part is not required and used 61 | only for backwards compatibility with older versions of Mendeley, any text before 62 | "CSL_CITATION" can be ignored, and newlines have been added for readability): 63 | 64 | --- 65 | ADDIN Mendeley Citation{970e7ce0-8a21-482e-b7d6-e77794a2d37d} CSL_CITATION 66 | { 67 | "schema": "https://github.com/citation-style-language/schema/raw/master/csl-citation.json", 68 | "citationID":"12rsus7rlj", 69 | "citationItems": 70 | [ 71 | { 72 | "id":"ITEM-1", 73 | "itemData": 74 | { 75 | "id" : "ITEM-1", 76 | "issued" : { "date-parts" : [ [ "2007" ] ] }, 77 | "title" : "My paper", 78 | "type" : "journal-article" 79 | }, 80 | "locator":"21", 81 | "label":"page", 82 | "uris" : 83 | [ 84 | "http://www.mendeley.com/documents/?uuid=970e7ce0-8a21-482e-b7d6-e77794a2d37d", 85 | "http://www.zotero.org/uniqueDocumentId" 86 | ] 87 | } 88 | ], 89 | "mendeley": 90 | { 91 | "previouslyFormattedCitation" : "(2007)", 92 | "manualFormatting" : "2007b" 93 | } 94 | "properties": 95 | { 96 | "noteIndex": 1 97 | } 98 | } 99 | --- 100 | 101 | An example of a bibliography field code contents from Mendeley (the "Mendeley 102 | Bibliography" part is not required and only used by Mendeley for backwards compatibility) 103 | 104 | --- 105 | ADDIN Mendeley Bibliography CSL_BIBLIOGRAPHY 106 | --- 107 | -------------------------------------------------------------------------------- /doc/tm-zotero-abstract.en.tm: -------------------------------------------------------------------------------- 1 | 2 | 3 | > 4 | 5 | <\body> 6 | <\tmdoc-title> 7 | > Juris-M / Zotero integration. 8 | 9 | For 10 | scholars of all fields, in any jurisdiction, across all languages.> 11 | 12 | 13 | 14 | 15 | 16 | 17 | \<#27BD\> To install tools from the Juris-M suite, visit 18 | 19 | 20 | <\description> 21 | The Juris-M resource manager is a variant 22 | of the Zotero Firefox plugin, modified and extended to support legal and 23 | multilingual referencing. 24 | 25 | Style-specific abbreviation lists for law and 26 | other fields, with a simple editor for adding and editing entries. 27 | 28 | 29 | Juris-M is free software. 30 | 31 | 32 | 33 | \<#27BD\> The Juris-M legal style editor is available on-line via 34 | . 35 | 36 | <\description> 37 | Juris-M supports jurisdiction-specific modular 38 | styles for legal referencing, using an extended version of the same 39 | powerful Citation Style Language that drives Zotero. In the style editor, 40 | you can tune citation formats to the specific requirements of any 41 | jurisdiction. 42 | 43 | You must have a GitHub account to 44 | contribute legal style code. The site will request access to your public 45 | GitHub repositories in order to manage your submissions. 46 | 47 | 48 | 49 | 50 | [zoh-TAIR-oh] is a free, easy-to-use tool to help you 51 | your research sources. 52 | 53 | 54 | 55 | Zotero is the only research tool that automatically senses content in your 56 | web browser, allowing you to add it to your personal library with a single 57 | click. Whether you're searching for a preprint on arXiv.org, a journal 58 | article from JSTOR, a news story from the , or a book 59 | from your university library catalog, Zotero has you covered with support 60 | for thousands of sites. 61 | 62 | 63 | 64 | Zotero collects all your research in a single, searchable interface. You 65 | can add PDFs, images, audio and video files, snapshots of web pages, and 66 | really anything else. Zotero automatically indexes the full-text content of 67 | your library, enabling you to find exactly what you're looking for with 68 | just a few keystrokes. 69 | 70 | 71 | 72 | Zotero is documented at . 73 | 74 | > Juris-M / Zotero 75 | Integration> 76 | 77 | This package may be obtained via: 78 | 79 | <\with|par-mode|center> 80 | 81 | 82 | 83 | See the file (displayed below the file listing on the above 84 | page) for instructions on how to obtain it and set it up for 85 | use> Actually, since you are reading this, you've already 86 | done that! Please report bugs and feature requests via the Github 87 | \Pissues\Q tab on that page. Feel free to clone the repository, fix things, 88 | add features, and submit pull-requests! 89 | 90 | 91 | 92 | <\traverse> 93 | 94 | 95 | 96 | <\tmdoc-copyright|2016> 97 | Karl M.Hegbloom karl.hegbloom@gmail.com\>|mailto:karl.hegbloom@gmail.com> 98 | 99 | Text of this document blatantly ripped from their websites. 100 | (). 101 | 102 | 103 | 109 | 110 | 111 | <\initial> 112 | <\collection> 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /progs/term/ansi-color.scm: -------------------------------------------------------------------------------- 1 | ;; (term ansi-color) -- color output using ANSI escape sequences 2 | ;; Copyright (C) 2003 Richard Todd 3 | 4 | ;; This program is free software: you can redistribute it and/or modify 5 | ;; it under the terms of the GNU General Public License as published by 6 | ;; the Free Software Foundation, either version 3 of the License, or 7 | ;; (at your option) any later version. 8 | ;; 9 | ;; This program is distributed in the hope that it will be useful, 10 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | ;; GNU General Public License for more details. 13 | ;; 14 | ;; You should have received a copy of the GNU General Public License 15 | ;; along with this program. If not, see . 16 | 17 | #! 18 | ;;; Commentary: 19 | @cindex terminals, ANSI color codes for 20 | @cindex ANSI color codes 21 | @cindex color codes, ANSI 22 | The @samp{(term ansi-color)} module generates ANSI escape 23 | sequences for colors. Here is an example of the module's use: 24 | 25 | @lisp 26 | ;; method one: safer, since you know the colors 27 | ;; will get reset 28 | (display (colorize-string "Hello!\n" 'RED 'BOLD 'ON-BLUE)) 29 | 30 | ;; method two: insert the colors by hand 31 | (for-each display 32 | (list (color 'RED 'BOLD 'ON-BLUE) 33 | "Hello!" 34 | (color 'RESET))) 35 | @end lisp 36 | ;;; Code: 37 | !# 38 | 39 | (define-module (term ansi-color) 40 | #:export (color 41 | colorize-string) 42 | #:use-module (srfi srfi-1) ; for 'remove' 43 | #:use-module (srfi srfi-13)) ; for 'string-join' 44 | 45 | (define ansi-color-tables 46 | (let ((table (make-hash-table 23))) 47 | (hashq-set! table 'CLEAR "0") 48 | (hashq-set! table 'RESET "0") 49 | (hashq-set! table 'BOLD "1") 50 | (hashq-set! table 'DARK "2") 51 | (hashq-set! table 'UNDERLINE "4") 52 | (hashq-set! table 'UNDERSCORE "4") 53 | (hashq-set! table 'BLINK "5") 54 | (hashq-set! table 'REVERSE "6") 55 | (hashq-set! table 'CONCEALED "8") 56 | (hashq-set! table 'BLACK "30") 57 | (hashq-set! table 'RED "31") 58 | (hashq-set! table 'GREEN "32") 59 | (hashq-set! table 'YELLOW "33") 60 | (hashq-set! table 'BLUE "34") 61 | (hashq-set! table 'MAGENTA "35") 62 | (hashq-set! table 'CYAN "36") 63 | (hashq-set! table 'WHITE "37") 64 | (hashq-set! table 'ON-BLACK "40") 65 | (hashq-set! table 'ON-RED "41") 66 | (hashq-set! table 'ON-GREEN "42") 67 | (hashq-set! table 'ON-YELLOW "43") 68 | (hashq-set! table 'ON-BLUE "44") 69 | (hashq-set! table 'ON-MAGENTA "45") 70 | (hashq-set! table 'ON-CYAN "46") 71 | (hashq-set! table 'ON-WHITE "47") 72 | table)) 73 | 74 | (define (color . lst) 75 | "Returns a string containing the ANSI escape sequence for 76 | producing the requested set of attributes. 77 | 78 | The allowed values for the attributes are listed below. Unknown 79 | attributes are ignored. 80 | 81 | @table @asis 82 | @item Reset Attributes 83 | @samp{CLEAR} and @samp{RESET} are allowed and equivalent. 84 | 85 | @item Non-Color Attributes 86 | @samp{BOLD} makes text bold, and @samp{DARK} reverses this. 87 | @samp{UNDERLINE} and @samp{UNDERSCORE} are equivalent. @samp{BLINK} 88 | makes the text blink. @samp{REVERSE} invokes reverse video. 89 | @samp{CONCEALED} hides output (as for getting passwords, etc.). 90 | 91 | @item Foregrond Color Attributes 92 | @samp{BLACK}, @samp{RED}, @samp{GREEN}, @samp{YELLOW}, @samp{BLUE}, 93 | @samp{MAGENTA}, @samp{CYAN}, @samp{WHITE} 94 | 95 | @item Background Color Attributes 96 | @samp{ON-BLACK}, @samp{ON-RED}, @samp{ON-GREEN}, @samp{ON-YELLOW}, 97 | @samp{ON-BLUE}, @samp{ON-MAGENTA}, @samp{ON-CYAN}, @samp{ON-WHITE} 98 | @end table" 99 | (let ((color-list 100 | (remove not 101 | (map (lambda (color) (hashq-ref ansi-color-tables color)) 102 | lst)))) 103 | (if (null? color-list) 104 | "" 105 | (string-append 106 | (string #\esc #\[) 107 | (string-join color-list ";" 'infix) 108 | "m")))) 109 | 110 | (define (colorize-string str . color-list) 111 | "Returns a copy of @var{str} colorized using ANSI 112 | escape sequences according to the attributes specified in 113 | @var{color-list}. At the end of the returned string, the color 114 | attributes will be reset such that subsequent output will not 115 | have any colors in effect. 116 | 117 | The allowed values for the attributes are listed in the 118 | documentation for the @code{color} function." 119 | (string-append 120 | (apply color color-list) 121 | str 122 | (color 'RESET))) 123 | 124 | ;;; arch-tag: e8dd6a14-490c-417e-a7fe-983939293db1 125 | -------------------------------------------------------------------------------- /texmacs-zotero-bibtex: -------------------------------------------------------------------------------- 1 | #!/usr/bin/guile-2.0 \ 2 | -e main -s 3 | !# 4 | ;; 5 | ;; This program acts like "bibtex", but uses Zotero better-bibtex to 6 | ;; get the bibliography. 7 | ;; 8 | ;; Internally, src/src/Plugins/BibTeX/bibtex.cpp, effectively runs: 9 | ;; 10 | ;; cd $TEXMACS_HOME_PATH/system/bib; \ 11 | ;; BIBINPUTS="$(dirname $bib_file)":$BIBINPUTS \ 12 | ;; BSTINPUTS="$(dirname $bib_file)":$BSTINPUTS \ 13 | ;; texmacs-zotero-bibtex temp > $TEXMACS_HOME_PATH/system/bib/temp.log 14 | ;; 15 | ;; This program is expected to read temp.aux, and produce temp.bbl 16 | ;; 17 | ;; temp.log is parsed for: "Warning--" and prints them. 18 | ;; 19 | ;; It then calls bibtex_load_bbl, and loads the temp.bbl file. 20 | ;; 21 | ;; The temp.aux file that is it's input contains: 22 | ;; 23 | ;; \bibstyle{$style} 24 | ;; \citation{bibtex_cite_key1} 25 | ;; \citation{bibtex_cite_key2} 26 | ;; \citation{bibtex_cite_key_etc} 27 | ;; \bibdata{$bib_name} 28 | ;; 29 | ;; $style is the (BibTeX) style name. It may not contain spaces. 30 | ;; $bib_name is $(basename $bib_file .bib) 31 | ;; 32 | ;; I will assume that the $bib_file is produced by 33 | ;; zotero-better-bibtex, and was used as a means of getting the cite 34 | ;; keys (for now. Later I'll implement cite as you write). This 35 | ;; program does not need to access it, since it will get everything it 36 | ;; needs from the temp.aux file and the jsonrpc call to zotero-better-bibtex. 37 | ;; 38 | 39 | (use-modules (ice-9 receive)) 40 | (use-modules (ice-9 rdelim)) 41 | (use-modules (web client)) 42 | (use-modules (web uri)) 43 | (use-modules (web request)) 44 | (use-modules (web response)) 45 | (use-modules (json)) 46 | 47 | 48 | (define zotero-better-bibtex-schomd-uri 49 | "http://localhost:23119/better-bibtex/schomd") 50 | 51 | (define id -1) 52 | 53 | (define ht (json 54 | (object 55 | ("jsonrpc" "2.0") 56 | ("method" "bibliographybbl")))) 57 | 58 | (hash-set! ht "params" 59 | (list (list "placeholder") 60 | (json (object ("style" "jm-indigobook"))))) 61 | 62 | 63 | (define (bibliographybbl-style-set! style) 64 | (hash-set! (cadr (hash-ref ht "params")) "style" style)) 65 | 66 | 67 | (define (make-bibliographybbl-post-data citekeys) 68 | (set! id (+ 1 id)) 69 | (hash-set! ht "id" id) 70 | (set-car! (hash-ref ht "params") citekeys) 71 | (scm->json-string ht)) 72 | 73 | 74 | (define (get-bibliographybbl citekeys) 75 | (receive (result port) 76 | (http-post 77 | zotero-better-bibtex-schomd-uri 78 | #:body (make-bibliographybbl-post-data citekeys) 79 | #:streaming? #t) 80 | (json->scm port))) 81 | 82 | 83 | (define (parse-citekeys aux) 84 | (let loop ((citekeys '()) 85 | (aux-str (read-line aux))) 86 | (cond 87 | ((eof-object? aux-str) citekeys) 88 | ((string= "\\bibstyle{" aux-str 0 9 0 9) 89 | (begin 90 | (bibliographybbl-style-set! (substring aux-str 91 | 10 92 | (- (string-length aux-str) 1))) 93 | (loop citekeys (read-line aux)))) 94 | ((string= "\\citation{" aux-str 0 9 0 9) 95 | (loop (cons (substring aux-str 96 | 10 97 | (- (string-length aux-str) 1)) 98 | citekeys) 99 | (read-line aux))) 100 | (#t (loop citekeys (read-line aux)))))) 101 | 102 | (define (main args) 103 | (let* ((aux (open-input-file (string-append (cadr args) ".aux"))) 104 | (bbl (open-output-file (string-append (cadr args) ".bbl"))) 105 | (citekeys (parse-citekeys aux)) 106 | (res-ht (get-bibliographybbl citekeys)) 107 | (res-err (hash-ref res-ht "error" #f)) 108 | (res-str (hash-ref res-ht "result" ""))) 109 | (if res-err 110 | (let ((err-str (string-append "Error:" (number->string (hash-ref res-err "code")) 111 | ":" (hash-ref res-err "message") "\n"))) 112 | (display err-str (current-error-port)) 113 | (display err-str bbl)) 114 | (begin 115 | (display (string-append res-str) bbl))))) 116 | 117 | 118 | ;;; 119 | ;; (define test-json-string-1 120 | ;; (scm->json-string (json 121 | ;; (object 122 | ;; ("jsonrpc" "2.0") 123 | ;; ("id" 666) 124 | ;; ("method" "tmbibliography") 125 | ;; ("params" [["galloway_jr_basic_1989" 126 | ;; "galloway_jr_basic_1992" 127 | ;; "_addington_1979" 128 | ;; "_douglas_1963"] 129 | ;; (object 130 | ;; ("style" "http://juris-m.github.io/styles/jm-babyblue")) 131 | ;; ]))))) 132 | 133 | ;;; "{\"id\" : 666,\"jsonrpc\" : \"2.0\",\"params\" : [[\"galloway_jr_basic_1989\", \"galloway_jr_basic_1992\", \"_addington_1979\", \"_douglas_1963\"], {\"style\" : \"http://juris-m.github.io/styles/jm-babyblue\"}],\"method\" : \"tmbibliography\"}" 134 | 135 | ;;; Local Variables: 136 | ;;; mode: scheme 137 | ;;; geiser-scheme-implementation: guile 138 | ;;; End: 139 | -------------------------------------------------------------------------------- /.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((nil . ((indent-tabs-mode . nil) 2 | (fill-column . 79) 3 | (org-startup-truncated . t) 4 | (org-default-notes-file . "~/src/Juris-M/zotero-texmacs-integration/zotero-texmacs-integration_Notes.org") 5 | (org-enforce-todo-dependencies . t) 6 | (org-enforce-todo-checkbox-dependencies . t) 7 | (org-closed-keep-when-no-todo . nil) 8 | (org-treat-S-cursor-todo-selection-as-state-change . nil) 9 | (org-refile-allow-creating-parent-nodes . confirm) 10 | (org-refile-targets 11 | ("~/src/Juris-M/zotero-texmacs-integration/zotero-texmacs-integration_Notes.org" :maxlevel . 7) 12 | (org-agenda-files :maxlevel . 7)) 13 | (org-id-link-to-org-use-id . create-if-interactive-and-no-custom-id) 14 | (org-log-into-drawer . t) 15 | (org-log-note-clock-out . t) 16 | (org-log-redeadline . note) 17 | (org-log-reschedule . note) 18 | (org-lowest-priority . 68) 19 | (org-priority-faces (65 . "red")) 20 | (org-use-sub-superscripts . {}) 21 | (org-todo-keyword-faces 22 | ("FIXME" . "Magenta") 23 | ("NEXT" . "HotPink") 24 | ("WIP" . "HotPink") 25 | ("WAITING" . "DarkOrange") 26 | ("TESTING" . "OrangeRed") 27 | ("TESTING" . "gold") 28 | ("VERIFY" . "red") 29 | ("CANCELED" . "OliveDrab") 30 | ("CANCELLED" . "OliveDrab") 31 | ("S.E.P." . "DarkOrange")) 32 | (org-todo-keywords 33 | (sequence "TODO(t)" "WIP(w!)" "WAITING(W@/!)" "TESTING(T!)" "VERIFY(v@/!)" "FIXME(f@/!)" "|" "DONE(d!/!)" "CANCELED(c@/!)" "S.E.P.(s@/!)") 34 | (sequence "To Do: " "Done : ")) 35 | (org-export-allow-bind-keywords . t) 36 | (org-export-with-email . t) 37 | (org-export-with-smart-quotes . t) 38 | (org-export-with-toc . nil) 39 | (org-export-with-tags . nil) 40 | (org-export-with-todo-keywords . nil) 41 | (org-export-select-tags "export") ;; also #+SELECT_TAGS: keyword 42 | (org-export-exclude-tags "noexport") ;; also #+EXCLUDE_TAGS: keyword 43 | (org-export-snippet-translation-alist 44 | ("h" . "html") ("l" . "latex") ("m" . "markdown")) 45 | (org-fontify-done-headline . t) 46 | (org-fontify-whole-heading-line . t) 47 | (org-hidden-keywords author date email title) 48 | (org-image-actual-width 960) 49 | (org-html-allow-name-attribute-in-anchors . t) 50 | (org-html-checkbox-type . unicode) 51 | (org-html-doctype . "html5") 52 | (org-html-head . 53 | "") 137 | (org-html-head-extra . 138 | "") 141 | (org-html-html5-fancy . t) 142 | (org-html-text-markup-alist 143 | (bold . "%s") 144 | (code . "%s") 145 | (italic . "%s") 146 | (strike-through . "%s") 147 | (underline . "%s") 148 | (verbatim . "%s")) 149 | (org-latex-text-markup-alist 150 | (bold . "\\textbf{%s}") 151 | (code . "\\textsc{%s}") 152 | (italic . "\\emph{%s}") 153 | (strike-through . "\\sout{%s}") 154 | (underline . "\\uline{%s}") 155 | (verbatim . protectedtexttt)) 156 | (mplayer-position-stamp-format . "<<<(%s)>>>") 157 | (mplayer-position-stamp-format-regexp . "<<<([0-9]+\\.[0-9])>>>") 158 | ))) 159 | -------------------------------------------------------------------------------- /progs/convert/rtf/latex.conf: -------------------------------------------------------------------------------- 1 | comment_begin 2 | \\% 3 | comment_end 4 | 5 | 6 | document_begin 7 | document_end 8 | document_title_begin 9 | document_title_end 10 | document_author_begin 11 | document_author_end 12 | document_changedate_begin 13 | document_changedate_end 14 | body_begin 15 | body_end 16 | paragraph_begin 17 | paragraph_end 18 | center_begin 19 | \\center{ 20 | 21 | center_end 22 | } 23 | 24 | align_left_begin 25 | \\begin{sloppy} 26 | 27 | align_left_end 28 | \\end{sloppy} 29 | 30 | line_break 31 | \\\\ 32 | 33 | page_break 34 | \\pagebreak 35 | hyperlink_begin 36 | \\href{ 37 | hyperlink_end 38 | }{hyperlink} 39 | table_begin 40 | \\begin{tabular}{|lllll} 41 | 42 | table_end 43 | \\end{tabular} 44 | 45 | table_row_begin 46 | table_row_end 47 | \\hline \\ 48 | 49 | table_cell_begin 50 | table_cell_end 51 | & 52 | fontsize8_begin 53 | \\tiny{ 54 | fontsize8_end 55 | } 56 | fontsize10_begin 57 | \\small{ 58 | fontsize10_end 59 | } 60 | fontsize12_begin 61 | \\normalsize{ 62 | fontsize12_end 63 | } 64 | fontsize14_begin 65 | {\\large 66 | fontsize14_end 67 | } 68 | fontsize18_begin 69 | {\\Large 70 | fontsize18_end 71 | } 72 | fontsize24_begin 73 | {\\LARGE 74 | fontsize24_end 75 | } 76 | fontsize36_begin 77 | {\\huge 78 | fontsize36_end 79 | } 80 | fontsize48_begin 81 | {\\Huge 82 | fontsize48_end 83 | } 84 | bold_begin 85 | {\\bf 86 | bold_end 87 | } 88 | italic_begin 89 | {\\it 90 | italic_end 91 | } 92 | underline_begin 93 | {\\ul 94 | underline_end 95 | } 96 | dbl_underline_begin 97 | {\\ul 98 | dbl_underline_end 99 | } 100 | pointlist_begin 101 | \\begin{itemize} 102 | 103 | pointlist_end 104 | \\end{itemize} 105 | 106 | pointlist_item_begin 107 | \\item 108 | pointlist_item_end 109 | numericlist_begin 110 | \\begin{enumerate} 111 | 112 | numericlist_end 113 | \\end{enumerate} 114 | 115 | numericlist_item_begin 116 | \\item 117 | numericlist_item_end 118 | 119 | superscript_begin 120 | \\textsuperscript{ 121 | superscript_end 122 | } 123 | subscript_begin 124 | \\textsubscript{ 125 | subscript_end 126 | } 127 | strikethru_begin 128 | { 129 | strikethru_end 130 | } 131 | dbl_strikethru_begin 132 | { 133 | dbl_strikethru_end 134 | } 135 | small_caps_begin 136 | \\textsc{ 137 | small_caps_end 138 | } 139 | chars.right_quote 140 | ' 141 | chars.left_quote 142 | ` 143 | chars.right_dbl_quote 144 | '' 145 | chars.left_dbl_quote 146 | `` 147 | chars.endash 148 | -- 149 | chars.emdash 150 | --- 151 | 8211 152 | -- 153 | 8212 154 | --- 155 | 8216 156 | ` 157 | 8217 158 | ' 159 | 8220 160 | `` 161 | 8221 162 | '' 163 | chars.nonbreaking_space 164 | {\\ } 165 | 34 166 | " 167 | 168 | " 169 | 170 | \\# 171 | 172 | {\\$} 173 | 174 | \\% 175 | 176 | \\& 177 | 178 | {\\ast} 179 | 180 | {\\slash} 181 | 182 | {\\caret} 183 | 184 | \\_ 185 | 186 | \\{ 187 | 188 | $\\mid$ 189 | 190 | \\} 191 | 192 | \\~{ } 193 | 194 | {\\ldots} 195 | 196 | {\\dag} 197 | 198 | {\\ddag} 199 | 200 | {\\OE} 201 | 202 | {\\bullet} 203 | 204 | -- 205 | 206 | --- 207 | 208 | \\: 209 | 210 | {\\pounds} 211 | 212 | \\Y 213 | 214 | {\\copyright} 215 | 216 | \\o 217 | 218 | \\+- 219 | 220 | $^{2}$ 221 | 222 | $^{3}$ 223 | 224 | \\P 225 | 226 | $^{1}$ 227 | 228 | \\frac{1}{4} 229 | 230 | \\frac{1}{2} 231 | 232 | \\frac{3}{4} 233 | 234 | \\`{A} 235 | 236 | \\'{A} 237 | 238 | \\o{A} 239 | 240 | \\~{A} 241 | 242 | \\"{A} 243 | 244 | \\AE 245 | 246 | \\c{C} 247 | 248 | \\`{E} 249 | 250 | \\'{E} 251 | 252 | \\o{E} 253 | 254 | \\"{E} 255 | 256 | \\`{I} 257 | 258 | \\'{I} 259 | 260 | \\o{I} 261 | 262 | \\"{I} 263 | 264 | \\ETH 265 | 266 | \\~{N} 267 | 268 | \\`{O} 269 | 270 | \\'{O} 271 | 272 | \\o{O} 273 | 274 | \\~{O} 275 | 276 | \\"{O} 277 | 278 | \\mult 279 | 280 | \\`{U} 281 | 282 | \\'{U} 283 | 284 | \\o{U} 285 | 286 | \\"{U} 287 | 288 | \\'{Y} 289 | 290 | \\THORN 291 | 292 | \\`{a} 293 | 294 | \\'{a} 295 | 296 | \\o{a} 297 | 298 | \\~{a} 299 | 300 | \\"{a} 301 | 302 | \\ae 303 | 304 | \\c{c} 305 | 306 | \\`{e} 307 | 308 | \\'{e} 309 | 310 | \\o{e} 311 | 312 | \\"{e} 313 | 314 | \\`{i} 315 | 316 | \\'{i} 317 | 318 | \\o{i} 319 | 320 | \\"{i} 321 | 322 | \\eth 323 | 324 | \\~{n} 325 | 326 | \\`{o} 327 | 328 | \\'{o} 329 | 330 | \\o{o} 331 | 332 | \\~{o} 333 | 334 | \\"{o} 335 | 336 | \\div 337 | 338 | \\slash{o} 339 | 340 | \\`{u} 341 | 342 | \\'{u} 343 | 344 | \\o{u} 345 | 346 | \\"{u} 347 | 348 | \\'{y} 349 | 350 | \\thorn 351 | 352 | \\"{y} 353 | 913 354 | A 355 | 914 356 | B 357 | 915 358 | $\\Gamma$ 359 | 916 360 | $\\Delta$ 361 | 917 362 | E 363 | 918 364 | Z 365 | 919 366 | H 367 | 920 368 | $\\Theta$ 369 | 921 370 | I 371 | 922 372 | K 373 | 923 374 | $\\Lambda$ 375 | 924 376 | M 377 | 925 378 | N 379 | 926 380 | $\\Xi$ 381 | 927 382 | O 383 | 928 384 | $\\Pi$ 385 | 929 386 | P 387 | 931 388 | $\\Sigma$ 389 | 932 390 | T 391 | 933 392 | $\\Upsilon$ 393 | 934 394 | $\\Phi$ 395 | 935 396 | X 397 | 936 398 | $\\Psi$ 399 | 937 400 | $\\Omega$ 401 | 945 402 | $\\alpha$ 403 | 946 404 | $\\beta$ 405 | 947 406 | $\\gamma$ 407 | 948 408 | $\\delta$ 409 | 949 410 | $\\varepsilon$ 411 | 950 412 | $\\zeta$ 413 | 951 414 | $\\eta$ 415 | 952 416 | $\\theta$ 417 | 953 418 | $\\iota$ 419 | 954 420 | $\\kappa$ 421 | 955 422 | $\\lambda$ 423 | 956 424 | $\\mu$ 425 | 957 426 | $\\nu$ 427 | 958 428 | $\\xi$ 429 | 959 430 | o 431 | 960 432 | $\\pi$ 433 | 961 434 | $\\rho$ 435 | 962 436 | $\\varsigma$ 437 | 963 438 | $\\sigma$ 439 | 964 440 | $\\tau$ 441 | 965 442 | $\\upsilon$ 443 | 966 444 | $\\phi$ 445 | 967 446 | $\\chi$ 447 | 968 448 | $\\psi$ 449 | 969 450 | $\\omega$ 451 | 977 452 | $\\vartheta$ 453 | 981 454 | $\\varphi$ 455 | 982 456 | $\\varpi$ 457 | 1008 458 | $\\varkappa$ 459 | 1009 460 | $\\varrho$ 461 | 1013 462 | $\\epsilon$ 463 | -------------------------------------------------------------------------------- /progs/tm-zotero/profile.scm: -------------------------------------------------------------------------------- 1 | ;;; coding: utf-8 2 | ;;; ✠ ✞ ♼ ☮ ☯ ☭ ☺ 3 | ;;; 4 | ;;; MODULE : zotero/profile.scm 5 | ;;; DESCRIPTION : Zotero Connector Plugin code profiling (development aid) 6 | ;;; COPYRIGHT : (C) 2016 Karl M. Hegbloom 7 | ;;; 8 | ;;; This software falls under the GNU general public license version 3 or 9 | ;;; later. It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file 10 | ;;; LICENSE in the root directory or 11 | ;;; 12 | ;;;; 13 | 14 | ;;; This is *not* in it's own module for a reason, maybe... I might never use 15 | ;;; it. It does not work yet. I may just abandon it. 16 | 17 | ;; 18 | ;; Guile 2 has `statprof'... but Guile 1.8 does not and can't run it. 19 | 20 | (use-modules (srfi srfi-1)) ;; for-each 21 | 22 | (define-public zt-profile-funcs 23 | '( 24 | ;;x zt-shown-buffer-body-paragraphs 25 | as-string 26 | ;;x zt-get-DocumentID 27 | ;;x zt-get-new-fieldID 28 | ;;x zt-field-refbinding-key 29 | ;;x zt-get-refbinding 30 | zt-insert-new-field 31 | zt-find-zfield 32 | zt-go-to-zfield 33 | ;;x zt-zfield-ID ;; accessor (tree-ref t 0) 34 | ;;x zt-zfield-Code ;; accessor 35 | ;;zt-zfield-NoteIndex 36 | ;;x zt-zfield-Text ;; accessor (tree-ref t 2) 37 | zt-zfield-search 38 | zt-get-zfields-list ;; ? could be a slow one ? 39 | zt-get-zfield-Code-string 40 | zt-set-zfield-Code-from-string 41 | zt-parse-and-cache-zfield-Code ;; Called from zt-set-zfield-Code-from-string 42 | zt-get-zfield-Code-cache-ht-by-fieldID 43 | ;;x zt-ztbibItemRefs-ht-reset! 44 | zt-ztbibItemRefs-get-all-refs 45 | ;;x zt-ztbibItemRefs-get-zciteBibLabel 46 | ;;x zt-ztbibItemRefs-get-ztHrefFromCiteToBib-text 47 | ;;x zt-ztbibItemRefs-get-subcite-sysID 48 | zt-ztbibItemRefs-get-zfieldID 49 | zt-ztbibItemRefs-get-target-label 50 | uniq-equal? 51 | zt-ztbibItemRefs-cache-1-zbibItemRef 52 | zt-ztbibItemRefs-to-tree 53 | zt-ztbibItemRefs-parse-all 54 | zt-ext-ztbibItemRefsList 55 | zt-get-orig-zfield-Text 56 | zt-set-zfield-modified?! 57 | zt-zfield-modified?-or-undef 58 | zt-ext-flag-if-modified 59 | zt-ext-document-has-zbibliography? 60 | ;; 61 | zt-ext-ztShowID 62 | zt-ext-zbibCitationItemID 63 | zt-ext-bibitem 64 | zt-get-DocumentData 65 | zt-set-DocumentData 66 | zt-set-init-env-zotero-prefs 67 | close-zt-zotero-socket-port! 68 | ;;x set-nonblocking 69 | ;;x set-blocking 70 | ;;x get-logname 71 | ;;x zt-os-x-integration-pipe-locations 72 | get-zt-zotero-socket-port! 73 | write-network-u32 74 | read-network-u32 75 | zotero-write 76 | zotero-read 77 | safe-json-string->scm 78 | safe-scm->json-string 79 | zotero-listen ;; async, dispatcher. 80 | zt-call-zotero-integration-command 81 | ;;zotero-addCitation 82 | ;;zotero-editCitation 83 | ;;zotero-addBibliography 84 | ;;zotero-editBibliography 85 | ;;zotero-refresh 86 | ;;xUNDEF zotero-removeCodes 87 | ;;zotero-setDocPrefs 88 | ;;x notify-activated 89 | ;;x notify-disactivated 90 | ;;x parameter-show-in-menu? 91 | ;;x parameter-choice-list 92 | ;;x parameter-choice-list 93 | ;;x focus-tag-name 94 | ;;x customizable-parameters 95 | ;;x parameter-choice-list 96 | ;;x hidden-child? 97 | ;;x zt-notify-debug-trace 98 | ;;x update-document 99 | zotero-Application_getActiveDocument 100 | zotero-Document_displayAlert 101 | zotero-Document_activate 102 | zotero-Document_canInsertField 103 | zotero-Document_getDocumentData 104 | zotero-Document_setDocumentData 105 | zotero-Document_cursorInField 106 | zotero-Document_insertField 107 | zotero-Document_getFields 108 | zotero-Document_convert 109 | zotero-Document_setBibliographyStyle 110 | zotero-Document_cleanup 111 | zotero-Field_delete 112 | zotero-Field_select 113 | zotero-Field_removeCode 114 | zt-move-link-to-own-line 115 | zt-delete-one-space-to-left-of 116 | zt-fixup-embedded-slink-as-url 117 | zt-zotero-regex-transform 118 | zt-zotero-str_text->texmacs 119 | with-like-search 120 | zt-zfield-IsBib? 121 | zt-zfield-IsNote? 122 | zotero-Field_setText 123 | zotero-Field_getText 124 | zotero-Field_setCode 125 | zotero-Field_getCode 126 | zotero-Field_convert 127 | )) 128 | 129 | 130 | (use-modules (ice-9 format)) 131 | (use-modules (ice-9 debugging traps)) 132 | (use-modules (ice-9 debugging trace)) 133 | 134 | ;;; Default: (set-trace-layout "|~3@a: ~a\n" trace/stack-real-depth trace/info) 135 | ;;; 136 | (set-trace-layout "|~a:~3@a: ~a\n" 137 | trace/source 138 | trace/stack-real-depth 139 | trace/info) 140 | 141 | 142 | 143 | (define calls (make-hash-table)) 144 | (define total (make-hash-table)) 145 | 146 | 147 | (define (calls+1! procname) 148 | (hash-set! calls procname 149 | (+ (hash-ref calls procname 0) 1))) 150 | 151 | 152 | (define (total+! procname t) 153 | (hash-set! total procname 154 | (+ (hash-ref total procname 0) t))) 155 | 156 | 157 | ;; This does not function properly. 158 | (define-public (make-accumulate-time-func procname) 159 | "Trap behavior: Measure the accumulated time spent in and below a specified procedure." 160 | `(lambda (trap-context) 161 | (calls+1! ,procname) 162 | (let ((entry (current-time))) 163 | (at-exit trap-context 164 | (lambda (ignored) 165 | (total+! (- (current-time) entry))))))) 166 | 167 | (define-public (time! proc) 168 | (install-trap (make 169 | #:procedure proc 170 | #:behaviour (make-accumulate-time-func procname)))) 171 | 172 | 173 | (define-public (setup-time-profiling) 174 | (for-each (lambda (f) 175 | (time! f) zt-profile-funcs))) 176 | 177 | 178 | (define-public (show-times) 179 | (let loop ((funcs zt-profile-funcs)) 180 | (cond 181 | ((null? funcs) (newline)) 182 | (else 183 | (let* ((f (car funcs)) 184 | (s (symbol->string f))) 185 | (format (current-output-port) "~a:~a:~a\n" 186 | s 187 | (hash-ref calls s 0) 188 | (hash-ref total s 0)) 189 | (loop (cdr funcs))))))) 190 | 191 | 192 | (define-public (clear-times) 193 | (set! calls (make-hash-table)) 194 | (set! total (make-hash-table))) 195 | 196 | 197 | 198 | (define-public (break! proc) 199 | (install-trap (make 200 | #:procedure proc 201 | #:behaviour gds-debug-trap))) 202 | 203 | 204 | (define-public (trace! proc) 205 | (install-trap (make 206 | #:procedure proc 207 | #:behaviour (list trace-trap 208 | trace-at-exit)))) 209 | 210 | (define-public (setup-tracing) 211 | (for-each trace! zt-profile-funcs)) 212 | 213 | (define-public (trace-subtree! proc) 214 | (install-trap (make 215 | #:procedure proc 216 | #:behaviour (list trace-trap 217 | trace-until-exit)))) 218 | 219 | 220 | -------------------------------------------------------------------------------- /progs/tm-zotero/json/builder.scm: -------------------------------------------------------------------------------- 1 | ;;; coding: utf-8 2 | ;;; ¶ 3 | ;;; (tm-zotero json builder) --- Guile JSON implementation. 4 | 5 | ;; Copyright (C) 2013 Aleix Conchillo Flaque 6 | ;; 7 | ;; This file is part of guile-json. 8 | ;; 9 | ;; guile-json is free software; you can redistribute it and/or 10 | ;; modify it under the terms of the GNU Lesser General Public 11 | ;; License as published by the Free Software Foundation; either 12 | ;; version 3 of the License, or (at your option) any later version. 13 | ;; 14 | ;; guile-json is distributed in the hope that it will be useful, 15 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | ;; Lesser General Public License for more details. 18 | ;; 19 | ;; You should have received a copy of the GNU Lesser General Public 20 | ;; License along with guile-json; if not, write to the Free Software 21 | ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 22 | ;; 02110-1301 USA 23 | 24 | ;;; Commentary: 25 | 26 | ;; JSON module for Guile 27 | 28 | ;;; Code: 29 | 30 | (define-module (tm-zotero json builder) 31 | #:use-module (ice-9 format) 32 | #:use-module (ice-9 optargs) 33 | #:use-module (srfi srfi-1) 34 | ;; #:use-module (rnrs bytevectors) 35 | #:use-module (srfi srfi-4) 36 | #:export (scm->json 37 | scm->json-string)) 38 | 39 | 40 | (define bytevector-u8-ref u8vector-ref) 41 | (define bytevector-length u8vector-length) 42 | 43 | ;; 44 | ;; String builder helpers 45 | ;; 46 | 47 | (define (unicode->string unicode) 48 | (format #f "\\u~4,'0x" unicode)) 49 | 50 | (define (char->unicode-string c) 51 | (let ((unicode (char->integer c))) 52 | (if (< unicode 32) 53 | (unicode->string unicode) 54 | (string c)))) 55 | 56 | (define (u8v-2->unicode bv) 57 | (let ((bv0 (bytevector-u8-ref bv 0)) 58 | (bv1 (bytevector-u8-ref bv 1))) 59 | (+ (ash (logand bv0 #b00011111) 6) 60 | (logand bv1 #b00111111)))) 61 | 62 | (define (u8v-3->unicode bv) 63 | (let ((bv0 (bytevector-u8-ref bv 0)) 64 | (bv1 (bytevector-u8-ref bv 1)) 65 | (bv2 (bytevector-u8-ref bv 2))) 66 | (+ (ash (logand bv0 #b00001111) 12) 67 | (ash (logand bv1 #b00111111) 6) 68 | (logand bv2 #b00111111)))) 69 | 70 | (define (build-char-string c) 71 | (let* (;;(bv (string->utf8 (string c))) 72 | (bv (list->u8vector (list (char->integer c)))) 73 | (len (bytevector-length bv))) 74 | (cond 75 | ;; A single byte UTF-8 76 | ((eq? len 1) (char->unicode-string c)) 77 | ;; If we have a 2 or 3 byte UTF-8 we need to output it as \uHHHH 78 | ((or (eq? len 2) (eq? len 3)) 79 | (let ((unicode (if (eq? len 2) 80 | (u8v-2->unicode bv) 81 | (u8v-3->unicode bv)))) 82 | (unicode->string unicode))) 83 | ;; Anything else should wrong, hopefully. 84 | (else (throw 'json-invalid))))) 85 | 86 | ;; 87 | ;; Object builder functions 88 | ;; 89 | 90 | (define (build-object-pair p port escape pretty level) 91 | (display (indent-string pretty level) port) 92 | (json-build-string (car p) port escape) 93 | (display " : " port) 94 | (json-build (cdr p) port escape pretty level)) 95 | 96 | (define (build-newline port pretty) 97 | (cond (pretty (newline port)))) 98 | 99 | (define (indent-string pretty level) 100 | (if pretty (format #f "~v_" (* 4 level)) "")) 101 | 102 | ;; 103 | ;; Main builder functions 104 | ;; 105 | 106 | (define (json-build-null port) 107 | (display "null" port)) 108 | 109 | (define (json-build-boolean scm port) 110 | (display (if scm "true" "false") port)) 111 | 112 | (define (json-build-number scm port) 113 | (if (and (rational? scm) (not (integer? scm))) 114 | (display (number->string (exact->inexact scm)) port) 115 | (display (number->string scm) port))) 116 | 117 | (define (json-build-string scm port escape) 118 | (display "\"" port) 119 | (display 120 | (list->string 121 | (fold-right append '() 122 | (map 123 | (lambda (c) 124 | (case c 125 | ((#\" #\\) `(#\\ ,c)) 126 | ((#\010) '(#\\ #\b)) 127 | ((#\014) '(#\\ #\f)) 128 | ((#\012) '(#\\ #\n)) 129 | ((#\015) '(#\\ #\r)) 130 | ((#\011) '(#\\ #\t)) 131 | ;; ((#\bs) '(#\\ #\b)) 132 | ;; ((#\ff) '(#\\ #\f)) 133 | ;; ((#\lf) '(#\\ #\n)) 134 | ;; ((#\cr) '(#\\ #\r)) 135 | ;; ((#\ht) '(#\\ #\t)) 136 | ((#\/) (if escape `(#\\ ,c) (list c))) 137 | (else (string->list (build-char-string c))))) 138 | (string->list scm)))) 139 | port) 140 | (display "\"" port)) 141 | 142 | (define (json-build-array scm port escape pretty level) 143 | (display "[" port) 144 | (if (not (null? scm)) 145 | (begin 146 | (json-build (car scm) port escape pretty (+ level 1)) 147 | (for-each (lambda (v) 148 | (display ", " port) 149 | (json-build v port escape pretty (+ level 1))) 150 | (cdr scm)))) 151 | (display "]" port)) 152 | 153 | (define (json-build-object scm port escape pretty level) 154 | (build-newline port pretty) 155 | (simple-format port "~A{" (indent-string pretty level)) 156 | (build-newline port pretty) 157 | (let ((pairs (hash-map->list cons scm))) 158 | (if (not (null? pairs)) 159 | (begin 160 | (build-object-pair (car pairs) port escape pretty (+ level 1)) 161 | (for-each (lambda (p) 162 | (display "," port) 163 | (build-newline port pretty) 164 | (build-object-pair p port escape pretty (+ level 1))) 165 | (cdr pairs))))) 166 | (build-newline port pretty) 167 | (simple-format port "~A}" (indent-string pretty level))) 168 | 169 | (define (json-build scm port escape pretty level) 170 | (cond 171 | ;;((eq? scm #nil) (json-build-null port)) 172 | ((eq? scm '()) (json-build-null port)) 173 | ((boolean? scm) (json-build-boolean scm port)) 174 | ((number? scm) (json-build-number scm port)) 175 | ((string? scm) (json-build-string scm port escape)) 176 | ((list? scm) (json-build-array scm port escape pretty level)) 177 | ((hash-table? scm) (json-build-object scm port escape pretty level)) 178 | (else (throw 'json-invalid)))) 179 | 180 | ;; 181 | ;; Public procedures 182 | ;; 183 | 184 | (define* (scm->json scm 185 | #:optional (port (current-output-port)) 186 | #:key (escape #f) (pretty #f)) 187 | "Creates a JSON document from native. The argument @var{scm} contains 188 | the native value of the JSON document. Takes one optional argument, 189 | @var{port}, which defaults to the current output port where the JSON 190 | document will be written." 191 | (json-build scm port escape pretty 0)) 192 | 193 | (define* (scm->json-string scm #:key (escape #f) (pretty #f)) 194 | "Creates a JSON document from native into a string. The argument 195 | @var{scm} contains the native value of the JSON document." 196 | (call-with-output-string 197 | (lambda (p) 198 | (scm->json scm p #:escape escape #:pretty pretty)))) 199 | 200 | ;;; (json builder) ends here 201 | -------------------------------------------------------------------------------- /progs/convert/rtf/html.conf: -------------------------------------------------------------------------------- 1 | comment_begin 2 | 5 | 6 | document_begin 7 | document_end 8 | header_begin 9 | header_end 10 | document_title_begin 11 | document_title_end 12 | document_author_begin 13 | document_author_end 14 | document_changedate_begin 15 | document_changedate_end 16 | body_begin 17 | body_end 18 | paragraph_begin 19 |

20 | paragraph_end 21 |

22 | 23 | center_begin 24 |
25 | center_end 26 |
27 | 28 | justify_begin 29 |
30 | 31 | justify_end 32 |
33 | 34 | align_left_begin 35 |
36 | 37 | align_left_end 38 |
39 | 40 | align_right_begin 41 |
42 | 43 | align_right_end 44 |
45 | 46 | forced_space 47 |   48 | line_break 49 |
50 | 51 | page_break 52 |


53 | 54 | hyperlink_begin 55 | hyperlink 58 | imagelink_begin 59 | 62 | table_begin 63 | 64 | 65 | table_end 66 |
67 | 68 | table_row_begin 69 | 70 | table_row_end 71 | 72 | 73 | table_cell_begin 74 | 75 | table_cell_end 76 | 77 | 78 | font_begin 79 | 80 | font_end 81 | 82 | fontsize_begin 83 | 84 | fontsize_end 85 | 86 | fontsize8_begin 87 | 88 | fontsize8_end 89 | 90 | fontsize10_begin 91 | 92 | fontsize10_end 93 | 94 | fontsize12_begin 95 | 96 | fontsize12_end 97 | 98 | fontsize14_begin 99 | 100 | fontsize14_end 101 | 102 | fontsize18_begin 103 | 104 | fontsize18_end 105 | 106 | fontsize24_begin 107 | 108 | fontsize24_end 109 | 110 | smaller_begin 111 | 112 | smaller_end 113 | 114 | bigger_begin 115 | 116 | bigger_end 117 | 118 | foreground_begin 119 | 120 | foreground_end 121 | 122 | background_begin 123 | 124 | background_end 125 | 126 | bold_begin 127 | 128 | bold_end 129 | 130 | italic_begin 131 | 132 | italic_end 133 | 134 | underline_begin 135 | 136 | underline_end 137 | 138 | dbl_underline_begin 139 | 140 | dbl_underline_end 141 | 142 | superscript_begin 143 | 144 | superscript_end 145 | 146 | subscript_begin 147 | 148 | subscript_end 149 | 150 | strikethru_begin 151 | 152 | strikethru_end 153 | 154 | dbl_strikethru_begin 155 | 156 | dbl_strikethru_end 157 | 158 | emboss_begin 159 | 160 | emboss_end 161 | 162 | engrave_begin 163 | 164 | engrave_end 165 | 166 | shadow_begin 167 | 168 | shadow_end 169 | 170 | outline_begin 171 | 172 | outline_end 173 | 174 | expand_begin 175 | 176 | expand_end 177 | 178 | pointlist_begin 179 |

    180 | 181 | pointlist_end 182 |
183 | 184 | pointlist_item_begin 185 |
  • 186 | pointlist_item_end 187 |
  • 188 | 189 | numericlist_begin 190 |
      191 | 192 | numericlist_end 193 |
    194 | 195 | numericlist_item_begin 196 |
  • 197 | numericlist_item_end 198 |
  • 199 | 200 | unisymbol_print 201 | &#%; 202 | utf8_encoding 203 | \n 204 | chars.right_quote 205 | ’ 206 | chars.left_quote 207 | ‘ 208 | chars.right_dbl_quote 209 | ” 210 | chars.left_dbl_quote 211 | “ 212 | chars.endash 213 | – 214 | chars.emdash 215 | — 216 | chars.bullet 217 | • 218 | chars.lessthan 219 | < 220 | chars.greaterthan 221 | > 222 | chars.amp 223 | & 224 | chars.copyright 225 | © 226 | chars.trademark 227 | ™ 228 | chars.nonbreaking_space 229 |   230 | 231 | " 232 | 233 | & 234 | 34 235 | " 236 | 38 237 | & 238 | 60 239 | < 240 | 62 241 | > 242 | 160 243 |   244 | 161 245 | ¡ 246 | 162 247 | ¢ 248 | 163 249 | £ 250 | 164 251 | ¤ 252 | 165 253 | ¥ 254 | 166 255 | ¦ 256 | 167 257 | § 258 | 168 259 | ¨ 260 | 169 261 | © 262 | 170 263 | ª 264 | 171 265 | « 266 | 172 267 | ¬ 268 | 173 269 | ­ 270 | 174 271 | ® 272 | 175 273 | ¯ 274 | 176 275 | ° 276 | 177 277 | ± 278 | 178 279 | ² 280 | 179 281 | ³ 282 | 180 283 | ´ 284 | 181 285 | µ 286 | 182 287 | ¶ 288 | 183 289 | · 290 | 184 291 | ¸ 292 | 185 293 | ¹ 294 | 186 295 | º 296 | 187 297 | » 298 | 188 299 | ¼ 300 | 189 301 | ½ 302 | 190 303 | ¾ 304 | 191 305 | ¿ 306 | 192 307 | À 308 | 193 309 | Á 310 | 194 311 |  312 | 195 313 | à 314 | 196 315 | Ä 316 | 197 317 | Å 318 | 198 319 | Æ 320 | 199 321 | Ç 322 | 200 323 | È 324 | 201 325 | É 326 | 202 327 | Ê 328 | 203 329 | Ë 330 | 204 331 | Ì 332 | 205 333 | Í 334 | 206 335 | Î 336 | 207 337 | Ï 338 | 208 339 | Ð 340 | 209 341 | Ñ 342 | 210 343 | Ò 344 | 211 345 | Ó 346 | 212 347 | Ô 348 | 213 349 | Õ 350 | 214 351 | Ö 352 | 215 353 | × 354 | 216 355 | Ø 356 | 217 357 | Ù 358 | 218 359 | Ú 360 | 219 361 | Û 362 | 220 363 | Ü 364 | 221 365 | Ý 366 | 222 367 | Þ 368 | 223 369 | ß 370 | 224 371 | à 372 | 225 373 | á 374 | 226 375 | â 376 | 227 377 | ã 378 | 228 379 | ä 380 | 229 381 | å 382 | 230 383 | æ 384 | 231 385 | ç 386 | 232 387 | è 388 | 233 389 | é 390 | 234 391 | ê 392 | 235 393 | ë 394 | 236 395 | ì 396 | 237 397 | í 398 | 238 399 | î 400 | 239 401 | ï 402 | 240 403 | ð 404 | 241 405 | ñ 406 | 242 407 | ò 408 | 243 409 | ó 410 | 244 411 | ô 412 | 245 413 | õ 414 | 246 415 | ö 416 | 247 417 | ÷ 418 | 248 419 | ø 420 | 249 421 | ù 422 | 250 423 | ú 424 | 251 425 | û 426 | 252 427 | ü 428 | 253 429 | ý 430 | 254 431 | þ 432 | 255 433 | ÿ 434 | 338 435 | Œ 436 | 339 437 | œ 438 | 352 439 | Š 440 | 353 441 | š 442 | 376 443 | Ÿ 444 | 402 445 | ƒ 446 | 710 447 | ˆ 448 | 732 449 | ˜ 450 | 913 451 | Α 452 | 914 453 | Β 454 | 915 455 | Γ 456 | 916 457 | Δ 458 | 917 459 | Ε 460 | 918 461 | Ζ 462 | 919 463 | Η 464 | 920 465 | Θ 466 | 921 467 | Ι 468 | 922 469 | Κ 470 | 923 471 | Λ 472 | 924 473 | Μ 474 | 925 475 | Ν 476 | 926 477 | Ξ 478 | 927 479 | Ο 480 | 928 481 | Π 482 | 929 483 | Ρ 484 | 931 485 | Σ 486 | 932 487 | Τ 488 | 933 489 | Υ 490 | 934 491 | Φ 492 | 935 493 | Χ 494 | 936 495 | Ψ 496 | 937 497 | Ω 498 | 945 499 | α 500 | 946 501 | β 502 | 947 503 | γ 504 | 948 505 | δ 506 | 949 507 | ε 508 | 950 509 | ζ 510 | 951 511 | η 512 | 952 513 | θ 514 | 953 515 | ι 516 | 954 517 | κ 518 | 955 519 | λ 520 | 956 521 | μ 522 | 957 523 | ν 524 | 958 525 | ξ 526 | 959 527 | ο 528 | 960 529 | π 530 | 961 531 | ρ 532 | 962 533 | ς 534 | 963 535 | σ 536 | 964 537 | τ 538 | 965 539 | υ 540 | 966 541 | φ 542 | 967 543 | χ 544 | 968 545 | ψ 546 | 969 547 | ω 548 | 977 549 | ϑ 550 | 978 551 | ϒ 552 | 981 553 | ϕ 554 | 982 555 | ϖ 556 | 8194 557 |   558 | 8195 559 |   560 | 8201 561 |   562 | 8204 563 | ‌ 564 | 8205 565 | ‍ 566 | 8206 567 | ‎ 568 | 8207 569 | ‏ 570 | 8211 571 | – 572 | 8212 573 | — 574 | 8216 575 | ‘ 576 | 8217 577 | ’ 578 | 8220 579 | “ 580 | 8221 581 | ” 582 | 8222 583 | „ 584 | 8224 585 | † 586 | 8225 587 | ‡ 588 | 8226 589 | • 590 | 8230 591 | … 592 | 8240 593 | ‰ 594 | 8242 595 | ′ 596 | 8243 597 | ″ 598 | 8249 599 | ‹ 600 | 8250 601 | › 602 | 8254 603 | ‾ 604 | 8260 605 | ⁄ 606 | 8364 607 | € 608 | 8472 609 | ℘ 610 | 8465 611 | ℑ 612 | 8476 613 | ℜ 614 | 8482 615 | ™ 616 | 8501 617 | ℵ 618 | 8592 619 | ← 620 | 8593 621 | ↑ 622 | 8594 623 | → 624 | 8595 625 | ↓ 626 | 8596 627 | ↔ 628 | # 8597 up/down arrow - no HTML named entity 629 | 8629 630 | ↵ 631 | 8656 632 | ⇐ 633 | 8657 634 | ⇑ 635 | 8658 636 | ⇒ 637 | 8659 638 | ⇓ 639 | 8660 640 | ⇔ 641 | 8704 642 | ∀ 643 | 8706 644 | ∂ 645 | 8707 646 | ∃ 647 | 8709 648 | ∅ 649 | 8711 650 | ∇ 651 | 8712 652 | ∈ 653 | 8713 654 | ∉ 655 | 8715 656 | ∋ 657 | 8719 658 | ∏ 659 | 8721 660 | ∑ 661 | 8722 662 | − 663 | 8727 664 | ∗ 665 | 8730 666 | √ 667 | 8733 668 | ∝ 669 | 8734 670 | ∞ 671 | 8736 672 | ∠ 673 | 8743 674 | ∧ 675 | 8744 676 | ∨ 677 | 8745 678 | ∩ 679 | 8746 680 | ∪ 681 | 8747 682 | ∫ 683 | 8756 684 | ∴ 685 | 8764 686 | ∼ 687 | 8773 688 | ≅ 689 | 8776 690 | ≈ 691 | 8800 692 | ≠ 693 | 8801 694 | ≡ 695 | 8804 696 | ≤ 697 | 8805 698 | ≥ 699 | 8834 700 | ⊂ 701 | 8835 702 | ⊃ 703 | 8836 704 | ⊄ 705 | 8838 706 | ⊆ 707 | 8839 708 | ⊇ 709 | 8853 710 | ⊕ 711 | 8855 712 | ⊗ 713 | 8869 714 | ⊥ 715 | 8901 716 | ⋅ 717 | 8968 718 | ⌈ 719 | 8969 720 | ⌉ 721 | 8970 722 | ⌊ 723 | 8971 724 | ⌋ 725 | 9801 726 | ⟨ 727 | 9802 728 | ⟩ 729 | 9674 730 | ◊ 731 | 9824 732 | ♠ 733 | 9827 734 | ♣ 735 | 9829 736 | ♥ 737 | 9839 738 | ♦ 739 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Zotero - TeXmacs integration plugin and citation styles. # 2 | 3 | __This branch is the active (Α) development branch of this program. It is ready to use with Juris-M 5.0 now.__ 4 | 5 | __I need beta testers. Please report both success and failure to this [issue tracker](https://github.com/KarlHegbloom/zotero-texmacs-integration/issues)!__ 6 | 7 | __In particular, I have not yet tested this with Zotero 5.0, since I work primarily with Juris-M 5.0. Testing this is on my todo list.__ 8 | 9 | ## News ## 10 | 11 | * You must, as always, keep your Juris-M / Zotero updated to the newest release, and stay updated to the latest [propachi-texmacs](https://github.com/KarlHegbloom/propachi-texmacs/releases). This addon installs a modified citeproc-js that (a) defines the `tmzoterolatex` output format, since the default, `RTF`, sent via the editor integration protocol, does not carry the necessary information to make this TeXmacs plugin work right, and mainly, TeXmacs already can import a LaTeX document, but has no existing translator for RTF; (b) installs a `variableWrapper` function into Juris-M / Zotero that semantically enhances and linkifies citations texts. It also "_monkey patches_" the editor integration to ensure that the correct output format is sent to TeXmacs. Thus, the [propachi-texmacs](https://github.com/KarlHegbloom/propachi-texmacs/releases) addon is necessary for Juris-M / Zotero to integrate correctly with this TeXmacs plugin. 12 | 13 | * __You no longer need to disable the propachi-texmacs addin when you want to use Juris-M with OpenOffice or Word.__ That is because the setting of the outputFormat is moved into the document prefs, defaulting to RTF when the editor plugin does not specify otherwise. That means it works with both OpenOffice / Word (`RTF` outputFormat) as well as with the zotero-texmacs-integration (`tmzoterolatex` outputFormat). You can have both on the screen using Juris-M at the same time if you like. 14 | 15 | * We are working on having installable software bundle packages of TeXmacs for MacOS and Windows that contains the necessary support for this plugin. 16 | 17 | * Key bindings changed: In the `zcite` context, `Tab` now calls `affirmCitation` and `Ctrl-Enter` calls `editCitation`. In the `zbibliography` context, `Tab` and `Ctrl-Enter` both call `editBibliography`. 18 | 19 | * `clipboard-copy`, `clipboard-cut`, and `clipboard-paste` now operate on new `zcite` sub-dividing tags, `zciteLayoutPrefix`, `zciteLayoutDelimiter`, `zciteLayoutSuffix`, and `zsubCite`. So when a `zcite` is disactivated via `Backspace` or the focus toolbar button, you have access to selection of a region for `clipboard-copy` or `clipboard-cut`, and when that region consists only of complete `zsubCite` and any of the `zciteLayout*` tags, then those `zsubCite`'s will get put onto the clipboard wrapped inside of a full `zcite`, ready to be pasted into the document's main text. Any clipping that is of just one `zcite` can be pasted into a disactivated `zcite` as well, as long as the cursor is *between* the `zsubCite` and `zciteLayout*` tags! 20 | 21 | 22 | ## Documentation and YouTube Screencast Demos ## 23 | 24 | RTFM: [tm-zotero-tutorial.en.pdf on Github](https://github.com/KarlHegbloom/zotero-texmacs-integration/blob/master/doc/tm-zotero-tutorial.en.pdf) 25 | 26 | 27 | [Juris-M / Zotero and TeXmacs Integration Screencasts Playlist](https://www.youtube.com/playlist?list=PLN9Ht5SDLPrbPHHyRvTK7bw1awqTsllWy) 28 | 29 | __NEW__ [Juris-M / Zotero and TeXmacs Integration Screencast 2017 03 08](https://www.youtube.com/watch?v=iQXlESwdYwE&index=1&list=PLN9Ht5SDLPrbPHHyRvTK7bw1awqTsllWy&t=195s) 30 | 31 | [Juris-M / Zotero and TeXmacs Integration Screencast 2017 02 17](https://www.youtube.com/watch?v=5Fy1Mw0GSKQ&index=1&list=PLN9Ht5SDLPrbPHHyRvTK7bw1awqTsllWy) 32 | 33 | [Juris-M / Zotero and TeXmacs Integration Screencast 03](https://www.youtube.com/watch?v=LAjLk7rDGi8&index=1&list=PLN9Ht5SDLPrbPHHyRvTK7bw1awqTsllWy) 34 | 35 | [Juris-M / Zotero and TeXmacs Integration Screencast 02](https://www.youtube.com/watch?v=74tzA2OCu4I&index=2&list=PLN9Ht5SDLPrbPHHyRvTK7bw1awqTsllWy) 36 | 37 | [Juris-M / Zotero and TeXmacs Integration Screencast 01](https://www.youtube.com/watch?v=ZhOton-p3T8&index=1&list=PLN9Ht5SDLPrbPHHyRvTK7bw1awqTsllWy) 38 | 39 | 40 | ## Important Changes for this branch: ## 41 | 42 | ### To install this, you have to clone this repository and checkout this branch. You do not need to clone the git submodules for a working checkout of this TeXmacs plugin. ### 43 | 44 | The reason for the symlink tests is that I've changed some file names and some 45 | module names. If you had symlinks to the source in `~/TeXmacs/plugins` before, 46 | they should be removed, and then only one created named `tm-zotero` that points 47 | to the top directory of a clone of the source from github, *e.g.,* 48 | 49 | cd ~; 50 | mkdir --parents ~/src/Juris-M || true; 51 | cd ~/src/Juris-M; 52 | git clone https://github.com/KarlHegbloom/zotero-texmacs-integration; 53 | cd zotero-texmacs-integration; 54 | git checkout master; 55 | cd ~; 56 | mkdir --parents ~/.TeXmacs/plugins || true; 57 | cd ~/.TeXmacs/plugins; 58 | [[ -L "legal-brief" -a -L "zotero" -a $(realpath "legal-brief") = $(realpath "zotero" ]] && rm legal-brief zotero; 59 | [[ -L "zotero" ]] && rm zotero; 60 | ln -s ~/src/Juris-M/zotero-texmacs-integration tm-zotero; 61 | 62 | You do not need to clone the submodules unless you are curious or plan to help 63 | develop this program. The are only required for development or bugfix work, not 64 | for normal use of this plugin. Everything that TeXmacs needs to run this plugin 65 | is already in the toplevel git project. The citeproc-js and propachi-texmacs 66 | submodules are the source to the propachi-texmacs XPI that is required to be 67 | installed in Juris-M for this plugin to function properly. 68 | 69 | 70 | ## How to get this up and running: ## 71 | 72 | * Install a recent (development snapshot of) TeXmacs. This program 73 | is untested with older versions of TeXmacs. If you can not build 74 | your own copy or use the Ubuntu deb package of TeXmacs that I have 75 | available, you'll have to use whatever version is available to 76 | you... let me know if it works alright. I think it will be 77 | compatible with the last official release version of TeXmacs, as 78 | long as it's built with Guile 1.8. I doubt it will work with older 79 | versions of Guile. 80 | 81 | https://github.com/KarlHegbloom/texmacs/releases 82 | 83 | If you have trouble with one build, try an older one. I'll try and 84 | keep them fresh and remove ones that are not working right. They 85 | are reasonably stable, but under development right now. 86 | 87 | * Install Juris-M from: 88 | 89 | https://juris-m.github.io 90 | 91 | * This works with Juris-M standalone. The last tested version is 92 | 93 | [v5.0.37m10](https://our.law.nagoya-u.ac.jp/download/client/Jurism-5.0.37m10_linux-x86_64.tar.bz2) 94 | 95 | * [Should be optional] Install the OpenOffice plugin via Preferences > Cite > Word Processors. 96 | 97 | * Install the latest propachi-texmacs xpi from: 98 | 99 | https://github.com/KarlHegbloom/propachi-texmacs/releases 100 | 101 | Download the XPI file, then from inside of Juris-M, select Tools -> 102 | Add-ins..., and from there, use the drop-down from the gear icon on the 103 | upper-right of the add-in's dialog to select "Install add-in from file...", 104 | find the downloaded XPI, and install it. 105 | 106 | This monkey-patch loads a citeproc into Juris-M that has the right 107 | outputFormat defined for the TeXmacs integration. It also ensures that the 108 | integration uses that outputFormat by monkey-patching it so that it 109 | defaults to RTF as before, but when the document prefs carry an 110 | outputFormat setting for a particular document (set by the editor plugin), 111 | it uses that. 112 | 113 | Check there for updates or "watch" the github repository to get email when 114 | I update it. I will try to get automatic updates to function when I have 115 | time for that. 116 | 117 | * Now clone this repository, and then symlink to it from your 118 | TeXmacs home directory to enable it. I normally clone it into a 119 | source code directory and use a symlink from the TeXmacs 120 | directory: 121 | 122 | cd ~; 123 | mkdir --parents ~/src/Juris-M || true; 124 | cd ~/src/Juris-M; 125 | git clone https://github.com/KarlHegbloom/zotero-texmacs-integration; 126 | cd zotero-texmacs-integration; 127 | git checkout master; 128 | cd ~; 129 | mkdir --parents ~/.TeXmacs/plugins || true; 130 | cd ~/.TeXmacs/plugins; 131 | [[ -L "legal-brief" -a -L "zotero" -a $(realpath "legal-brief") = $(realpath "zotero" ]] && rm legal-brief zotero; 132 | [[ -L "zotero" ]] && rm zotero; 133 | ln -s ~/src/Juris-M/zotero-texmacs-integration tm-zotero; 134 | 135 | You could download a zip from github, but then you won't have the 136 | easy update functionality you get by using git. To update the code 137 | when I change it, you run: 138 | 139 | cd ~/src/Juris-M/zotero-texmacs-integration; 140 | git checkout master; 141 | git pull; 142 | 143 | Now when you start TeXmacs, it will be able to find the style and the 144 | scheme program that makes it work. Start a new document, and add the 145 | `tm-zotero` style package. (Document menu, or bottom left toolbar 146 | icons.) A **Zotero** menu will appear on the TeXmacs menu bar. Try 147 | adding a citation. If I've done my job right, and you've followed the 148 | instructions correctly, it ought to work. 149 | 150 | I've also included my `legal-brief` style for people to try. Open a 151 | new document, and set the main document style to that. Then try the 152 | hybrid LaTeX-like commands: 153 | 154 | \Legal-Heading 155 | 156 | or 157 | 158 | \Cert-of-Service 159 | 160 | The `jm-indigobook-catsort-bib.csl` can be added using the Juris-M preferences 161 | dialog on the `Cite | Styles` tab. 162 | 163 | Please use the Github issue tracker to report any problems. That will 164 | assist me in not losing any trouble-tickets: 165 | 166 | https://github.com/KarlHegbloom/zotero-texmacs-integration/issues 167 | 168 | 169 | ## Other potentially interesting media ## 170 | 171 | *Yes, after it's all working again, I'll update the documentation!* 172 | 173 | This article is very interesting. It talks about verified mathematical 174 | documents... it makes me wonder if there can be verified legal documents? 175 | 176 | http://www.sciencedirect.com/science/article/pii/S1571066107001727 177 | -------------------------------------------------------------------------------- /tests/debug-ctrl-pagedown.tm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <\body> 6 | | Hegbloom>, 2014 UT App 213 (2014).>abc 8 | 9 | |Bruce 10 | Green & Ellen Yaroshefsky, , 6 12 | 467 13 | (2009).> 14 | 15 | |Robert 16 | Jr Spurrier, , 11 347 (1975\U1976).> 19 | 20 | 21 | <\initial> 22 | <\collection> 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | \\