In org-mode, try to push LaTex code to generate matrix like this
The code is like this:
#+BEGIN_SRC latex
\[ G_{x} = \left[ \begin{array}{ccc}
-1 & 0 & 1 \\
-2 & 0 & 2 \\
-1 & 0 & 1 \end{array} \right] {\hspace{2em}} G_{y} = \left[ \begin{array}{ccc}
-1 & -2 & -1 \\
0 & 0 & 0 \\
1 & 2 & 1 \end{array} \right] \]
#+END_SRC
But when I try to export ORG file to ODT document, the matrix are not presented. Do I need any options or configuration for my org-mode?
Thanks
Untested, but there are a couple of answers to this in the Org-mode manual, specifically they involve wrapping the snippet in \begin{equation}and \end{equation} rather than #+begin_src (which I think will result in embedding the source in the ODT), and setting an option (such as #+OPTIONS: tex:imagemagick) which will ask Org-mode to embed LaTeX as images.
http://orgmode.org/manual/Working-with-LaTeX-math-snippets.html#Working-with-LaTeX-math-snippets
Note: this may be specific to your version of Org-mode -- the exporter framework was significantly overhauled for 8.0 and I believe this documentation applies to Org-mode 8.0.
Related
In a julia notebook opened with vscode the dataframe output format is latex but the result is not correctly rendered:
> using DataFrames
> df = DataFrame(a=1:3)
\begin{tabular}{r|c}
& a\\
\hline
& Int64\\
\hline
1 & 1 \\
2 & 2 \\
3 & 3 \\
\end{tabular}
Is there a way to configure jupyter extension to get a well formatted output for julia dataframes?
I'm actually using vscode 1.53.2 and julia 1.6.0-rc1.
I update the show method like this:
using DataFrames
Base.show(io::IO, ::MIME"text/latex", df::AbstractDataFrame) = show(df, backend=:html, show_row_number=true, highlighters=:tf_html_default )
Then we can see the well formatted output from this line:
df = DataFrame(a=1:3)
Try VSCodeServer.vscodedisplay(df), for an example:
using DataFrames
df = DataFrame(x=1:4,y=rand(4),z='a':'d')
VSCodeServer.vscodedisplay(df)
Here is how it works:
Unfortunately, Przemyslaw's answer doesn't actually display the table inline in the Jupyter notebook. It seems that the VSCode implementation requests LaTeX output which it asks MathJax to display. This seems to be broken for DataFrames.
An alternative which does display the table inline is the PrettyTables package.
> using PrettyTables
> pretty_table(df, backend=:html)
I'm preparing a document that contains colored tables (using colortbl) and to correct the thin white lines that appear in those tables I'm using a custom new line macro to compensate for that. However, AUCTeX does not recognize the new macro and tries to indent the table in a strange way.
\begin{table}[h]
\centering\sffamily
\begin{tabular}{lcc}
\rowcolor{row1} \textbf{Nominative} & \emph{Wer?} & Who? \mynewline
\rowcolor{row2}\textbf{Accusative} & \emph{Wen?} & Who(m)? \\
\rowcolor{row1} \textbf{Dative} & \emph{Wem?} & To who(m)? \\
\rowcolor{row2} \textbf{Genitive} & \emph{Wessen?} & Whose? \mynewline
\end{tabular}
\end{table}
How can I make AUCTeX understand that \mynewline plays the same role as \\?
In many cases, AUCTeX should be able to learn about your own commands automatically if you set TeX-parse-self and TeX-auto-save to t. See https://www.gnu.org/software/auctex/manual/auctex/Parsing-Files.html#Parsing-Files
If that is not sufficient, you can tell AUCTeX about your own macros and environment using a style file. See https://www.gnu.org/software/auctex/manual/auctex/Style-Files.html#Style-Files for more on this. It boils down to using the function TeX-add-symbols correctly.
Please note that it's been a few years since I last did this.
AUCTeX ships with a style file for longtable which seems to contain exactly what you need. See http://git.savannah.gnu.org/cgit/auctex.git/tree/style/longtable.el#n92
(TeX-add-symbols
;; Commands to end table rows
'("endhead" 0)
'("endfirsthead" 0)
'("endfoot" 0)
'("endlastfoot" 0)
;; Caption commands
'("caption*" 1))
As I often collect lists of open question in org-mode, I want to be able to easily export the subtree to text with some space between the single headings (such that there is some space for note-taking on a printed copy).
Org-structure looks like this:
* topic xyz
** question 1
** question 2
** question 3
Expected layout of the text export containing configurable number of blank lines between (or after) headings:
━━━━━━━━━━
topic xyz
━━━━━━━━━━
question 1
══════════
question 2
══════════
question 3
══════════
I don't think there is a way to add newlines to your export without formatting your org file. You can enforce newlines by using \\ on each line where you want an empty line to appear.
In your case:
* topic xyz
** Question 1
\\
\\
\\
** Question 2...
Execute a regex replacement in the exported text file:
replace-regex RET ^[═]+$ RET \& C-o C-o C-o
C-o inserts the newlines. c.p. How to replace a character with a newline in Emacs?
I'm producing a document using org-mode which has quite a few tables in it, constructed using the built in table functionality. I've added captions to the tables, but when I export them to LaTeX, rather than the caption appearing below the table, it appears above it. In the manual section on tables and the latex export documentation, there is no mention of any method of changing this, other than fiddling with the LaTeX code manually. As an illustration, the following code snippets show what is generated by the export on an example table with a caption.
#+CAPTION: Results using two methods with different parameter settings.
#+LABEL: tbl:rescomp
| Parameter | Result 1 | Result 2 |
|-----------+----------+----------|
| 0.5 | 0.1 | 0.8 |
| 1 | 0.8 | 0.1 |
Exported:
\begin{table}[htb]
\caption{Results using two methods with different parameter settings.}
\label{tbl:rescomp}
\begin{center}
\begin{tabular}{rrr}
Parameter & Result 1 & Result 2 \\
\hline
0.5 & 0.1 & 0.8 \\
1 & 0.8 & 0.1 \\
\end{tabular}
\end{center}
\end{table}
The problem could be fixed very simply. The caption appears above the table in the document because it is above the table in the code. Moving the caption definition below the tabular section fixes the issue:
\begin{table}[htb]
\begin{center}
\begin{tabular}{rrr}
Parameter & Result 1 & Result 2 \\
\hline
0.5 & 0.1 & 0.8 \\
1 & 0.8 & 0.1 \\
\end{tabular}
\end{center}
\caption{Results using two methods with different parameter settings.}
\label{tbl:rescomp}
\end{table}
Placing the caption definition below the table in the org file is not possible, as it defines the caption for the next table, as described in the manual. Is there any way that I can get org-mode to export the caption below the table produced?
Just updating the answer for Org-mode version 8.3.2 because setting org-export-latex-table-caption-above to nil does nothing now.
I added the next line to my .emacs or init.el file:
(setq org-latex-caption-above nil)
Just as a side note, that variable contains the value (table) by default, which is the one that we are overriding to nil.
In the link posted by N.N., a patch to implement functionality to allow captions to be placed above or below the float was applied. Looking at the org-mode code on github, the default behaviour of Emacs 24.1 is to place captions above the table. To place captions below tables instead, set the org-export-latex-table-caption-above variable to nil:
M-x customize-variable RET org-export-latex-table-caption-above RET nil
or
M-x set-variable RET org-export-latex-table-caption-above RET nil
So, I use org-mode extensively for my daily TODO requirements. I am wondering if I can also use it effectively for note keeping. What I basically want is to store notes with tags, and then want to search these notes by the tags. E.g. If I have something like this
* Heading 1
** Note 1 :tag1:tag2:
Note 1 details
** Note 2 :tag3:
Note 2 details
* Heading 2
** Note 3
** Note 4 :tag1:
Note 4 details
and then I search for tag1, I should have something like-
* Heading 1
** Note 1 :tag1:tag2:
Note 1 details
* Heading 2
** Note 4 :tag1:
Note 4 details
I would prefer being able to do this without adding the files to my agenda. (I may have several of these notes, and I would only want to search the current file at a time.)
Is there an easy (or not so easy) way to accomplish this org-mode?
The following function should provide the result you want.
(defun zin/org-tag-match-context (&optional todo-only match)
"Identical search to `org-match-sparse-tree', but shows the content of the matches."
(interactive "P")
(org-prepare-agenda-buffers (list (current-buffer)))
(org-overview)
(org-remove-occur-highlights)
(org-scan-tags '(progn (org-show-entry)
(org-show-context))
(cdr (org-make-tags-matcher match)) todo-only))
You can use a tag search (C-c / m tag1 <ret>). Documentation here:
http://orgmode.org/manual/Tag-searches.html
This will create a sparse tree showing only the headings containing :tag1:, but it will not automatically reveal the contents of that heading as in your example.