Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
54c6463
remove [utf8x] for inputenc to be compatible with hyperref
Ossifragus Jul 22, 2022
5ea1fd1
Obesitywithsidenotes example use github local copy
Ossifragus Jul 22, 2022
6e4d6dd
new troubleshooting and some fixes to sty file
haimbar Aug 5, 2022
17e858b
fixed a few typos and added notes on some error cases
haimbar Aug 6, 2022
1f13419
tested all the examples with the new sty file
haimbar Aug 6, 2022
812ae76
deleted some redundant files in new example
haimbar Aug 6, 2022
b9d0920
added a document on using a Makefile, fixed the troubleshooting
haimbar Aug 6, 2022
10edfa1
added an example with python to the Collaborate example
haimbar Aug 6, 2022
b0491d3
include tmp folder for collaborative example
Ossifragus Aug 10, 2022
bcd92b8
updated the files for a CTAN upload
haimbar Aug 10, 2022
53089c9
fixed a typo in the Collaboration example
haimbar Aug 11, 2022
c5211d4
updates to conform with CTAN comments
haimbar Aug 11, 2022
4ba62d9
change tmp to \generated
Ossifragus Aug 12, 2022
24cf122
rename tmp to generated for Collaborate example
Ossifragus Aug 12, 2022
bd01b6a
Merge branch 'master' into tmp2generated
Ossifragus Aug 12, 2022
dab550c
reset to remove generated folders
Ossifragus Aug 14, 2022
696f123
change tmp to generated in .gitignore
Ossifragus Aug 14, 2022
f29a33d
ignore tmp as well
Ossifragus Aug 14, 2022
2c41174
add readme for the paper folder
Ossifragus Aug 14, 2022
f5e1d3d
change troubleshoot file name and add generated folder
Ossifragus Aug 17, 2022
c34db2a
replace runcode folder with two files in CTAN
Ossifragus Aug 17, 2022
ba4ac16
add action files; replace README.md with README.org
Ossifragus Aug 17, 2022
d710c99
update ignore
Ossifragus Aug 17, 2022
e5c9d70
rename troubleshoot to runcode_troubleshoot
Ossifragus Aug 17, 2022
90e5956
exclude examples from source for release
Ossifragus Aug 17, 2022
7b7cec6
remove empty footnotes section
Ossifragus Aug 17, 2022
b337817
put ctan tarball into runcode folder
Ossifragus Aug 21, 2022
555843b
change the second line to v1.7
Ossifragus Aug 21, 2022
deabf8f
changed the version number and date in the README file
haimbar Aug 21, 2022
669dc52
changed the version number and date in the README file
haimbar Aug 21, 2022
cf257e9
changed the version number and date in the README file
haimbar Aug 21, 2022
6a584fa
updated the date in the change-log
haimbar Aug 21, 2022
cee86fe
replaced tmp with generated in the QREMdoc example
haimbar Aug 21, 2022
260c3fd
updated the CTAN README file
haimbar Aug 21, 2022
9d46bc7
Remove a generated exception
Ossifragus Aug 21, 2022
00395eb
changed the version number and date in sty file
haimbar Aug 21, 2022
ff82ee0
remove generated folder from QREMdoc example
Ossifragus Aug 26, 2022
f84c35f
extract version date info from runcode.sty instead of README.org
Ossifragus Sep 3, 2022
6ddda06
ignore folder runcode/
Ossifragus Sep 3, 2022
81e7847
added support for the listing package, fixed inln so that now it can …
haimbar Jan 10, 2023
47e5a6c
simplified the formatting of inline text
haimbar Jan 10, 2023
1320d0e
fixed \inln to work for vbox with minted, listings, fvextra
Ossifragus Jan 11, 2023
7c04b48
update document for supporting listings
Ossifragus Jan 11, 2023
13b64cb
use \fvset to set default for fvextra
Ossifragus Jan 19, 2023
79c383d
added an option to name the inln-generated files
haimbar May 13, 2023
3abfa7e
fix inlnR+Julia+Matlab+Python
Ossifragus Jun 13, 2023
358e897
update MontyHall example for new \inln
Ossifragus Jun 13, 2023
deb5dd1
update hw solution example for new inln
Ossifragus Jun 13, 2023
caebc2d
update readme document for new inln comments
Ossifragus Jun 13, 2023
05cc3a8
update version to v1.9
Ossifragus Jun 14, 2023
14c0eda
minor edits on the readme
Ossifragus Jun 20, 2023
3f7bc56
create comments combining \runExtcode and \includeOutput
Ossifragus Jun 21, 2023
d49014f
change \runCodeIncOutput to \runCodeIncOut
Ossifragus Jun 21, 2023
405513c
remove loading package filecontents
Ossifragus Jun 21, 2023
bf864d3
add cache option to inln, and force RunExtCode to run if output does …
haimbar Jun 16, 2023
e5be1c2
added a cache option for the \inln macro
haimbar Jun 23, 2023
be7397c
update documentation for \runExtcode and \inln
Ossifragus Jun 23, 2023
93e6c9b
edited documentation
Ossifragus Jun 23, 2023
b0aec17
update version to 2.0
Ossifragus Jun 23, 2023
32b7eff
detokenize the commands in \inln
haimbar Jun 30, 2023
a897017
updated the README file
haimbar Jun 30, 2023
1b18d6c
updated the version number and date
haimbar Jun 30, 2023
06710f1
fixed the version description
haimbar Jul 1, 2023
d4b1b3d
added an option to show chunks of code by chunk labels
haimbar Jul 15, 2023
c2081e9
add language-specific run chunk short cuts
Ossifragus Aug 7, 2023
0041f66
break showChunk to write and show; update \runR&JuliaChunk
Ossifragus Aug 8, 2023
6f46af3
made the code more modular for language-specific commands
haimbar Sep 1, 2023
951fee4
add etoolbox; remove some }
Ossifragus Sep 4, 2023
7af050d
fix two typos
Ossifragus Sep 4, 2023
4caa226
define lang-specific commands with variables
Ossifragus Sep 6, 2023
fd17e48
add documentation for chunk related commands
Ossifragus Sep 8, 2023
0ac7d86
format issue
Ossifragus Sep 8, 2023
6bfe4e7
document \runLANGChunk; update dates and version #
Ossifragus Sep 8, 2023
1473151
two bug fixes (see README.org for details)
haimbar Jan 13, 2024
474d3ce
update version
Ossifragus Jan 16, 2024
6bc4aa1
minor format change
Ossifragus Jan 16, 2024
3df60ab
put file names between $ for warnings
Ossifragus Mar 26, 2024
45d6e79
use python advance-touch for showChunk with codes in subfolders
Ossifragus Jan 7, 2025
a9f880a
Revise version to 2.4
Ossifragus Jan 18, 2025
b7f3fe6
changed the copyright years
haimbar Jan 18, 2025
e51dc69
Fix typos and broken links
deining Jan 24, 2025
403a01f
one more typo
haimbar Jan 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .ctan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

