LaTeX, Two columns, Listings and Numbers - latex

I'm trying to get a report done and I have a small problem with the twocolums and the line numbering in listings.
The document is on two columns :
\documentclass[8pt,[...],a4paper,twocolumn]{article}
The listings can end up either on the left or the right column. The problem is: if I put
\lstset{numbers=left,frame=tb,[...]}
the space between the columns is not sufficient when the listing is on the right column and the text from the first column is written over.
Is there any way to ask the listings to put the line numbers "outside" ? I know I can modify the space between the columns, but I would prefer to move the numbers on the side.
Thanks

Try the following (you might have to adjust the sizes):
\lstset{xleftmargin=5mm,framexleftmargin=5mm}

Related

Google Sheets Cross Join Function Tables with More than Two Columns

The crossJoin function posted by #Max Makhrov from the below thread works almost completely for what I was hoping to achieve. It was in response to cross joining two columns and I tried joining two tables, one with two columns and one with five columns. It works but only partially.
The delimiter of the column data is stuck as comma ",". This could be problematic for values with commas. The delimiter variable in the function only defines the two ranges being joined.
If the column being joined is a date for example, it seems to extend out the full date text inclusive of time zone and fixed as text. Is there a way to allow for it to be non-text to be formatted? Even when it's parsed using the split() function it's definitely still text.
Result of JOIN is longer than the limit of 50,000 characters
Below is a link to the example input and output. The first output example is a standard cross join. The other is the actual desired output which filters for any data rows where the date in column 5 is greater than or equal to the date in column 2.
https://docs.google.com/spreadsheets/d/1FGS8lYyy60AH49Qyug8Uxaey5jxDksihOks7ll8Hq10/edit?usp=drivesdk
Your spreadsheet is View Only, so i can't demo it there, but try this. On the demo sheet, start a new tab, then put this formula in cell A2.
Happy to walk you through it a bit if it works. Otherwise, maybe make the sample editable so i can troubleshoot w/ you in the same place?
=ARRAYFORMULA(QUERY({HLOOKUP({"A","B"},{"A","B";Sheet1!A5:B},SEQUENCE(COUNTA(Sheet1!D5:D)*COUNTA(Sheet1!A5:A),1,0)/COUNTA(Sheet1!D5:D)+2),HLOOKUP({"D","E","F","G"},{"D","E","F","G";Sheet1!D5:G},MOD(SEQUENCE(COUNTA(Sheet1!D5:D)*COUNTA(Sheet1!A5:A),1,0),COUNTA(Sheet1!D5:D))+2)},"where Col2>=Col5"))

How to transpose rows into columns of contact details without mixing them up? (Google Sheets)

I have a data set of contact details where the emails and their names are scattered in rows, I would like to list them in 2 nice columns. I've tried using "paste special" and use this code below, but none of them worked.
This is how it looks like:
I've tried this code, but it only applies to one row, whereas I want to apply it to all rows and columns.
=transpose(A2:R2)
and
=transpose (A2:R300)
Both don't work. I hope somebody can help me with this, I'd really appreciate it. Thanks in advance!
It looks that you are using the wrong terms so you are using the wrong functions.
Apparently you have a cell with data separated by spaces and break lines and you want to have each email and name on it's own cell, having emails on one column and names on the next column.
One way to achieve that, first replace the separating spaces by using a character like | and the break lines by another different character like $.
Note: Some people use Unicode characters that are very unlikely to appear like ♦, ❤.
To do the above for break lines you could use FIND and REPLACE (Ctrl + H) or function formulas like REGEXREPLACE, SUBSTITUTE, and maybe others. As there are spaces used both as word separators and values separators, FIND and REPLACE can't be used easily. For a single cell, maybe the easier way is to insert the name/email separator manually.
Then separate the cell data. To do this you could use a formula function like SPLIT or Data > Separate values into columns.
Another way is by using Google Apps Script and JavaScript string handling methods but basically the algorithm is the same.
Related
How to split this complex string into 3 columns and 50 rows using Google sheet script
Google Apps Script: Create new rows for cells that contain commas
Google Sheets: string to columns and rows

Google Spreadsheets : how do i manage the automatic increment when extending formula to other cells?

I have, I hope at least, a very simple question.
I have a simple sheet with the 3 first columns being a table of results, and a bunch of options that I can fill in some columns on the right. Obviously, the values in the table are supposed to change when I change the different options.
The formulas are very simple : =B2+F9 (each value in the table is based on the previous entry, the first one being specified in the options.
When I select the cell, grab the little square on its bottom right and drag it down it generates something like this :
=B2+F9
=B3+F10
=B4+F11
=B5+F12
It's basically incrementing each reference... wich is the probem I face as the F9 reference is an option and should not change.
What I want basically is something like :
=B2+F9
=B3+F9
=B4+F9
=B5+F9
Thus incrementing the B column, but not the F9 cell.
I tried to "hard-write" some of the first cells, kind of telling him "keep this F9" but without any success :(
How am I supposed to do this ? :'(
Use absolute references for that. In your case, you'd have the following:
=B2+F$9
The $ symbol means that the row is absolute, and should not change when you extend the formula. So, it would generate:
=B2+F$9
=B3+F$9
=B4+F$9
...
If you want the column to be fixed, you can reference it like $B2, for example. And if both the column and the row must be fixed, you'd use $B$2 syntax.

how to report column across not down in crystal report

I need create a crystal report to report the column across not down. The report itself is very simple, there is no need to group and summarize. The only thing is different from regular report is it need display the column across rather than down. I try use cross-tab, or multiple columns with no success. is there any way i can make is down in crystal? Thanks
The regular report with column down:
I need display like these:
try the following
put the the 4th names of the first column in the page header and make that section underlay the following section, then create 4 details sections, one per column and put the values values right next below and make the details to grow across then down.
for instance
page header
Mth
Vendor
Trans#
Amt
end of page header
details1 date field
details2 vendor field
details3 trans field
details4 amt field

Automatic "entry" column in LaTeX tables

I was wondering if it is possible with LaTeX to create a table with multiple rows and columns and have an automatic "entry" column in every table? This means I would like the first column of every table saying "entry" and numbering the rows of the column from 1 to n. (I hope that kind of explains what I want to achieve).
I will need to refer to single entries in a column and it would be easier to have that numbering done automatically in case I change the order of the rows later on.
Is there any way to do that or a package to make that work?
I am new to the whole LaTeX thing so please be easy on the technical terms :)
Check out this TeXBlog post.
You want to create a counter using \newcounter, set it to zero using \setcounter, then at the beginning of each row, increment the counter and print out its value. The example I linked to makes use of a nifty feature of the tabular environment where, in specifying the format for a column, you can also specify a piece of code to be included before each cell in that column. This saves you from having to duplicate the code, as is done in this example.

Resources