I have the following LaTeX code which has some custom macro's and environments which i would like to exclude from flyspell.
Some normal text
\begin{customenv}
Please dont flyspell-this
\end{customenv}
again some normal text (please flyspell this) and some \customcode{dont-flyspell-this}.
I know I need to write a function to pass to flyspell-mode-predicate but I'm haveing some trouble getting it to work for both the \customcode and the \begin{customenv} and \end{customenv}.
Any suggestions are welcome.
Update:
It seems i can set the following:
(setq flyspell-tex-command-regexp
"\\(\\((\\(begin\\|end\\)[ \t]*{\\|\\(cite[a-z*]*\\|label\\|ref\\|eqref\\|usepackage\\|documentclass\\|customcode\\)[ \t]*\\(\\[[^]]*\\]\\)?{[^{}]*\\)\\|\\\\begin{\\(customenv[1-9]*\\)}\\(.\\|\n\\)*\\\\end{\\(customenv[1-9]*\\)}\\)")
This seems to work for the \customcode{stuff} but it still doesn't skip the text in customenv
Related
Thanks for making papaja. It's really terrific!
I just submitted my first journal article using it and ran into problems. The layout staff don't know what to do with the code chunks and listings that are fine in single-column, full page format, but not in their 2-column format. I'm trying use the class 'jou' option to make 2 columns, but I can't figure out how to control the size of code and listing fonts (possibly by modifying the css, as recommended here), or how to using the latex package 'listings' to set listings to wrap (as recommended here).
I'd be grateful for any advice, and my apologies if I've missed how one might do this in the documentation.
If it's only about getting the listings package to work, you can modify the YAML header that it looks similar to the following:
documentclass : "apa6"
classoption : "jou"
output :
papaja::apa6_pdf:
pandoc_args: --listings
header-includes:
- \lstset{breaklines=true}
However, note that using automatic line breaks will most likely break the code at some points. Therefore, it is worthwhile to consider alternatives: For instance, you could try to use a code style that uses more line breaks. The styler package and add-in might be helpful accomplishing this: https://styler.r-lib.org/
I've found several ways to automate folder comparison using scripts in Beyond Compare, but none that produce the pretty html report created from Session>Folder Compare Report>View in browser.
Here is an example of what that looks like.
I would love to be able to find the script that gives me that html difference report.
Thanks!
This is what I am currently getting
load "C:\Users\UIDQ5763\Desktop\Enviornment.cpp" &
"C:\Users\UIDQ5763\Desktop\GreetingsConsoleApp"
folder-report layout:side-by-side options:display-all &
output-to:C:\Users\UIDQ5763\Report.html output-options:html-color
The documentation for Beyond Compare's scripting language is here. You were probably missing either layout:side-by-side, which gives the general display, or output-options:html-color which is required to get the correct HTML stylized output. You may want to change options:display-all to options:display-mismatches if you only want to see the differences, and you might want to add an expand all command immediately before the folder-report line if you want to see the subfolders recursively.'
The & characters shown in the sample are line continuation characters. Remove them if you don't need to wrap your lines.
Can anyone direct me to a tutorial on writing plugins for Jedit? I have a pipedream of using Jedit as an editor for SAS. Currently, it does syntax highlighting, but I feel it is or could be made better by fleshing out the ideas better.
A couple questions:
Can you enable tab completion in Jedit?
Can you specify "environments" that begin and end with certain syntax? (For instance, the word "keep" makes sense between the lines data xxx; and run; but not between proc sort data=xxx; and run; So highlighting it there would be counter-instructive to inexperienced coders.
Can you store variables in a work place and reference them from a drop down menu (such as variable names in a dataset)
Can you execute code from the shell/terminal and pipe .log files back into the Jedit message window?
Are you talking about something like Microsoft's Intellisense or autocomplete? If so, a poor-man's approximation to auto-complete is to use the keyboard shortcut ctrl+b after typing in part of the word. It will complete the word based on all the words from all buffers that are open. See this questions for more on autocomplete.
In your syntax highlighting, you can create delegate syntax for different chunks of code so that it will be highlighted according to different rules. grep in your jedit's mode directory for "delegate".
Not exactly sure what you want, but jedit does keep track of a bunch of your latest copies from the text. Emacs calls this a "kill ring". For my jedit setup, I have Paste Previous... bound to ctrl+e ctrl+v. I believe that is the default shortcut binding. This will show you your last ~20 copies of text chunks and you can select which copy text chunk you want to use.
Yes, you can execute tasks in the shell and pipe them back into jedit. See this question. The following is how I do bk edit and reload a buffer. It doesn't get output from the shell, but it does execute a shell command:
import javax.swing.JOptionPane;
import java.io.File;
File f = new File(buffer.getPath());
String SCCS_path = f.getParent()+"/SCCS";
String bk_path = "/usr/local/bin/bk";
if ( !new File(SCCS_path).exists()) {
bk_path = "/usr/bin/bk";
}
Runtime.getRuntime().exec(
bk_path+ " edit "+
buffer.getPath());
Thread.currentThread().sleep(2000);
buffer.reload(view);
Btw, macros are very powerful in jedit. You can record what you are doing in jedit with Macros->Record Macro...and it will generate the equivalent script.
In emacs when you do doc comments it correctly highlights docs that start with /**. Example:
/**
* #brief: Test
*/
would be correctly fontified with font-lock-string-face and font-lock-doc-face.
Some people do doc comments with /// instead and Emacs does not fontify this using font-lock-doc-face and font-lock-string-face. Is there a way to get emacs to fontify those types of doc comments as well? I am trying to accomplish this for C/C++ but a flexible solution would be nice.
EDIT:
After looking through the emacs source code a bit I see that this is handled in cc-fonts.el in the lisp/progmodes folder. It looks like c-font-lock-doc-comments can be called with different prefix arguments and modifying this might fix it. When I get more time I will try and see what needs to be changed.
(defconst custom-font-lock-keywords
`((,(lambda (limit)
(c-font-lock-doc-comments "///"
limit gtkdoc-font-lock-doc-comments)))))
(setq-default c-doc-comment-style (quote (gtkdoc javadoc autodoc custom)))
Not too bad just drop in a .emacs file. You can customize the keywords but I just use the default gtkdoc keywords since that works for me.
Thanks to wvxvw for the pointer to c-doc-comment-style.
After testing for a bit this does not work for multi line /// comments (each starting with /// on separate lines). Will edit if fixed.
I am looking for some blog site where i will be able to directly paste c++ code examples
in my publishes and see the code with all the alignments and colors like i see it on pastie.org.
I need all those things be made automatically because i don't know HTML and can't make by myself the code changes.
Get wordpress + WP-Syntax.
You won't be able to "copy and paste" the code directly, but you'll have to wrap it like this:
<pre lang="c++">
CODE GOES HERE
</pre>
I use this JavaScript for syntax highlighting in blogger. It's very easy to use.
The key feature of above highlihter is that script permanently hosted on http://softwaremaniacs.org/, so that make it possible is to use script on blogger.com.
Another one nice syntax highlighter could be found at code.google.com (it could be integrated in blogger.com).
(source: googlecode.com)
I use the "Online syntax highlighting" at http://tohtml.com
Paste your code in the text box there, select the programming language and color scheme and it will generate a webpage with your syntax highlighted code. Copy and paste that into your blogger editor and you are good to go.