I'm using RefTeX in EMACS. I have a bibliography file which uses biblatex's field names e.g. I have 'Journaltitle' instead of bibtex's 'Journal'. Here's an example entry:
#article{BerwickPietroskiYankamaChomsky2011,
Author = {Berwick, Robert C. and Pietroski, Paul M. and Yankama, Beracah and Chomsky, Noam},
Doi = {10.1111/j.1551-6709.2011.01189.x},
Journaltitle = {Cognitive Science},
Pages = {1207--1242},
Title = {Poverty of the Stimulus Revisited},
Volume = {35},
Year = {2011}}
When I use C-c [ everything works, but I don't see the 'Journaltitle' field displayed i.e. I don't see 'Cognitive Science'. This is because RefTeX is looking for 'Journal'; adding a 'Journal' field to the record results in it showing up.
Two questions:
Is that what's going on?
Can I tell RefTeX to look for biblatex fields? (The manual didn't help me.)
Related
I am trying to configure RefTeX/AUCTeX so that the smart label-creation, invoked with C-c ( has the following sets of behaviors:
for \section-type labels, i.e., for \section, \subsection, etc. generate a label of the form: \label{sec:[[derived-from-section-name]]} where what follows the colon is derived from the section name.
for \items in an enumerate environment, generate a label of the form: \label{item:[[number]]}, where the number is automatically incremented from what has gone before. i.e., the first enumerate item I generate a label for gets \label{item:1}, the next one \label{item:2}, and so on.
This was standard behavior of my reftex implementation when I was using aquamacs, but I haven't been able to duplicate this in standard emacs.
Any help would be appreciated.
Try setting reftex-plug-into-AUCTeX to t like I do in my config.
Using the config linked to above the behavior is exactly how you described it. I'm on Linux, Emacs version 25.2.2, AUCTeX version 12.1.2, RefTeX version 25.2.2.
I am using an IM which does not support viewing previous chat history nor can I change my IM. So I have to copy the chat into a text file everytime.
I am using Emacs.Is there some way by which I can highlight the lines which contain the participant names as below?
===> **[Vivek Kumar]**
Hi, how are you doing!
===> **[Mr X Y Z]**
fine
===> **[Vivek Kumar]**
sdfksd;fks;
EDIT 1:
Earlier when I'd access to gvim, I would use the highlight.vim plugin.
Emacs supports highlighting of lines or phrases. You can use one of highlight-lines-matching-regexp, highlight-phrase, or highlight-regexp. I'm sure there are several others too.
To try this, paste your text into the editor, press ESC-x (or Alt-x might work too) to enter the "mini-buffer" at the bottom of the editor window, and enter one of the above commands.
For example, I tried:
highlight-lines-matching-regexp and entered the regexp "\[.*\]" and made it match the names in your example. Here's a screenshot:
You can tweak this expression to fit your needs. Some links to regular expressions in emacs:
http://www.emacswiki.org/emacs/RegularExpression
This question on SO: Good tutorial + reference for Emacs search and replace?
Of course you could also use highlight-phrase and just highlight a simple string of text (instead of messing with regexes).
Here's one where I ran highlight-phrase and entered the two separate names and gave them different colors (hi-yellow and hi-red):
Finally you can then run unhighlight-regexp to clear out the highlighting.
I would like to color source header and assembly files in the dired mode and differently.
Basically, when viewing the folder contents I want to color the files differently.
I also would like a way to color files that have a specific word in them differently.
With Dired+, your file names and files extensions will use different colours.
http://wikemacs.org/index.php/Dired+
http://www.emacswiki.org/emacs/DiredPlus
And to colour files that have a specific word in their names, I don't know, but you could use Dired with wildcards:
C-x d path/to/all/containing/*foo*
will open a Dired buffer with all files containing foo in their names.
Hope it helps !
How about using diredful?
Follow the link to find a description of how to setup diredful and add colourisation for a file type of your choosing.
How to do it (You should read the wiki article... it even has screenshots!):
Install diredful (by putting diredful.el somewhere in your load-path)
add (require 'diredful) to your init file.
Call diredful-add
Enter name you want to give this matching pattern (e.g. c-Files)
In the field pattern add the file name pattern to be matched, e.g. c h
Under face to use select the face features you want to use
At my new job I'm using Emacs 24 on Windows, and its chief use for me in these particular circumstances is as a file manager.
I'd like to jettison everything from the Dired display except filename, size, and date. This question showed me how to use ls-lisp-verbosity to remove most of the detail that I don't want.
But I haven't found a way to keep from displaying the permissions. I've checked the documentation for ls and for dir, and there doesn't seem to be a flag for "don't show permissions". And so far I haven't found anything in Dired that will omit the permissions. Can this be done?
Your best option is to change the ls switches so that Dired does not list those fields. See M-x man ls for your particular platform, to see what ls switches are available to you.
dired-details.el (and dired-details+.el) are no longer needed if you have Emacs 24.4 (or a pre-release development snapshot). Just use ( to toggle between showing and hiding details.
And in that case you at least have two options to control whether symbolic-link targets or all lines except header and file lines are considered details to hide: dired-hide-details-hide-symlink-targets and
dired-hide-details-hide-information-lines.
If changing ls switches does not help in your case, then you would need to tweak function dired-details-make-current-line-overlay from dired-details.el. The details to be hidden are determined by the first cond clause, which is this (wrapped in ignore-errors):
(dired-move-to-filename t)
That moves point to the beginning of the file name. The next line is this:
(make-overlay (+ 2 bol) (point))
That creates the invisibility overlay from the beginning of the line (bol here) up to the beginning of the file name (point).
If you want something different then you need to get the limits that you want for the overlay. For example, if you want invisibility to start at the file size, then you would search forward with a regexp that finds the beginning of the file size.
You can come up with such a regexp by working from the regexp for dired-move-to-filename-regexp (in library dired.el). It is a very complex regexp that matches everything up to the file name. But you can use it to find the date+time portion, which is either the 7th matching regexp subgroup or the 2nd, depending on whether the date+time is expressed using a locale (western or eastern) or using ISO representation.
You can see how this is handled in the code defining variable diredp-font-lock-keywords-1 of library dired+.el.
But again, the best approach, if it does what you want, is to try to use ls switches to control which fields are listed in the first place. You can easily experiment with switches by using a prefix argument with C-x d - you are prompted for the switches to use.
The slrn newsreader has an attractive interface with different colours for the author, subject and date columns when browsing list of articles in a newsgroup. I am looking for the Emacs font/face variables for these fields in gnus, but have not been able to find them. The gnus manual for faces does not list the available faces and none of the faces list in Emacs (M-x customize-face gnus-... looks relevant. I am using gnus 5.13 in Emacs 23.2.1.
(This question is not related to displaying "faces" (icons/avatars) in Emacs or gnus.)
Solved: See my answer below.
I think they're scattered a bit in the gnus codebase. The faces used in the article buffer are probably in gnus-art.el, etc.
It sounds like your biggest problem is that there are specific faces that you can't find the symbol for. You can always do M-x describe-face to see what is under the cursor to solve that problem.
Also, (face-list) returns a list of all defined faces. You could scan that list looking for things that look like likely candidates for the particular faces you're interested in.
The format string for various elements in gnus can be customized by modifying the appropriate variable. The variable for the summary line is gnus-summary-format-line. I am not using the default value for this variable, but instead am using the value %U%R%z %(%&user-date; %-15,15f %* %B%s%)\n.
As described here, a new face can be applied to any (sub)section of a format line by bracketing the section with %1{ and %}, where the 1 in this example corresponds to gnus-face-1. gnus-face-1 in my installation defaults to "italics", so adding the following to my ~/.emacs file results in the author in the summary line appearing in italics:
(setq gnus-summary-line-format "%U%R%z %(%&user-date; %1{%-15,15f%} %* %B%s%)\n")
I go with M-x list-faces-display (which opens a new buffer with all the currently defined face variables fontified to the color that they're set to, in alphabetic order) when I want to see what faces I need to change to get a mode working.
Then I setq them, using either the format from color-theme or from the new emacs built-in theme format, depending on which version of emacs I'm in.