The website of Texstudio advertises block selection or multiple cursor functionality, but I could not figure out which key combination to use for this feature reading their horribly cryptic user-manual.
I am familiar with how text selection with multiple cursors works in Sublime Text, for instance. Those key combinations don't work here.
Would someone be kind enough to please tell me how to do this in Texstudio? Thanks.
The key combination for block selection is Shift+Ctrl+Alt (See Sect. 2.8.1 in Manual)
Press them all together and simultaneously move the mouse or cursors to select the text.
Alternatively, Ctrl+Alt can be used to place multiple cursors without selecting, even in the same line or in non adjacent lines.
Without the mouse, you can use Ctrl+Alt and Up/Down arrows keys to place multicursors.
And for special use cases, there is Edit/Searching/Select All Matches, to create multi cursors after searching text with the search bar.
Edit/Selection/Select All Occurernces is like Edit/Searching/Select All Matches, but for the current word (the one where the cursor is currently placed) rather than the search.
In TeXstudio 3.0.0, there are new commands Edit/Selection/Also Select Next|Prev Occurrence to create multiple cursors to the next|prev occurrence of the current word.
Related
[![enter image description here][4]][4][![enter image description here][5]][5]I have a PDF that has tabular data that runs over 50+ pages, i want to extract this table into an excel file using Automation Anywhere. (i am using community version of AA 11.3). I watched videos of the PDF integration command but haven't had any success trying this for tabular data.
Requesting assistance.
Thanks.
I am afraid that your case will be quite challenging... and the main reason for that are the values that contains multiple lines. You can still achieve what you need, and with good performance, but the code itself will not be pretty. You will also be facing challanges with Automation Anywhere, since it does not really provide the right tools to do such a thing and you may need to resort to scripting (VBScripts) or Metabots.
Solution 1
This one will try to use purely text extraction and Regular expressions. Mainly standard functionality, nothing too "dirty".
First you need to realise how do the exported data look like. You can see that you can export to Plain or Structured.
The Plain one is not useful at all as the data is all over the place, without any clear pattern.
The Structured one is much better as the data structure resembles the data from the original document. From looking at the data you can make these observations:
Each row contains 5 columns
All columns are always filled (at least in the visible sample set)
The last two columns can serve as a pattern "anchor" (identifier), because they contain a clear pattern (a number followed by minimum of two spaces followed by a dollar sign and another number)
Rows with data are separated by a blank row
The text columns may contain a multiline value, which will duplicate the rows (this one thing makes it especially tricky)
First wou need to ensure that the Structured data contain only the table, nothing else. You can probably use the Before-After string command for that.
Then you need to check if you can reliably identify the character width of every column. You can try this for yourself if you copy the text into Excel, use the Text to Columns with the Fixed Width option and try to play around with the sliders
The you need to try to find a way how to reliably identify each row and prepare it for the Split command in AA. For that you need to have a delimiter. But since each data row can actually consists of multiple text rows, you need to create a delimiter of your own. I used the Replace function with Regular Expression option and replace a specific pattern for a delimiter (pipe). See here.
Now that you have added a custom delimiter, you can use the Split command to add each row into a list and loop through it.
Because each data row may consists of several rows, you will need to use Split again, this time use the [ENTER] as delimiter. Now you need to loop through each of the text line of a single data line and use the Substring function to extract data based on column width and concatenate them to a single value that you store somewhere else.
All in all, a painful process.
Solution 2
This may not be applicable, but it's worth a try - open the PDF in Microsoft Word. It will give you a warning, ignore it. Word will attempt to open the document and, if you're lucky, it will recognise your table as a table. If it works, it will make the data extraction much easier an you will be able to use Macros/VBA or even simple Copy&Paste. I tried it on a random PDF of my own and it works quite well.
I'd like to add an automatic page break to a libHaru PDF in iOS.
I do have several text fields in the app which contain the user filled data. when i generate the pdf i first measure the expected size of the text-rect going to be created. if it exceeds the remaining space i trigger a hpdf_new_page event and put the text on an new page. i'd like to have this just in part automatically. so if the text exceeds the space on the current page it should split and continue on a new page without me checking or doing anything.
unfortunately i can't find anything like this in the documentation.
Line counting using fgets() may help. When your print program opens a file to print, each line can be copied to the pdf file and checked for a form feed character
or
if the line count has reached a limit.
Another possible solution is to use a character count limit with "while(getc(file) != EOF)".
This link uses libharu to print basic text files with PCL commands to change the font.
https://github.com/DaDaDadeo/GetCycle/blob/master/pcl_to_pdf.c
The form feed character '\f' (ascii 12) and 61 lines will trigger a new page. There are other conditions in the program to restrict a new page but the general idea is illustrated.
The results are the same as a printer using telnet raw 9100 protocol. The pcl commands are limited to just a couple of font changes so it is not too complicated.
Libharu is rather low-level library, and I could not even expect of appearing such automatic page splitting in newer versions due to number of reasons. Hereafter I state two of them:
There is no good, preferred strategy how to place remaining of non-fitting text on the next page. In some cases it could be even impossible at all.
There is no good, preferred strategy for text splitting.
Why?
Consider your font is extremely large, and just one letter (for instance, wide one as "W") does not fit into the page. Where we are supposed to place it? On the next page? Ok, we add new page... oops, it does not fit this page too - as soon as all our pages have the same size. Dead-end without any good, straightforward way out.
In other words, there should be a user-defined strategy for these cases. Almosy every naive implementation will have such a corner cases.
libharu does not know where it should split your text automatically. It does not know hyphenation rules of your language, it does not know whether it should respect spaces or not (wrap whole words only or not), and so on. It's up to you to specify these rules.
So, you should call HPDF_Font_MeasureText for some part of your text string, decide if it fits into your page (excluding margins, footers - which also out of libharu's internal knowledge) and render it. And note that there is no simple formula for text size depending on its length. String "wwww" is more than twice wider than "iiii", of course if your font is not mono-spaced.
How can I select additional occurrences of a word in TextMate 2? I do this in Sublime Text 2/3 by pressing Ctrl+D (Windows, Linux) or Cmd+D (macOS).
Updated answer
As indicated below, ⌃W (Select Word) is the shortcut in the current build.
Previous answer
Taken from the release notes for r9302:
Add two new action methods:
findNextAndModifySelection:
findPreviousAndModifySelection:
These find the next/previous occurrence of what’s on the find clipboard and selects that, but preserves the existing selection. One could e.g. add this to Keybindings.dict:
"#d" = ( "copySelectionToFindPboard:", "findNextAndModifySelection:" );
This binding will likely be default in an upcoming build, but bound to ⌃W (Select Word) and scoped to dyn.selection (so only when a word is already selected).
You can learn more about key binding files at:
http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html
http://blog.macromates.com/2006/multi-stroke-key-bindings/
There are two macros here that do what you want.
They are hooked to ^-W and shift-^-W and have a dyn.selection context.
This lets ^-W select the current word as usual, but once a selection exists, it will extend the selection (using TM2's nifty ability to generate multiple selections).
I imagine allan will soon add something like this or better by default, but 'til then, this a a great feature!
I am using scintilla edit control in an MFC dialog based app.
I load scilexer.dll, and set the lexer to lua, but the only thing that is getting highlighted is the comments. I can also set keywords and they get highlighted:
mySciCtrl.SendMessage(SCI_SETKEYWORDS, 0, "for while end function")
However, I can not figure out how to enable highlighting of say lua basic functions like print, setmetatable, etc.
I thought that would be automatic just like the comments highlighting. Can anyone point me in the right direction?
Found it, it was pretty trivial of course just needed to look at the scintilla functions. So, if anyone else runs into this:
in your scintilla window class initilize color by using SendMessage(SCI_STYLESETFORE, SCE_LUA_WORD2, RGB(100,149,237)); for a second list of keywords.
Then in your dialog do m_ScinCtrl.SendMessage( SCI_SETKEYWORDS, 1, ( long )_T( "the words you want highlighted with the above specified color"));
SCE_LUA_WORD2 corresponds to integer value 1 in the second statement so if you want a third set of keywords highlighted differently just use SCE_LUA_WORD3 and integer value 2 in the second statement!
I want the user to be able to specify something like "Tuesday , from 10am till 11am".
Can I do this with one complex control, or would I be better off with 3 separate simpler controls, such as combo boxes, one for day and one each for start/stop times?
Would I be better off with 3 combo boxes, one for day and one each for start/stop times?
Go for whatever solution doesn't require natural language processing. It's less "cool" and might look a bit obsolete, but I bet it's easier for users because they can do all the selection with the mice and always know they get what they want. Natural language is hard, people might miss-spell things, enter impossible data or confusing data. What do you do if they enter something like this:
"Marţi, de la 22 la 21"
(intentionally written in non-English, with reversed hours in 24 hour format!). And don't even think about asking non-native-English speakers to WRITE dates in English, it's torture.
In other words, unless you have Google's ability to process natural languages in multiple languages, go for a plain multi-combo-box setup, with proper editors for each segment: one for date, two for times.
The JEDI VCL has a plethora of options.
If you want to be able to do something like the Google Calendar where you can select a range from say, 9 to 11 am visually, on a particular day, you can use the JvTimeFramework (personal organizer) components. For a single day view with times from a particular range to another particular range, the TJvTFDays component is ideal:
You click on the time where you want to start, like Google Calendar does. Then you type "Lunch with dave" and hit enter, then you grab the bottom of the square and drag it up and down to fix the duration, or drag the top of the square up and down to change the start time. If you double click it, you can directly input using a dialog box -- the Add Appointment dialog shown in the screenshot is only one option users have. They can work without that, and just directly input onto the day-timer page control.
Otherwise, if you want to stick to text entry, I would combine several controls, including a JvDateTimePicker.
Check out the examples\JvTimeFrameWork\PhotoOp demo in the JVCL examples folder for the above program.