emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] latex checkboxes


From: Nick Dokos
Subject: Re: [O] latex checkboxes
Date: Thu, 16 Jun 2011 19:29:01 -0400

Thomas S. Dye <address@hidden> wrote:

> Skip Collins <address@hidden> writes:
> 
> > There is a couple of problems with the way checkboxes are typeset in LaTeX.
> >
> > - [ ] a
> > - [X] b
> > - [-] c
> >
> > is translated to the LaTeX
> >
> > \begin{itemize}
> > \item $\Box$ a
> > \item $\boxtimes$ b
> > \item $\boxminus$ c
> > \end{itemize}
> >
> > The first problem is that \Box is not the same size as \boxtimes or 
> > \boxminus .
> > The correct symbol to use from the amssymb package is \square which
> > matches the other two symbols.
> >
> > Another problem is that these symbols were intended to be mathematical
> > binary operators, and are therefore rather small for the purposes of a
> > checkbox. I suggest that LaTeX output could be modified to something
> > like:
> >
> > \setbox0=\hbox{\LARGE$\square$}
> > \begin{itemize}
> > \item {\parbox[][][c]{\wd0}{\LARGE$\square$}} a
> > \item {\parbox[][][c]{\wd0}{\LARGE$\boxtimes$}} b
> > \item {\parbox[][][c]{\wd0}{\LARGE$\boxminus$}} c
> > \end{itemize}
> >
> > The parbox ensures that the checkbox is nicely centered with the first
> > line of text.
> >
> > Another nice-to-have feature would be to use the checkbox as a label
> > for list items in non-enumerated lists. Currently, the list bullet
> > appears as visual clutter next to the checkbox.
> >
> >
> Aloha Skip,
> 
> I think you might be able to get the behavior you want by modifying the
> variable org-export-latex-list-parameters, perhaps something like
> '(:ustart "\\setbox0=\\hbox{\\LARGE$\\square$}\n\\begin{itemize}\n" :cboff
> "\\parbox[][][c]{\\wd0}{\\LARGE$\\square$}" :cbon
> "\\parbox[][][c]{\\wd0}{\\LARGE$\\boxtimes$}")
> 
> The variable is set by default to  '(:cbon "$\\boxtimes$" :cboff
> "$\\Box$") in org-latex.el and is used to override the default settings
> of org-list-to-latex in org-list.el.
>  
> Not tested.
> 

Yes, you can indeed - except for the [-] which is hardcoded. Try the
following:

--8<---------------cut here---------------start------------->8---
#LATEX_HEADER: \setbox0=\hbox{\large$\square$}

#+BIND: org-export-latex-list-parameters (:cbon 
"[{\\parbox[][][c]{\\wd0}{\\large$\\boxtimes$}}]" :cboff 
"[{\\parbox[][][c]{\\wd0}{\\large$\\square$}}]")

* DONE Organize party [3/4]
       - [ ] call people
       - [X] order food
       - [-] think about what music to play
       - [X] talk to the neighbors
--8<---------------cut here---------------end--------------->8---

So the question is: why is the [-] hardcoded?

Nick



reply via email to

[Prev in Thread] Current Thread [Next in Thread]