Tag Info

New answers tagged

0

You'll have to modify the syntax definition for TeX languages in tex.vim, which is located in $VIMRUNTIME/syntax. On my Mac, $VIMRUNTIME expands to /Applications/MacVim.app/Contents/Resources/vim/runtime


4

The easiest thing to do here is to declare all digits as "letters" and define all your keywords with the keywords key alone, eschewing the otherkeywords key completely: \documentclass[12pt]{article} \usepackage{xcolor} \usepackage{listings} \renewcommand{\ttdefault}{pcr} \definecolor{Black}{gray}{0.0} \definecolor{Blue}{rgb}{0.12,0.29,0.53} \lstset{ ...


1

You need to be careful of stomach commands in section titles, use the optional argument. This works. You also have an issue with \citep{} from "natbib", which you missed from your MWE. \documentclass{article} \usepackage{hyperref} \hypersetup{colorlinks=true, urlcolor=blue, citecolor=cyan, pdfborder={0 0 0},} \usepackage{soul} \begin{document} ...


7

This is only a partial solution and it doesn't really work across linebreaks well, but if you replace the highlight commands with \usepackage{tcolorbox} \newtcbox{\hl}[1][yellow]{on line, arc=7pt,colback=#1!10!white,colframe=#1!50!black, before upper={\rule[-3pt]{0pt}{10pt}},boxrule=1pt, boxsep=0pt,left=6pt, right=6pt,top=2pt,bottom=2pt} then I think ...


0

If a text editor makes it easy to search, the way Vim does, then I think comments can work well for this. If you use a consistent keyword it is easy to find. I write % START HERE and maybe some notes about what I need to do there. Something like this stands out pretty well: %********************** % REVISION NEEDED %*********************** I mapped a key ...


1

You could use the Txtfmt plugin for this. To make it work, you simply need to set the filetype to something like tex.txtfmt (instead of the customary tex). :help txtfmt-nesting With Txtfmt highlighting enabled, you could add arbitrary fg/bg colors and formats to your document. Caveat: Txtfmt accomplishes its formatting through the use of invisible tokens ...


3

The problem comes from how the listings language for R is defined. If you look up the definition in lstdvrs.dtx (search for \lst@definelanguage{R}), you'll see that *, /, and _ are all defined as "otherkeywords": otherkeywords={!,!=,~,$,*,\&,\%/\%,\%*\%,\%\%,<-,<<-,_,/},% I refer you to this other answer of mine to understand why this is ...


4

A MWE is really needed here, so what follows is a bit of a shot in the dark... Edit: now you can specify a distinct style for numerical JSON values. \documentclass{article} %\usepackage[T1]{fontenc} %\usepackage[scaled=0.85]{beramono} \usepackage{xcolor} \usepackage{listings} \newcommand\JSONnumbervaluestyle{\color{blue}} ...


5

Ok, after some thinking about how to do this with listings while avoiding manually specifying keywords, I suppose a syntax based solution may work. I.e. I defined a language for listings using moredelim and morestring to handle the most basic syntax of XML and get the following results: the corresponding code is: \documentclass{report} ...


2

Too long for a comment: You can simply redefine a bit of the code. I highlighted the changed lines with my initials. \documentclass{article} \usepackage{xcolor} \newcommand*{\missingreference}[1]{\colorbox{red}{?#1?}}%JB \newcommand*{\missingcitation}[1]{\colorbox{red}{?#1?}}%JB \makeatletter \def\@setref#1#2#3{% \ifx#1\relax ...



Top 50 recent answers are included