Atom (Editor) - how modify an existing theme, in 2021? - themes

I see this question hasn't been asked for several years, so it's better to ask it again, because the previous solution is out of date.
I am using an atom-material theme, which I like very much. Except that the color of an id-attribute, in HTML, is the same as it's class-attribute. It makes it harder to read and distinguish code.
Or for example "public" and "private" are not colored purple like "variable" is.
So I wanted to ask:
Where can I modify this specific part of a (syntax)theme?
...and how would I find out which "selection handles" to use, in order to target specific elements that I want? (for example "public" for php or "id" for HTML)
Thank you.
-----------------
This old answer uses Shadow DOM:
Atom (editor): modify existing theme and save as a new one
But that is no longer available:
https://flight-manual.atom.io/shadow-dom/

Related

exist-db how to access a pdf

I am sure it is very simple ... I just cannot get my head around this...
the exist-db Documentation is a bit fuzzy on content extraction...
http://exist-db.org/exist/apps/doc/contentextraction.
I have a pdf-file, containing of about 162 high-res images (the pdf is quite big ...) and I do not know how to access any of the that are presumably created ...
please do not destroy me! I am just starting to build a database (for an Edition at Uni)I'd love to have a facsimile edition (so one Tab with the image-file and one tab with the transcribed texts)
I aim at doing something similar to what Heidelberg Universitdy did with the "Welsche Gast Digital" http://digi.ub.uni-heidelberg.de/diglit/cpg389/0190/image
(the choosen image is just an example! )
This pic
When clicking on faksimile the Scan opens and when clicking on Transkription the transcribed texts open!
I am quite new to Xquery, Xpath and most X-related stuff. I have a "working design" put together in exist-db and am looking at TEI for marking up the transcritpion etc, I fear I'll have to spend quite some time on this issue ...
(it is not about doing my job for me, it's just about pointing me in the right direction)
I m afraid the short answer is simply don't.
Storing a pdf in your db, and then trying to extract images from it, is kind of a recipe for disaster. Instead you should use the source images (not necessarily extracted from the pdf), and store these individually in a collection (e.g. resources/img). Those image files are then the binary resources that the documentation is actually talking about.
You might want to take a look at tei-publisher for creating digital edition in exist, especially this demo app for how to present high-res facsimiles with transcribed portions of text. I m afraid its all a bit more involved then just opening a pdf in a browser, but so is the Welsche Gast Digital

markdown or markup to powerpoint?

I need to maintain some slides in both latex beamer and in powerpoint. (This is to make slides available for instructors elsewhere, too, 90% of which do not know how to use latex and are unwilling to learn it. and I am a latex guy on linux.)
I have tried the route via Libreoffice (and opendocument), but this did not come out well. right now, the best method that I have found is to author pdf in beamer, then run it through a nuance OCR program to get MS Word...and not even go all the way to Powerpoint (which is where I really need to be).
If I only had a markup language that produced nice Powerpoint, I could probably code a perl translator from markdown to this intermediate markup language. (going from markdown to latex beamer is relatively easy.)
I don't think this exists, but hope springs eternal. after all, it is almost 2014 now. does anyone know of a solution?
One solution is to use odpdown: It converts markdown to the OpenOffice Presenter format, which can be imported into PowerPoint.
It is not yet complete, i.e. table support is missing and possibly not running on certain Windows setups, but nevertheless it could be a start. Possibly, you have Linux running, where it seems to work.
Steve Rindsberg's answer in the comments works on PP 2007 works! Let me repeat it here:
I suspect that PowerPoint is the likeliest solution. ;-) But what sort
of slides are you creating? If they're simple heading and bullet point
slides, all you need to produce is a simple text file. Any text that
starts in the left column will be the heading of a new slide. Indent
one tab and it becomes a first-level bullet point under the current
heading; indent two tabs, it becomes a second level bullet point and
so on. Simply use File | Open on the text file to pull it into PPT.
Steve: Is this all that PP converts? Or is there a reference of other "sneaky" markup that PP knows about?
(pandoc: unfortunately, the conversion from libreoffice to powerpoint is pretty poor when I tried it last. I also tried to save and understand the powerpoint xml format, but that was REAL bad.)
The easiest way to handle this is to work with:
RStudio (and R if not already installed)
RMarkdown
Pandoc 2.0.5 (minimum)
Install those 3 (or 4) items, then read: https://bookdown.org/yihui/rmarkdown/powerpoint-presentation.html
The installation time is worth the time saved copy-pasting everything from scratch.
I also am a Linux guy and I also use LateX engines to create nice documents. Based on my experience, here's what you should do :
Stop writing directly in LaTeX and start using org-mode to write documents instead (I spent years writing in LaTeX and now it's over (except when I use modernv package))
Org supports latex math formulas and .org files are easily exported in .tex files
Org can also be easily exported in markdown
Once you have your markdown, there are several tools that will allow you to create a PowerPoint. Two of them are pandoc and md2pptx

Change / Add syntax highlighting for a language in Sublime 2/3

I want to change / add syntax highlighting for a language in Sublime 2/3.
For example I want the keyword this colored in JavaScript.
How can I do that?
I know that there is a preference JavaScript File in C:\Program Files\Sublime Text 3\Packages, but I don't know what to change or if I have to create a new JavaScript Preference File somewhere in this folder %APPDATA%\Sublime Text 3.
Syntax highlighting is controlled by the theme you use, accessible through Preferences -> Color Scheme. Themes highlight different keywords, functions, variables, etc. through the use of scopes, which are defined by a series of regular expressions contained in a .tmLanguage file in a language's directory/package. For example, the JavaScript.tmLanguage file assigns the scopes source.js and variable.language.js to the this keyword. Since Sublime Text 3 is using the .sublime-package zip file format to store all the default settings it's not very straightforward to edit the individual files.
Unfortunately, not all themes contain all scopes, so you'll need to play around with different ones to find one that looks good, and gives you the highlighting you're looking for. There are a number of themes that are included with Sublime Text, and many more are available through Package Control, which I highly recommend installing if you haven't already. Make sure you follow the ST3 directions.
As it so happens, I've developed the Neon Color Scheme, available through Package Control, that you might want to take a look at. My main goal, besides trying to make a broad range of languages look as good as possible, was to identify as many different scopes as I could - many more than are included in the standard themes. While the JavaScript language definition isn't as thorough as Python's, for example, Neon still has a lot more diversity than some of the defaults like Monokai or Solarized.
I should note that I used #int3h's Better JavaScript language definition for this image instead of the one that ships with Sublime. It can be installed via Package Control.
UPDATE
Of late I've discovered another JavaScript replacement language definition - JavaScriptNext - ES6 Syntax. It has more scopes than the base JavaScript or even Better JavaScript. It looks like this on the same code:
Also, since I originally wrote this answer, #skuroda has released PackageResourceViewer via Package Control. It allows you to seamlessly view, edit and/or extract parts of or entire .sublime-package packages. So, if you choose, you can directly edit the color schemes included with Sublime.
ANOTHER UPDATE
With the release of nearly all of the default packages on Github, changes have been coming fast and furiously. The old JS syntax has been completely rewritten to include the best parts of JavaScript Next ES6 Syntax, and now is as fully ES6-compatible as can be. A ton of other changes have been made to cover corner and edge cases, improve consistency, and just overall make it better. The new syntax has been included in the (at this time) latest dev build 3111.
If you'd like to use any of the new syntaxes with the current beta build 3103, simply clone the Github repo someplace and link the JavaScript (or whatever language(s) you want) into your Packages directory - find it on your system by selecting Preferences -> Browse Packages.... Then, simply do a git pull in the original repo directory from time to time to refresh any changes, and you can enjoy the latest and greatest! I should note that the repo uses the new .sublime-syntax format instead of the old .tmLanguage one, so they will not work with ST3 builds prior to 3084, or with ST2 (in both cases, you should have upgraded to the latest beta or dev build anyway).
I'm currently tweaking my Neon Color Scheme to handle all of the new scopes in the new JS syntax, but most should be covered already.
I finally found a way to customize the given Themes.
Go to C:\Program Files\Sublime Text 3\Packages and copy + rename Color Scheme - Default.sublime-package to Color Scheme - Default.zip. Afterwards unzip it and copy the Theme, you want to change to %APPDATA%\Sublime Text 3\Packages\User. (In my case, All Hallow's Eve.tmTheme).
Then you can open it with any Text Editor and change / add something, for example for changing this in JavaScript:
<dict>
<key>name</key>
<string>Lang Variable</string>
<key>scope</key>
<string>variable.language</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#FF0000</string>
</dict>
</dict>
This will mark this in JavaScript Files red. You can select your Theme under Preferences -> Color Scheme -> User -> <Your Name>.
Use the PackageResourceViewer plugin installed via Package Control (as mentioned by MattDMo). This allows you to override the compressed resources by simply opening it in Sublime Text and saving the file. It automatically saves only the edited resources to %APPDATA%/Roaming/Sublime Text 3/Packages/ or ~/.config/sublime-text-3/Packages/.
Specific to the op, once the plugin is installed, execute the PackageResourceViewer: Open Resource command. Then select JavaScript followed by JavaScript.tmLanguage. This will open an xml file in the editor. You can edit any of the language definitions and save the file. This will write an override copy of the JavaScript.tmLanguage file in the user directory.
The same method can be used to edit the language definition of any language in the system.
The "this" is already coloured in Javascript.
View->Syntax-> and choose your language to highlight.
This is my recipe
Note: This isn't exactly what OP is asking. These instructions will help you change the colors of items (comments, keywords, etc) that are defined syntax matching rules. For example, use these instructions to change so that all code comments are colored blue instead of green.
I believe the OP is asking how to define this as an item to be colored when found in a JavaScript source file.
Install Package: PackageResourceViewer
Ctrl+Shift+P > [PackageResourceViewer: Open Resource] > [Color Scheme - Default] > [Marina.sublime-color-scheme] (or whichever color scheme you use)
The above command will open a new tab to the file "Marina.sublime-color-scheme".
For me, this file was located in my roaming profile %appdata% (C:\Users\walter\AppData\Roaming\Sublime Text 3\Packages\Color Scheme - Default\) .
However, if I browse to that path in Windows Explorer, [Color Scheme - Default] is not of a child-dir of [Packages] dir. I suspect that PackageResourceViewer is doing some virtualization.
optional step: On the new color-scheme tab: Ctrl+Shift+P > [Set Syntax: JSON]
Search for the rule you want to change. I wanted to make comments be move visible, so I searched for "Comment"
I found it in the "rules" section
"rules":
[
{
"name": "Comment",
"scope": "comment, punctuation.definition.comment",
"foreground": "var(blue6)"
},
Search for the string "blue6": to find the color variable definitions section. I found it in the "variables" section.
Pick a new color using a tool like http://hslpicker.com/ .
Either define a new color variable, or overwrite the color setting for blue6.
Warning: overwriting blue6 will affect all other text-elements in that color scheme which also use blue6 ("Punctuation" "Accessor").
Save your file, the changes will be applied instantly to any open files/tabs.
NOTES
Sublime will handle any of these color styles. Possibly more.
hsla = hue, saturation, lightness, alpha
rgba = red, green, blue, alpha
hsla(151, 100%, 41%, 1)
- last param is the alpha level (transparency) 1 = opaque, 0.5 = half-transparent, 0 = full-transparent
hsl(151, 100%, 41%) - no alpha channel
rgba(0, 209, 108, 1) - rgb with an alpha channel
rgb(0, 209, 108) - no alpha channel

I'm working on a Pro*C syntax highlighting file for Sublime Text 2

Is there any way to include the color highlighting rules in the tmLanguage file itself?
For those who aren't familiar with it, Pro*C is sort of this mutant hybrid love-child of SQL and C, and both syntaxes are present in the file. However, there are a few Pro*C specific keyword which start or stop a big long block of SQL inside of one.
What I would like to do, is have the Pro*C keywords be different colors than the C/SQL keywords, and for the SQL blocks to have a different background color, so that they stand out. In none of the common themes are there appropriate scopes to use for this, not that I can tell. So I can't just call the Pro*C keywords "keyword.source.some-differently-colored language" (they should really be keyword.source.pro-c anyway) or the blocks "text.whatever.another-color" (using meta.block.pro-c right now).
It would be useful if I could just include the colors for these elements in the same plist that defines the syntax. Is this possible in Sublime? What's the correct way to do this?
As far as I understand it, you would have to modify the color scheme file to support what you want. Bundling the colors as part of the tmLanguage file doesn't make sense anyways. By doing that, you would basically be saying every user has to use your predefined colors, which I could imagine people wouldn't like. For example, let's say I have a white background, and you decide to make the text color white. It would look like there is nothing there.
I think the best route is to include sample "extension" of the color scheme file. Then allow the users to modify it themselves as they see fit. This would also let you use the standard naming conventions, so if they don't apply any new scopes, everything still looks okay. Of course, they can specify a more detailed scope in the scheme file to apply the proper text color/background.
What I think would be nice was if there was some way to simply extend a color scheme from a separate file, rather than needing to modify the original. Though that doesn't exist.

Using Mathematica to build presentations and documents

I use Mma mainly to solve relatively small problems.
I want to start using it also to prepare my presentations and documents, but I am having troubles to learn how to do it from the embedded help, and I guess some good resources may be available elsewhere.
Do you know any useful pointers (books, papers, videos ...)?
Do you have a "bag of tricks" to post here?
Edit
This question received two answers so far (#mzabsky's and Mr.Wizard's) and although both are useful, perhaps my concerns are much more basic. So I am posting an example of the kind of things I am unable to do (or understand how to discern how others did them).
I took the following example from The Mathematica Journal (the notebook at the left on the following image - click on the image to see full size):
So, some issues, just to get the idea of my troubles:
1) I copied the text to my .nb on the right, formatted it with the same style (text), but the appearance is different, so I guess the style definition is different. How can I copy the style definitions from one .nb to the other?
2) The table below the text block doesn't have an attached style. How was it formatted? Where is the background color defined?
I would like pointers to read (or videos to look, or whatever) about these issues. I don't want you to write down here a book on Mathematica formatting!
Summary of the links posted in answers
A Mathgroup thread (John Browne) and here (David Park and
Selwyn Hollis)
Advice from Bob Ueland
The Writing Assistant Palette
David Park's notes
Simon's documents
Tips for Mathematica SlideShow presenters
Notebook formatting
Presentations with Mathematica
Videos
Tips for Mathematica Slide Show Presenters
How to - Automatic Slide Show
Create a Lecture Notebook
I use Mathematica to take lecture notes in real time without any major issues (while the proud TeX guys struggle hard to keep up :) ). I have also used it for most math-related homework/assignments I wrote during past two and half years on university.
Before you start, you may want to look at some of these video tutorials.
Also, a few recommendations from me:
Keyboard shortcuts are the key to type fast. Ctrl+9 for inline math cell, Ctrl+6 for superscript, etc.
Learn symbol identifiers for the "esc - symbol - esc" notation. "sum" for Sum, "es" for empty set...you can find list of these in the Mathematica documentation. I have encountered only very few symbols I wanted to type that don't have the esc notation name (for example, leftwards double arrow or double right tee).
Type all math-related stuff into inline math cells. The math cell will do some of the math related formatting for you - put spaces where they belong, render all variables and symbols in italics, etc.
Use the preformatted templates found in "New"->"Styled Notebook".
Do not use ENTER for breaklines, individual paragraph should go into separate text cells (Ctrl+Shift+D) so Mathematica can break the content into individual pages/slides correctly.
In-built Mathematica PDF export sucks big-time; I use CutePDF printer for this.
Also, save often and back up often (Dropbox/Syncplicity are the ideal solution), one misplaced keyboard shortcut can turn hundred hours of work worth document into a goulash (trust me, been there) :)
Example of lecture notes I took in real-time during lecture (it is in Czech, but that doesn't matter much).
I agree with all that mzabsky said in his answer.
Here's a few of extra things:
I find it useful to make statements using a Text or DisplayFormula cell then manually group a Mathematica check/proof to the statement which is then collapsed and can be displayed when you want.
The Writing Assistant Palette has quite a few useful constructions in it that you can learn from.
Finally, I found it really useful to make my own style sheet for a couple reasons:
1) the built-in ones are a bit ugly; 2) it really helps you to understand how the notebooks work.
To see examples of the stylesheet I made (which I don't claim to be perfect - I didn't bother making it work in all screen environments) look at some of the files in ftp://ftp.physics.uwa.edu.au/pub/MATH2200/2010/. I use a similar stylesheet in all of my notes - I have many research projects primarily contained in Mma notebooks, eg http://arxiv.org/abs/1102.3043.
Like Mr Wizard, I also recommend David Park's notes as a starting point. Also, you should study stylesheets that you like by going to the Format menu and clicking "Edit Stylesheet". Don't forget to follow the links through the cascade of stylesheets (version 6 onwards).
To answer the questions in your edit: Once you are viewing a notebook's stylesheet, you can save it, edit it, and use it in your own documents. Stylesheets in
$UserBaseDirectory/SystemFiles/FrontEnd/StyleSheets are automatically available in the menu. You can then use that stylesheet in any notebook by simply selecting it from the menu.
The formating in the screenshot that you posted is all contained in the stylesheet. This includes the grey background in the table.
Addendum:
When distributing notebooks to others, if the stylesheet is external from the notebook, then other people will not see it as you do. To include the stylesheet into the current notebook, you need code like
ss = StyleDefinitions /. Options[EvaluationNotebook[]]
fn = ToFileName[{$UserBaseDirectory, "SystemFiles", "FrontEnd", "StyleSheets"}, ss]
If[FileExistsQ[fn],
style=Get[fn];SetOptions[EvaluationNotebook[],StyleDefinitions->style];,
Print["Can not find file"]]
(Assuming the file is in stored in the conventional place)
Here's an EmbedStylesheet.m that is an improved version of the above.
A Mathgroup thread on embedded stylesheets, particularly here (John Browne) and here (David Park and Selwyn Hollis) might be of interest.
I find stylesheets problematical. In particular I don't like having to remember to embed a stylesheet before I give the notebook to someone else, or before I try to print from an unfamiliar computer. However, along with David Park's tutorial (referenced above by Mr Wizard), I find this advice from Bob Ueland very useful.
If you browse the back-issues of The Mathematica Journal you will see that articles are available in Notebook format. These may be a useful reference.
Edit
I cannot recall a good formatting tutorial at the moment. You can use Show Expression (Win: Shift+Ctrl+E) to view the code expression for a block, such as the table in your example. While one may not enter code by hand in the same form, it can give indications of the options or methods that are used. Code can also be procedurally produced as needed.
I will add links as I find or recall them.
David Park's StyleSheet creation notes
Tips for Mathematica SlideShow presenters
These are brief, but may still be useful:
Notebook formatting
Presentations with Mathematica

Resources