Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@crowding
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crowding/fc9fac3daa89f6c544b2 to your computer and use it in GitHub Desktop.
Save crowding/fc9fac3daa89f6c544b2 to your computer and use it in GitHub Desktop.
hevea test case
%% This BibTeX bibliography file was created using BibDesk.
%% http://bibdesk.sourceforge.net/
%% Created for Peter at 2014-07-25 21:28:45 -0700
%% Saved with string encoding Unicode (UTF-8)
@article{Ramachandran:1990aa,
Author = {Ramachandran, V S and Anstis, S M},
Journal = {Perception},
Number = {5},
Pages = {611-6},
Pmid = {2102995},
Pst = {ppublish},
Title = {Illusory displacement of equiluminous kinetic edges},
Volume = {19},
Year = {1990}}
@article{De-Valois:1991jt,
Address = {Physiological Optic Group, University of California, Berkeley 94720.},
Author = {De Valois, R L and De Valois, K K},
Dcom = {19911217},
Journal = {Vision Res},
Language = {eng},
Number = {9},
Pages = {1619--1626},
Pmid = {1949630},
Title = {Vernier acuity with stationary moving Gabors.},
Volume = {31},
Year = {1991}}
@article{Wertheimer:1912aa,
Author = {Max Wertheimer},
Journal = {Zeitschrift f{\"u}r Psychologie und Physiologie der Sinnesorgane},
Pages = {161 - 265},
Title = {Experimentelle Studien {\"u}ber das Sehen von Bewegung},
Volume = {61},
Year = {1912}}
@article{Steinman:2000ap,
Author = {Steinman, Robert M. and Pizlo, Zygmunt and Pizlo, Filip J.},
Journal = {Vision Res},
Keywords = {Apparent movement; Phi; Beta; Stroboscopic movement; Gestalt},
Number = {17},
Pages = {2257--2264},
Title = {Phi is not beta, and why {Wertheimer}'s discovery launched the Gestalt revolution},
Ty = {JOUR},
Volume = {40},
Year = {2000}}
@book{Wertheimer:2012aa,
Address = {Cambridge, Mass.},
Author = {Max Wertheimer and Lothar Spillmann and Viktor Sarris and Robert Sekuler},
Publisher = {MIT Press},
Title = {On perceived motion and figural organization},
Year = {2012}}
@incollection{Ilg:2010vn,
Author = {Ilg, Uwe J. and Churan, Jan},
Booktitle = {Dynamics of Visual Motion Processing},
Crossref = {motion:2010kx},
Editor = {Ilg, Uwe J. and Masson, Guillaume S.},
Isbn = {978-1-4419-0781-3},
Pages = {117-138},
Publisher = {Springer US},
Title = {Second-Order Motion Stimuli: A New Handle to Visual Motion Processing},
Year = {2010}}
@collection{motion:2010kx,
Booktitle = {Dynamics of Visual Motion Processing},
Editor = {Ilg, Uwe J. and Masson, Guillaume S.},
Publisher = {Springer US},
Title = {Dynamics of Visual Motion Processing},
Year = {2010}}
% hevea : hevea.sty
% This is a very basic style file for latex document to be processed
% with hevea. It contains definitions of LaTeX environment which are
% processed in a special way by the translator.
% Mostly :
% - latexonly, not processed by hevea, processed by latex.
% - htmlonly , the reverse.
% - rawhtml, to include raw HTML in hevea output.
% - toimage, to send text to the image file.
% The package also provides hevea logos, html related commands (ahref
% etc.), void cutting and image commands.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{hevea}[2002/01/11]
\RequirePackage{comment}
\newif\ifhevea\heveafalse
\@ifundefined{ifimagen}{\newif\ifimagen\imagenfalse}
\makeatletter%
\newcommand{\heveasmup}[2]{%
\raise #1\hbox{$\m@th$%
\csname S@\f@size\endcsname
\fontsize\sf@size 0%
\math@fontsfalse\selectfont
#2%
}}%
\DeclareRobustCommand{\hevea}{H\kern-.15em\heveasmup{.2ex}{E}\kern-.15emV\kern-.15em\heveasmup{.2ex}{E}\kern-.15emA}%
\DeclareRobustCommand{\hacha}{H\kern-.15em\heveasmup{.2ex}{A}\kern-.15emC\kern-.1em\heveasmup{.2ex}{H}\kern-.15emA}%
\DeclareRobustCommand{\html}{\protect\heveasmup{0.ex}{HTML}}
%%%%%%%%% Hyperlinks hevea style
\newcommand{\ahref}[2]{{#2}}
\newcommand{\ahrefloc}[2]{{#2}}
\newcommand{\aname}[2]{{#2}}
\newcommand{\ahrefurl}[1]{\texttt{#1}}
\newcommand{\footahref}[2]{#2\footnote{\texttt{#1}}}
\newcommand{\mailto}[1]{\texttt{#1}}
\newcommand{\imgsrc}[2][]{}
\newcommand{\home}[1]{\protect\raisebox{-.75ex}{\char126}#1}
\AtBeginDocument
{\@ifundefined{url}
{%url package is not loaded
\let\url\ahref\let\oneurl\ahrefurl\let\footurl\footahref}
{}}
%% Void cutting instructions
\newcounter{cuttingdepth}
\newcommand{\tocnumber}{}
\newcommand{\notocnumber}{}
\newcommand{\cuttingunit}{}
\newcommand{\cutdef}[2][]{}
\newcommand{\cuthere}[2]{}
\newcommand{\cutend}{}
\newcommand{\htmlhead}[1]{}
\newcommand{\htmlfoot}[1]{}
\newcommand{\htmlprefix}[1]{}
\newenvironment{cutflow}[1]{}{}
\newcommand{\cutname}[1]{}
\newcommand{\toplinks}[3]{}
\newcommand{\setlinkstext}[3]{}
\newcommand{\flushdef}[1]{}
\newcommand{\footnoteflush}[1]{}
%%%% Html only
\excludecomment{rawhtml}
\newcommand{\rawhtmlinput}[1]{}
\excludecomment{htmlonly}
%%%% Latex only
\newenvironment{latexonly}{}{}
\newenvironment{verblatex}{}{}
%%%% Image file stuff
\def\toimage{\endgroup}
\def\endtoimage{\begingroup\def\@currenvir{toimage}}
\def\verbimage{\endgroup}
\def\endverbimage{\begingroup\def\@currenvir{verbimage}}
\newcommand{\imageflush}[1][]{}
%%% Bgcolor definition
\newsavebox{\@bgcolorbin}
\newenvironment{bgcolor}[2][]
{\newcommand{\@mycolor}{#2}\begin{lrbox}{\@bgcolorbin}\vbox\bgroup}
{\egroup\end{lrbox}%
\begin{flushleft}%
\colorbox{\@mycolor}{\usebox{\@bgcolorbin}}%
\end{flushleft}}
%%% Style sheets macros, defined as no-ops
\newcommand{\newstyle}[2]{}
\newcommand{\addstyle}[1]{}
\newcommand{\setenvclass}[2]{}
\newcommand{\getenvclass}[1]{}
\newcommand{\loadcssfile}[1]{}
\newenvironment{divstyle}[1]{}{}
\newenvironment{cellstyle}[2]{}{}
\newif\ifexternalcss
%%% Postlude
\makeatother
all: text.pdf text.html
text.pdf: bib.bib text.tex
git clean -f -e text.pdf -e text.html
latexmk -pdf text.tex -pdflatex="pdflatex -halt-on-error -interaction=nonstopmode"
text.image.html: text.pdf
cp text.bbl text.hbbl
hevea text.tex -o text.html < /dev/null
text.html: text.image.html
imagen -pdf text
clean:
git clean -f
\documentclass[english]{article}
\usepackage{hevea}
\usepackage{graphicx}
\usepackage[english]{babel}
%use one or the other of these
\usepackage{hyperref}
\newcommand{\Xref}[1]{\autoref{#1}}
%\usepackage{cleveref}
%\newcommand{\Xref}[1]{\Cref{#1}}
\usepackage[authoryear]{natbib}
\usepackage{trouble}
\begin{document}
\section{Introduction}\label{sec:intro}
This document has citations \citep{Ilg:2010vn}, using authoryear style
(\citealt{Wertheimer:1912aa}, \citeyear{Wertheimer:2012aa};
\citealp{Steinman:2000ap}). It should also have figure graphics and
internal references using cleveref or hyperref, such as the imminent reference
to \Xref{sec:graphics}.
\section{Section 2}\label{sec:graphics}
\begin{figure}
\includegraphics[height=2in,width=5in]{demo_carenv}
\caption{\label{fig:label} This is a figure, with a label.}
\end{figure}
\Xref{fig:label} has a picture in it, as was described in
\Xref{sec:intro} \citep{De-Valois:1991jt,Ramachandran:1990aa}.
\bibliographystyle{apalike}
\bibliography{bib}
\end{document}
%fix hevea definition (citealt should be without parens)
\renewcommand{\citealt}
{\begingroup\def\NAT@pt{p}\NAT@neutral\def\@sep@cite@space{ }%
\NAT@IN{\relax}{\relax}{\relax}{\relax}{\relax}%
\hva@cite}
%fix hevea definition (should be no space before semicolon)
\def\NAT@sep{; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment