[txmt-dev] latex: formatting inside code{}

Tim Bates timothy.c.bates at gmail.com
Tue Feb 16 14:31:46 UTC 2016


Hi TM latex-ers,

Submitting an article to R journal of Journal of Statistical Software. They use

\begin{example}
...
\end{example}

and \code{} to wrap code snippets.

Latex.tmbundle flags quoted strings inside \code{} as illegal, and doesn’t drop into a code-mode inside example  or code blocks.

Is there a way to get allow raw quoted strings inside these blocks or to drop into a nice language-based formatting mode without editing the bundle?

For example, I’d like this to format as R code, but it currently it’s treated as a plain command...

\begin{example}
require(umx); data(twinData)
selDVs = c("wt1", "wt2")
tmpTwin = twinData[twinData$cohort == "younger"]
dz = tmpTwin[tmpTwin$zyg == "DZFF", selDVs]
mz = tmpTwin[tmpTwin$zyg == "MZFF", selDVs]
current version:
require(umx)
data(twinData)
tmpTwin <- twinData
labList = c("MZFF", "MZMM", "DZFF", "DZMM", "DZOS")
tmpTwin$zyg = factor(tmpTwin$zyg, levels = 1:5, labels = labList)
selDVs = c("wt1", "wt2")
dz = tmpTwin[tmpTwin$zyg == "DZFF", selDVs]
mz = tmpTwin[tmpTwin$zyg == "MZFF", selDVs]
\end{example}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate-dev/attachments/20160216/96639dec/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-2.png
Type: image/png
Size: 117156 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate-dev/attachments/20160216/96639dec/attachment-0001.png>


More information about the textmate-dev mailing list