Showing posts with label latex. Show all posts
Showing posts with label latex. Show all posts

Saturday, August 19, 2017

Mini edition environment for LaTeX

When writing an article or book using the LaTeX document preparation system, Indologists sometimes want to have a śloka or two printed on the page with some text-critical notes.  A famous example of this kind of layout is Wilhelm Rao's 1977 edition of the Vākyapadīya that edits the whole text this way, in each verse having its own mini-critical-edition format.

Here is a simple way to get this kind of layout in LaTeX.  I create a new environment called "miniedition":

\newenvironment{miniedition}
    {\begin{quote}
    \addtolength{\textwidth}{-\rightmargin} % width of the quote env.
    \begin{minipage}{\textwidth}
    \itshape 
    \let\footnoterule\relax}
    {\end{minipage}
    \end{quote}}

This puts a minipage environment inside a quote environment, switches on italics and switches off the footnote rule.  It's pretty simple.  The clever bit is done by the minipage environment itself, that makes footnotes inside its own box, not at the bottom of the page.  The footnote numbers are lowercase alphabetical counters, to avoid confusion with footnotes outside the environment.
Here's how you would use it, and the result:

\begin{miniedition}
pāraṃparyād \emph{ṛte ’pi}\footnote{N: \emph{upataṃ}?} svayam 
\emph{anubhavanād}\footnote{My conjecture; both manuscripts are one syllable 
short. K: 
\emph{anubhavad}; N: \emph{anubhavād}.} granthajārthasya samyak\\
pūrṇābdīyaṃ phalaṃ sadgrahagaṇitavidāṃ \emph{aṃhrireṇoḥ}\footnote{N: 
\emph{aṅghri-}, 
with identical meaning.} \emph{prasādāt}\footnote{N: \emph{prasādaḥ}.}||
\end{miniedition}

Output (with added text before and after:

The miniedition text is indented left and right, and followed immediately by the critical notes.  The footnotes at the bottom of the page are a separate series.  In both the main body text and the miniedition, you just use \footnote{} for your notes; LaTeX does the right thing by itself according to context. 
The miniedition environment does not break across pages, it is meant for for short fragments of text, one or two ślokas. 
This example is taken from Gansten 2017.

Monday, July 24, 2017

Biblatex, citations and bibliography sorting

"I want to sort in-text citations by year, but bibliography by name."  So begins one of the questions at a Stackexchange.  That's just what I want too.

I want to put multiple references in a \cite{} command without caring about their sequence, and have them automatically print in year-order.  Then, I want my bibliography to be ordinary, i.e., printed in author-date order.

The discussion at the above site is tricky, but the answer by moewe works.

In a nutshell here's what you actually do:
\begin{document}
\usepackage[sorting=ynt,sortcites=true]{biblatex}
\AtBeginDocument{\assignrefcontextentries[]{*}}
\begin{document}
Hello world!\footcites{ref1,ref3,ref0,ref4}
\newrefcontext[sorting=nyt]
\printbibliography

\end{document}
This will print your footnoted citations in ascending order of year, and your bibliography in ascending order of author.

Tuesday, July 26, 2016

Getting Xindy to work for IAST-encoded text

Update, 2021

January 2021.  Since writing about Xindy below in 2016, a new indexing program has been released, Xindex by Herbert Voß.  I now use xindex with this configuration file for IAST sorting.  My preamble says 

\usepackage[imakeidx]{xindex} 

\makeindex[name=lexical,
title=Lexical Index,
columns=3,
options=  -c iast -a -n, % nocasesensitive, noheadings
]

Tuesday, January 22, 2013

TeX implementations in the Cloud

The more mature products (2014)

Both the above have collaborative-editing features.  Both have free access for limited projects, but require subscription for larger projects or collaborative teams.


Others of varying levels of activity (2014)

  • FlyLaTeX (self-hosting; free and open-source)
  • TeXTouch (iTunes, iPhone editor, can compile when online)
  • Verbosus (with Android and iOS apps)
  • Blue Publications
  • LaTeXLab - requires your Google login details :-( 
  • Pine from Sayahna.orgIn alpha test (a document processing system in the cloud that makes use of MediaWiki and its resources)
  • CloudTeX from Sayahna.org
    XeLaTeX and LuaTeX supported.   Working prototype available to testers. 
  • A different CloudTeX Seems to have gone quiet as of 2013.
  • SpanDex
    XeLaTeX and LuaTeX available, but limited Unicode fonts.
    Closed.
  • ScribTeX  (phased out as of Feb 2013, in favour of ShareLaTeX, but still exists)
  • MonkeyTeX (4/2014)

Tuesday, March 09, 2010

JabRef


Good! The new beta of JabRef, 2.6b3, now has a properly-working interface to JSTOR. One can search by keyword for JSTOR entries, and JabRef lists the hits and lets you import whatever you want to your bibtex database. JabRef even helpfully marks possible duplicates. Very nice indeed, especially for us humanists.

Get your JabRef here: http://jabref.sourceforge.net/

At the moment, JabRef and Mendeley seem to be moving forward fast. They approach the problem of bibliography management slightly differently, and offer different feature-sets. However, both are emerging as seriously useful tools.