I am using Emacs 24.3.1 (x86_64-apple-darvin, NS apple-appkit 1038.36) of 2013-03-13 on bob.porkrind.org.
I try to compile a Latex document using knitr to compile R code and implement it into a Latex document.
Changing the font size with C-x C-+ works fine, however when the cursor comes into a R code chunk, seperated by "<<>> #" the font size automatically "jumps back" to the global font size and stays that way when moving out of the code chunk.
Any ideas how to make to font size stay permanent in and out of code chunks?
Related
My standard font is a proportional one. When I edit markdown files I would like to have all sections that are indented by 4 or more spaces be shown in a monospaced font.
I do not use any special markdown mode. Therefore I would be ok if I had to to switch that behavior manually on for the current buffer. Although, my own mode for *.md-files would be need of course, but I have no idea how to do that (and is beyond the scope if this question).
The modes that are active for me are:
Enabled minor modes: Abbrev Auto-Composition
Auto-Compression Auto-Encryption Blink-Cursor
Column-Highlight Column-Number Desktop-Save File-Name-Shadow
Flyspell Font-Lock Global-Font-Lock Icomplete Line-Number
Menu-Bar Mouse-Wheel Shell-Dirtrack Show-Paren
Tooltip Transient-Mark
Yes, you do need a mode that highlights markdown code. (Try M-x package-install RET markdown-mode+ RET) If you have font-locking enabled (I suspect you have), the mode that you end up probably gives syntax highlighting for markdown.
Now, syntax highlighting is just alterations to font and color used. Once you have it on, you can customize the font face used for code by navigating over a code block and issuing M-x customize-face. My markdown mode has code blocks under markdown-pre-face; the face under cursor will be selected by default for you.
I prepared some screenshots to show the workflow. Determining what emacs allows for font family or foundry is bit of a dark magic, and I leave it to google to find out more about it. On linux systems there used to be an ugly little helper called xfontsel where you can preview different font families and foundries.
You can experiment without saving anything first by applying the changes without saving; when things look fine, you can "apply and save" in the customize mode.
I'm going to partially disagree with the argument that you can do what you are after. You can only partially do what you are after and it is a bit of a hack.
Basically, you can set different fonts for different faces. So, provided the text you want to display in a fixed width font has a different face definition, then you can change the font from a proportional font to a fixed width font. At least, that is the theory.
Unfortunately, the results tend to be less than you would hope.
The problem is that most modes do not define faces for all possible characters. Faces tend to only be used to make something stand out and that tends to mean something which is special in the mode - a heading, a bit of syntax etc.
The problem will be witht he 'default face - the face used when no other face is specified. The default face is not mode specific. If you set default face to a monospace font, that font will be used in all modes, not just in 'plain' characters within markdown mode. If any of your fonts in markdown mode are proportional, you will find that alignment in indentation will not look consistent. Depending on how you structure your buffer contents, this may or may not be an issue.
Personally, I gave up on using a proportioanl font as the default font under emacs a long time ago and have settled instead on using a fixed width font as the default and then defining proportional fonts for some speial purposes, such as org-mode headers.
some things you could try which might work, would be
File local variables for setting fonts just in markdown filtes. I've not tried this, but you may be able to use file local variables. You would probably want to create a markdown template which sets this up in new markdown filtes.
Make the face variables buffer local. You might be able to define a markdown-mode hook function which makes the face variables buffer local and sets them to a fixed width font.
Face definitions can use inheritance, so theoretically, if all the faces used inherit from default face and you do a file local variable or buffer local variable to set the default face, then all other faces should inherit that definition, so you shouldn't have to do it for every font in the buffer.
I was playing around with word wrapping yesterday and now I am getting an annoying behavior in my emacs (23.1). When typing in my latex documents the paragraphs are automatically wrapping. As an example, if I open a finished tex document and want to add a space in the middle of a paragraph the entire paragraph gets resized from covering the entire width of the screen to only covering approximately 1/4 of the screen (lines are wrapping around 68-72 columns wide).
Prior to changing anything I saved my original .emacs file, and I have restored the original .emacs to no benefit. I suspect I may have screwed something up in my AucTex configuration, but I cannot find anything to fix this. Any pointers on places to check will be appreciated.
I am working with rather longish file names and when viewing the buffer list, the width of the Buffer column is too short for my purposes.
How can I increase that width (at the expense of, say, the width of the Mode or the File columns).
Width I am trying to increase marked with yellow in the screenshot below:
In Emacs 24.3 and later, this is controlled by the variable Buffer-menu-name-width, which defaults to 19 on my system. Something like
(setq Buffer-menu-name-width 40)
should help. Alternatively, you can use something like M-x customize-variable to change it.
In older Emacs versions, Buffer-menu-buffer+size-width should be modified instead. Thanks to the OP for his edit pointing this out.
It looks like the File column fills up whatever space is left over, so this change should take space away from it. If you prefer to take space from the Mode column, you could also modify the Buffer-menu-mode-width variable to something smaller.
The title says it all; the screenshot below gives the gory details. (The .Rnw file in the temporary buffer folder is identical to the LaTeX Source in the image.) As you can imagine, knit() won't knit this crap. I cannot for the life of me figure out how to make those ligature breaks go away.
So I guess my question is... Help?
You probably did not read the manual, which has instructions on how to input R code in a LyX document: either through Insert --> TeX Code (Ctrl + L), or use the Chunk environment from the drop-down menu on the toolbar. You should not type R code as normal paragraphs in LyX.
I am hacking up a tagging application for emacs. I have got a tag cloud/weighted list successfully displaying on a buffer, but i am running into a snag. I need to be able to properly word-wrap the buffer, but I haven't a clue where to start.
The font I am using is a variable width font. On top of that, each tag is going to be in a different size, depending on how many times it shows up on the buffer. Finally, the window that displays the tagcloud could be in a window that is 200 pixels wide, or the full screen width.
I really have no idea where to start. I tried longlines mode on the tagcloud buffer, but that didn't work.
Source code is at: http://emacswiki.org/cgi-bin/emacs/free-tagging.el
You probably want to track posn-at-point and posn-at-x-y as you put the tags in the buffer.
Can you use (fill-paragraph) or (fill-region) or similar? They wrap at a column, so don't have variable width font smarts, but if the fill column is low they might work for next to no effort. At least until you get a pixel-perfect solution sorted out :-) (maybe YAGNI...)