Skip to content

Instantly share code, notes, and snippets.

View rwst's full-sized avatar
😎
I may be slow to respond.

Ralf Stephan rwst

😎
I may be slow to respond.
View GitHub Profile
@rwst
rwst / nonumberedcaptions.latex
Created November 15, 2011 09:07
pandoc LaTeX template that removes "Figure #" automatic label from caption
\documentclass$if(fontsize)$[$fontsize$]$endif${article}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\ifxetex
\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\else
\ifluatex
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
@rwst
rwst / pandoc-i332-pld.diff
Created November 20, 2011 18:03
proposed patch to pandoc-types, simple addition of String parameter to Image
diff --git a/Text/Pandoc/Builder.hs b/Text/Pandoc/Builder.hs
index 664c656..e062271 100644
--- a/Text/Pandoc/Builder.hs
+++ b/Text/Pandoc/Builder.hs
@@ -269,8 +269,9 @@ link url title x = singleton $ Link (toList x) (url, title)
image :: String -- ^ URL
-> String -- ^ Title
-> Inlines -- ^ Alt text
+ -> String -- ^ Size information (i.e. width)
-> Inlines
@rwst
rwst / imagewidth.diff
Created November 21, 2011 14:43
proposed patch to pandoc-templates preparing image width implementation in pandoc
diff --git a/default.latex b/default.latex
index e565833..e1d5a7e 100644
--- a/default.latex
+++ b/default.latex
@@ -47,15 +47,6 @@ $if(url)$
$endif$
$if(graphics)$
\usepackage{graphicx}
-% We will generate all images so they have a width \maxwidth. This means
-% that they will get their normal width if they fit onto the page, but
@rwst
rwst / tidy.rb
Created November 23, 2011 17:54
New formula: HTML tidy
require 'formula'
class Tidy < Formula
head 'cvs://:pserver:anonymous@tidy.cvs.sourceforge.net:/cvsroot/tidy:tidy'
homepage 'http://tidy.sourceforge.net'
version '2009' # date of last commit
def install
system "/bin/sh build/gnuauto/setup.sh"
system "./configure", "--prefix=#{prefix}"
@rwst
rwst / gist:1437841
Created December 6, 2011 11:21 — forked from jgm/gist:1431411
shell for script to turn pandoc math to svg
-- math2svg.hs
-- compile with:
-- ghc --make math2svg.hs
-- run using:
-- pandoc -t json -s | ./math2svg | pandoc -f json
mport Text.Pandoc
import Text.JSON.Generic
import System.Cmd
import System.Posix.Directory
@rwst
rwst / Makefile
Created February 5, 2012 09:58
Makefile for hakyll sites, helping with recompile
mark: hakyll.hs
ghc --make hakyll.hs
touch mark
build: mark
./hakyll build
@rwst
rwst / diagram.svg
Created February 13, 2012 10:06
Openlibrary quick overview
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rwst
rwst / chalcograne.mol
Created May 24, 2012 09:38
molfile with 3d coordinates
C10H16O2
Wdcorina 05241211323D 1 1.00000 0.00000 0
CORINA 3.44 0000 14.05.2008
27 28 0 0 0 0 999 V2000
-0.0187 1.5258 0.0104 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0021 -0.0041 0.0020 C 0 0 0 0 0 0 0 0 0 0 0 0
0.7421 -0.5109 1.2415 C 0 0 2 0 0 0 0 0 0 0 0 0
0.3065 -0.0876 2.1467 H 0 0 0 0 0 0 0 0 0 0 0 0
2.1493 -0.1944 1.1584 O 0 0 0 0 0 0 0 0 0 0 0 0
0.7166 -2.0600 1.2967 C 0 0 0 0 0 0 0 0 0 0 0 0
@rwst
rwst / applet-3.0.1.patch.txt
Created July 3, 2012 16:44
patch by Wayne Volkmuth for cpy/paste via MDLCT, issue #85
diff -C3 -r org.openscience.cdk.jchempaint30/src/main/org/openscience/jchempaint/action/CopyPasteAction.java org.openscience.cdk.jchempaint.patched/src/main/org/openscience/jchempaint/action/CopyPasteAction.java
*** org.openscience.cdk.jchempaint30/src/main/org/openscience/jchempaint/action/CopyPasteAction.java 2009-12-08 03:48:25.000000000 -0800
--- org.openscience.cdk.jchempaint.patched/src/main/org/openscience/jchempaint/action/CopyPasteAction.java 2010-09-13 11:07:35.000000000 -0700
***************
*** 28,41 ****
*/
package org.openscience.jchempaint.action;
- import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
@rwst
rwst / gist:3315686
Created August 10, 2012 17:05
fixes stacktrace with JCP issue #60
diff --git a/src/main/org/openscience/jchempaint/controller/ReactionHub.java b/src/main/org/openscience/jchempaint/controller/ReactionHub.java
index beb8ebe..d973f2e 100644
--- a/src/main/org/openscience/jchempaint/controller/ReactionHub.java
+++ b/src/main/org/openscience/jchempaint/controller/ReactionHub.java
@@ -72,7 +72,7 @@ public class ReactionHub {
chemModel.setReactionSet(reactionSet);
chemModel.getMoleculeSet().removeAtomContainer(oldcontainer);
if(chemModel.getMoleculeSet().getAtomContainerCount()==0)
- chemModel.getMoleculeSet().addAtomContainer(chemModel.getBuilder().newInstance(IAtomContainer.class));
+ chemModel.getMoleculeSet().addAtomContainer(chemModel.getBuilder().newInstance(IMolecule.class));