mkdir runcode

cp -r runcode.sty runcode.tex runcode.pdf runcode_troubleshoot.tex runcode_troubleshoot.pdf README generated runcode/

tar cpvfhz runcode.tar.gz runcode/

rm -r runcode

# tar cpvfhz runcode.tar.gz runcode.sty runcode.tex runcode.pdf troubleshoot.tex troubleshoot.pdf generated ./CTAN/README --transform='flags=r;s|./CTAN/README|README|'


7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.gitattributes export-ignore
.github export-ignore
.gitignore export-ignore
LICENSE export-ignore
FAQ.md export-ignore
paper export-ignore
examples export-ignore
35 changes: 35 additions & 0 deletions .github/workflows/ctan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release for CTAN

on:
push:
tags:
- "v*.*"
jobs:
create_tarball:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
fetch-depth: 1
- name: seupEmacs
uses: purcell/setup-emacs@master
with:
version: 28.1

- name: generate runcode.tex
run: ./.org2tex.sh

- name: Compile LaTeX document
uses: xu-cheng/latex-action@v2
with:
root_file: runcode.tex
latexmk_shell_escape: true

- name: create CTAN tarball
run: ./.ctan.sh

- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
runcode.tar.gz
16 changes: 14 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,33 @@
*.out
*.synctex.gz
*.mw
*generated
*tmp

Rplots.pdf
__pycache__
*.pyc
*debug.txt

.gitignore

*R.config
*Rdebug.txt
*julia.config
*juliadebug.txt
*matlab.config
*matlabdebug.txt
serverPID*.txt
serverslist.txt

_minted-runcode/
FAQ.html
README
header.tex
runcode.tar.gz
runcode.tex
runcode.hd
runcode.pdf
runcode.tex~
runcode/

