I want to write a table using emacs org-mode with caption. org-mode has two methods for write tables: org-table and table.el.
when exporting to html, org-table works fine, but table.el not display caption.
#+caption: org-table
|------+------|
| name | age |
|------+------|
| jim | 8888 |
|------+------|
#+caption: table.el
+-----+-----+
|name |age |
+-----+-----+
|jim |8888 |
+-----+-----+
what should do to get table.el's caption working? Because table.el can write complex tables, which is very useful.
This is a very old question but I managed to get a caption by adding an empty table (||). Probably not the best solution but it works.
#+caption: table.el
||
+-----+-----+
|name |age |
+-----+-----+
|jim |8888 |
+-----+-----+
You can solve that by adding width attribute to center the caption on empty org-table with just one bar | followed by table.el
#+CAPTION: table.el
#+ATTR_HTML: :width 100%
|
+------+------+
| name | age |
+------+------+
| jim | 8888 |
+------+------+
Related
I want to slice only alphanumeric word from column sentence using pyspark.
For Example,
Original text:
Expected results:
Please extract text between the white space.
df.withColumn('newtext', F.regexp_extract('text','\s(.*?)\s',0)).show()
+---+----------------+-------+
| id| text|newtext|
+---+----------------+-------+
| 1|ABCD AB12C BCDEF| AB12C |
+---+----------------+-------+
Followingg your revised question. Extract as ordered;
df.withColumn('newtext', F.regexp_extract('text','([A-Za-z]+\d+[A-Za-z]+|[A-Za-z]+\d+|\d+[A-Za-z]+)',0)).show()
+---+------------------+-------+
| id| text|newtext|
+---+------------------+-------+
| 1| ABCD AB12C BCDEF| AB12C|
| 2|SE2DC WERDF EWSQSA| SE2DC|
| 3| REDC SEDX WSDR12 | WSDR12|
+---+------------------+-------+
I have two dataframes that shares the column colour, and I would like to create a new column with the Code that correspond to the column colour in a new DF as you can see:
DF1
+------------+--------------------+
| Code | colour |
+------------+--------------------+
| 1001 | brown |
| 1201 | black |
| 1300 | green |
+------------+--------------------+
DF2
+------------+--------------------+-----------+
| Name | colour | date |
+------------+--------------------+-----------+
| Joee | brown | 20210101 |
| Jess | black | 20210101 |
| James | green | 20210101 |
+------------+--------------------+-----------+
Output:
+------------+--------------------+-----------+----------+
| Name | colour | date | Got |
+------------+--------------------+-----------+----------+
| Joee | black | 20210101 | 1201 |
| Jess | brown | 20210101 | 1001 |
| James | blue | 20210101 | 092 |
+------------+--------------------+-----------+----------+
How can I do this? With join?
As mck suggested, a simple SQL join would be enough for your case, by explicitly specifying the equality of the colour column's values between the two DataFrames, as seen below (we drop one of the two colour columns since they have the same value for each row after the join):
val joined = df1.join(df2, df1("colour").equalTo(df2("colour")))
.drop(df1("colour"))
This is what we get after showing the newly formed joined DataFrame:
+----+-----+------+--------+
|code| name|colour| date|
+----+-----+------+--------+
|1001| Joe| brown|20210101|
|1201| Jess| black|20210101|
|1300|James| green|20210101|
+----+-----+------+--------+
I'm new to emacs (spacemacs, actually) and org-mode. I'd like to have a final line in my table that shows how many rows there are in the table. Is there a formula function for that?
This formula should work: vlen(#I..#II).
Example:
| Title |
|-------|
| one |
| two |
| three |
| four |
|-------|
| 4 |
#+Tblfm: #6$1=vlen(#I..#II)
the example above is specified as "#6" which requires you to know hte sum in advance. The following seems to work:
| Title |
|-------|
| one |
| two |
| three |
| four |
|-------|
| 4 |
#+Tblfm: #II$1=vlen(#I..#II)
I would like to know how to add a caption to a table defined in a markdown file for Doxygen. I know that Doxygen can generate a table from the following code in a .md file, but I could not find a way to add a caption to this table.
|Name |Age|
|-----|---|
|Alice| 18|
|Bob | 23|
do you mean something like this, which is possible
###H6
|Header1 | Header2 | Header 3 |
|--------|---------|----------|
|0 | 1 | 7 |
|2 | 5 | 3 |
|9 | 7 | 2 |
or something like this, which is not possible, at least not by only using simple .md notation
| Caption |
|Header1 | Header2 | Header 3 |
|--------|---------|----------|
|0 | 1 | 7 |
|2 | 5 | 3 |
|9 | 7 | 2 |
if you want the second version you should use .html tables
Unfortunately the second is impossible in doxygen.
you would need multimarkdown support, which is shown by the link the table example but is not supported by doxygen yet, right now doxygen only supports simple tables
you use only html
you find a workaround which suites you, something like this:
<table>
<tr>
<td colspan=1>
Caption
</td>
|Header1 | Header2 | Header 3 |
|--------|---------|----------|
|0 | 1 | 7 |
|2 | 5 | 3 |
|9 | 7 | 2 |
</tr>
Here's an example Org clock table in Emacs:
#+BEGIN: clocktable :maxlevel 1 :scope file :tcolumns 1 :formula %
#+CAPTION: Clock summary at [2014-03-30 Sun 22:47]
| Headline | Time | % |
|--------------+--------+-------|
| *Total time* | *4:31* | 100.0 |
|--------------+--------+-------|
| Item A | 1:07 | 24.7 |
| Item B | 1:06 | 24.4 |
| Item C | 2:18 | 50.9 |
#+TBLFM: $3='(org-clock-time% #2$2 $2..$2);%.1f
#+END:
I want to sort the table by the % column. Is this possible?
Here's a more complex example:
#+BEGIN: clocktable :maxlevel 2 :scope file :tcolumns 1 :formula %
#+CAPTION: Clock summary at [2014-03-30 Sun 22:48]
| Headline | Time | % |
|--------------------+--------+-------|
| *Total time* | *4:31* | 100.0 |
|--------------------+--------+-------|
| Item A | 1:07 | 24.7 |
| \__ Item A1 | 0:07 | 2.6 |
| \__ Item A2 | 1:00 | 22.1 |
| Item B | 1:06 | 24.4 |
| \__ Item B1 | 1:06 | 24.4 |
| Item C | 2:18 | 50.9 |
| \__ Item C1 | 2:18 | 50.9 |
#+TBLFM: $3='(org-clock-time% #2$2 $2..$2);%.1f
#+END:
In this instance, the top level items should be sorted by their % values, but within each subtree, the secondary level items should also be sorted by their % values.
The time clocking code for Org-mode org-clock.el doesn't support any sorting facilities. The function org-clocktable-write-default creates tables by very rigid algorithm with limited variants of tuning, all of them are in the variable org-clocktable-defaults. Thus, dynamic block clocktable generates org tables "as is", http://orgmode.org/manual/The-clock-table.html contains exhaustive list of settings.
You can sort first table manually by placing the cursor in the 3 column and executing M-x org-table-sort-lines [n]umeric.
As to sorting second table with "knowledge about structure of levels" - it seems to be impossible without profound changes in the function org-clocktable-write-default.
The built-in formatter org-clocktable-write-default sorts the entries just row by row with no idea of levels. I was looking for the same functionality and ended up with writing my own formatter (not a formatter really) that sorts the entries with respect to levels. It has a limitation though that it can only sort on name or time, since the result of sorting on time is essentially the same as sorting on percentage, this's acceptable in your case.