# Exceptions
!examples/Collaborate/generated
69 changes: 69 additions & 0 deletions .org2tex.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
(require 'package)
(package-initialize)
(unless package-archive-contents
(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/") t)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-refresh-contents))
(dolist (pkg '(org))
(unless (package-installed-p pkg)
(package-install pkg)))

(require 'org)
;; (require 'oc-csl)
(require 'ox-publish)
;; (require 'projectile)

(require 'ox-latex)
(add-to-list 'org-latex-classes
'("ltxdoc"
"\\documentclass{ltxdoc}"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))

(setq
org-latex-hyperref-template ""
;; org-confirm-babel-evaluate nil
org-hide-emphasis-markers t
org-latex-listings 'minted
org-latex-packages-alist '(("" "minted"))
)

;; (defun publish-html-and-patch (plist filename pub-dir)
;; "Export a html file then patch it by reversing lines"
;; (let ((outfile (org-html-publish-to-html plist filename pub-dir)))
;; (shell-command
;; (format "sed -i 's/Wang, H\\./<strong>Wang, H.<\\/strong>/' %s"
;; outfile (file-name-sans-extension outfile)))))

;; (defvar OS--publish-project-alist
;; (list
;; (list "myweb"
;; :base-directory "./"
;; :exclude (regexp-opt '("others" "style/others"))
;; :base-extension "org"
;; :recursive t
;; :publishing-directory "./public"
;; ;; :publishing-function 'org-html-publish-to-html
;; :publishing-function 'publish-html-and-patch)
;; (list "attachments"
;; :base-directory "./"
;; :exclude (regexp-opt '("public" "others" "style/others"))
;; ;; :include '("CNAME" "keybase.txt" "LICENSE" ".nojekyll" "publish.el")
;; :recursive t
;; :base-extension (regexp-opt '("jpg" "gif" "png" "svg" "css" "pdf" "html"))
;; :publishing-directory "./public"
;; :publishing-function 'org-publish-attachment)
;; ))

;; (defun OS-publish-all ()
;; (interactive)
;; (let ((make-backup-files nil)
;; (org-publish-project-alist OS--publish-project-alist)
;; (org-html-htmlize-output-type 'css)
;; (org-cite-csl-styles-dir (expand-file-name "style/" (projectile-project-root))))
;; (org-publish-all)
;; ))
22 changes: 22 additions & 0 deletions .org2tex.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

emacs README.org --batch --no-init-file --load .org2tex.el -f org-latex-export-to-latex --kill -f toggle-debug-on-error

rl=`sed -n '7p' runcode.sty`
rl=`echo $rl | sed 's/.*\[\(.*\)\]/\1/'`
rl=`echo $rl | sed 's/runcode //'`
VersionDate=$(echo $rl | sed 's/\//\\\//g')

sed "s/XXX-Date Version-XXX/$VersionDate/" CTAN/README > README
sed "s/XXX-Date Version-XXX/$VersionDate/" CTAN/header.tex > header.tex
sed -i 's/% Intended LaTeX compiler: pdflatex//' runcode.tex

addheader=`cat header.tex ; cat runcode.tex`
echo "$addheader" > runcode.tex


# sed -i '1d' ./CTAN/README
# sed '1,1 s/.*/$VersionDate/' ./CTAN/README
# sed -re "s/XXX-Date Version-XXX/$(VersionDate)/" CTAN/README

# # pdflatex -shell-escape runcode.tex
15 changes: 9 additions & 6 deletions CTAN/runcode/README → CTAN/README
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
LaTeX Package: runcode 2022/07/13 v1.4
LaTeX Package: runcode XXX-Date Version-XXX
----------------------------------------
The runcode package enables the execution of source code (e.g., R,
Julia, Matlab, shell, Python, etc.) and embed the results in the pdf file
when compiling the LaTeX file. To use this package the shell-escape
option must be enabled.

Copyright (C) 2020-2022
Copyright (C) 2020-2025
Haim Bar and HaiYing Wang https://github.com/Ossifragus/runcode

Files:
* README - this file
* runcode.sty - package source
* runcode.tex - documentation (source)
* runcode.pdf - documentation (pdf format)
* README - this file
* runcode.sty - package source
* runcode.tex - documentation (source)
* runcode.pdf - documentation (pdf format)
* runcode_troubleshoot.tex - documentation (source)
* runcode_troubleshoot.pdf - documentation (pdf format)
* generated/ - a folder which contains files generated by runcode for the runcode_troubleshoot file

Installation:
[manual installation]
Expand Down
13 changes: 13 additions & 0 deletions CTAN/header.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
% LaTeX Package: runcode XXX-Date Version-XXX
%
% Copyright (C) 2020-2025 by Haim Bar and HaiYing Wang
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3c of this license or (at your option) any later
% version. The latest version of this license is in:
%
% http://www.latex-project.org/lppl.txt
%
% and version 1.3c or later is part of all distributions of
% LaTeX version 2005/12/01 or later.
Binary file removed CTAN/runcode/runcode.pdf
Binary file not shown.
1 change: 0 additions & 1 deletion CTAN/runcode/runcode.sty

This file was deleted.

Loading