Re: documenting python module examples in orgmode

2019-12-11 Thread Divan Santana
Thanks John Kitchin. Your suggestion works.



documenting python module examples in orgmode

2019-12-09 Thread Divan Santana
Hi All,

I'm trying to document python module examples in orgmode.

I'm sure this is possible, but not quite sure how to do it.

I'd like to define the python module in one block, and then import it in
another.

#+NAME: my_module.py
#+begin_src python
print('Importing my_module...')

test = 'Test String'

def find_index(to_search, target):
'''Find the index of a value in a sequence'''
for i, value in enumerate(to_search):
if value == target:
return i

return -1
#+end_src

#+NAME: intro.py
#+begin_src python
import my_module

courses = [ 'History', 'Math', 'Geography', 'Science' ]
#+end_src

How can one do this?

Thanks very much.



[O] org 2 gfm markdown and back again

2018-11-06 Thread Divan Santana
Hi fellow people :)

So like a lot of you, I'd love to write all my documentation in orgmode.

However I work with gitlab flavoured markdown a lot in our environment.
Wishfully one can convert easily between orgmode and markdown and back
again.

Therefore I need to be able to convert easily back and forth between the
two formats.

There are some issues with this and wondering what your experiences are
with this (for those that are interested)?

I wrote about this situation briefly in my blog on plain text
documentation.

 [1] https://divansantana.com/plain-text-documentation/index.html

pandoc orgmode support is not good enough at converting orgmode to
markdown and back again.

For example converting this org file[2] to markdown with pandoc does
not result in this properly formatted gfm markdown file[3].

 [2] 
https://gitlab.com/ambrevar/ambrevar.gitlab.io/blob/master/source/guix-packaging/index.org
 [3] 
https://git.savannah.gnu.org/cgit/guix/guix-artwork.git/tree/website/posts/packaging-tutorial.md

Using the various ~org-md-~ functions from ~ox-md.el~ is better. However
it only supports org2markdown, not the reverse.  Furthermore, it still
doesn't do a perfect job with the conversation.

Pierre Neidhardt wrote a nice wrapper which improves the org2markdown
export[4].

 [4] 
https://gitlab.com/ambrevar/ambrevar.gitlab.io/blob/master/source/guix-packaging/org2md.el

The result works very well in my testing.  However this still doesn't
solve the markdown2org situation.

Anyone thought of something box to improve this situation?
--
Divan Santana
https://divansantana.com



Re: [O] issue with deadline and schedule on same line

2016-12-19 Thread Divan Santana
Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Hello,
>
> Divan Santana <di...@santanas.co.za> writes:
>
>> Hi Org users
>>
>> Quick one. Having an issue when trying to fire up `org-agenda`.
>>
>> It errors with:
>>
>> ```
>> org-agenda-get-day-entries: Wrong type argument: number-or-marker-p, 
>> "<2016-12-20 Tue +1m>"
>
> This was fixed a couple of days ago.

Thanks a lot.



[O] issue with deadline and schedule on same line

2016-12-19 Thread Divan Santana
Hi Org users

Quick one. Having an issue when trying to fire up `org-agenda`.

It errors with:

```
org-agenda-get-day-entries: Wrong type argument: number-or-marker-p, 
"<2016-12-20 Tue +1m>"
```

That's when one tries to read this file in:

```
* Tasks
** TODO [#B] Do budget for next Month - 20th:money:admin:2pomodoros:
DEADLINE: <2016-12-20 Tue +1m> SCHEDULED: <2016-12-20 Tue +1m>

```

Is this expected? Or am I doing something wrong?

If I have just DEADLINE or SCHEDULED entry then `org-agenda` fires up
without an issue.

Any ideas?

 System Info :computer:
- OS: gnu/linux
- Emacs: 25.1.1
- Spacemacs: 0.200.5
- Spacemacs branch: master (rev. 664ba6ab)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
```elisp
((auto-completion :variables auto-completion-enable-snippets-in-popup t 
auto-completion-private-snippets-directory
  (list "~/.spacemacs.d/snippets" 
"~/.spacemacs.d/private/snippets"))
 better-defaults command-log colors csv dash docker deft
 (elfeed :variables rmh-elfeed-org-files
 (list "~/.spacemacs.d/elfeed.org" 
"~/.spacemacs.d/private/elfeed-private.org")
 elfeed-use-curl t url-queue-timeout 60)
 emacs-lisp erc finance git github html
 (markdown :variables markdown-live-preview-engine 'vmd)
 (mu4e :variables mu4e-installation-path "/usr/share/emacs/site-lisp")
 nginx
 (org :variables org-enable-github-support t)
 pandoc pass pdf-tools php puppet python ranger ruby search-engine
 (shell :variables shell-default-position 'full shell-default-shell 'multi-term)
 shell-scripts slack
 (spell-checking :variables spell-checking-enable-by-default nil)
 sql syntax-checking systemd themes-megapack twitter vagrant windows-scripts 
xkcd yaml)
```
- System configuration features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND 
GPM DBUS GCONF GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT 
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11



Re: [O] issue with deadline and schedule on same line

2016-12-19 Thread Divan Santana
> Hi Org users
>
> Quick one. Having an issue when trying to fire up `org-agenda`.
>
> It errors with:
>
> ```
> org-agenda-get-day-entries: Wrong type argument: number-or-marker-p, 
> "<2016-12-20 Tue +1m>"
> ```
>
> That's when one tries to read this file in:
>
> ```
> * Tasks
> ** TODO [#B] Do budget for next Month - 20th:money:admin:2pomodoros:
> DEADLINE: <2016-12-20 Tue +1m> SCHEDULED: <2016-12-20 Tue +1m>
>
> ```
>
> Is this expected? Or am I doing something wrong?
>
> If I have just DEADLINE or SCHEDULED entry then `org-agenda` fires up
> without an issue.
>
> Any ideas?
>
>  System Info :computer:
> - OS: gnu/linux
> - Emacs: 25.1.1
> - Spacemacs: 0.200.5
> - Spacemacs branch: master (rev. 664ba6ab)
> - Graphic display: t
> - Distribution: spacemacs
> - Editing style: vim
> - Completion: helm
> - Layers:
> ```elisp
> ((auto-completion :variables auto-completion-enable-snippets-in-popup t 
> auto-completion-private-snippets-directory
>   (list "~/.spacemacs.d/snippets" 
> "~/.spacemacs.d/private/snippets"))
>  better-defaults command-log colors csv dash docker deft
>  (elfeed :variables rmh-elfeed-org-files
>  (list "~/.spacemacs.d/elfeed.org" 
> "~/.spacemacs.d/private/elfeed-private.org")
>  elfeed-use-curl t url-queue-timeout 60)
>  emacs-lisp erc finance git github html
>  (markdown :variables markdown-live-preview-engine 'vmd)
>  (mu4e :variables mu4e-installation-path "/usr/share/emacs/site-lisp")
>  nginx
>  (org :variables org-enable-github-support t)
>  pandoc pass pdf-tools php puppet python ranger ruby search-engine
>  (shell :variables shell-default-position 'full shell-default-shell 
> 'multi-term)
>  shell-scripts slack
>  (spell-checking :variables spell-checking-enable-by-default nil)
>  sql syntax-checking systemd themes-megapack twitter vagrant windows-scripts 
> xkcd yaml)
> ```
> - System configuration features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND 
> GPM DBUS GCONF GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF 
> XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11

Didn't include the org version, whoops.

Org mode version 9.0.2 (9.0.2-elpaplus @ 
/home/admin/.emacs.d/elpa/org-plus-contrib-20161214/)



Re: [O] org2pdf export broken on parabola

2016-09-15 Thread Divan Santana
Hi Aaron,

Aaron Ecay <aarone...@gmail.com> writes:

> Hi Divan,
>
> Thanks for your reply.
>
> 2016ko abuztuak 28an, Divan Santana-ek idatzi zuen:
>>
>> Thanks for the reply.
>>
>> My initial post was a lacking detail, sorry...
>>
>> So, on parabola Linux, a simply org file, like this:
>>
>> QUOTE
>> * Test
>>
>> Testing org export to pdf via latex, on parabola Linux.
>> END QUOTE
>>
>> If I try export via C-c C-e l p
>>
>> results in a blank PDF.
>>
>> The *Org PDF LaTeX Output* buffer contains this:
>>
>> QUOTE
>> This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/Parabola) 
>> (preloaded format=pdflatex)
>>  restricted \write18 enabled.
>> entering extended mode
>> (/home/admin/ownCloud/documents/org/test.tex
>> LaTeX2e <2016/03/31> patch level 3
>> Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
>> (/usr/share/texmf-dist/tex/latex/base/article.cls
>> Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
>> (/usr/share/texmf-dist/tex/latex/base/size11.clo))
>> (/usr/share/texmf-dist/tex/latex/base/inputenc.sty
>> (/usr/share/texmf-dist/tex/latex/base/utf8.def
>> (/usr/share/texmf-dist/tex/latex/base/t1enc.dfu)
>> (/usr/share/texmf-dist/tex/latex/base/ot1enc.dfu)
>> (/usr/share/texmf-dist/tex/latex/base/omsenc.dfu)))
>> (/usr/share/texmf-dist/tex/latex/base/fontenc.sty
>> (/usr/share/texmf-dist/tex/latex/base/t1enc.def)
>> kpathsea: Running mktextfm ecrm1095
>> mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; 
>> input ecrm1095
>> This is METAFONT, Version 2.7182818 (TeX Live 2016/Parabola) (preloaded 
>> base=mf)
>>
>> kpathsea: Running mktexmf ecrm1095
>>
>> ! I can't find file `ecrm1095'.
>> <*> ...ljfour; mag:=1; nonstopmode; input ecrm1095
>
> [...snip the rest...]
>
> This log indicates that the problem occurs during the loading of the
> fontenc package.  Fontenc is a good package to load, apparently:
> <https://tex.stackexchange.com/questions/664/why-should-i-use-usepackaget1fontenc>.
>
> You can probably fix this error by either removing the entry for the
> fontenc package from org-latex-default-packages-alist, or setting
> org-latex-compiler to either lualatex or xelatex (newer latex compilers
> neither of which use fontenc).  Of course, either of these might uncover
> further problems (the parabola approach to packaging texlive seems
> pretty haphazard), but I believe either step would fix the problem you
> have reported.

Brilliant. Simple work around. Glad to have this working.

Thanks a ton!



Re: [O] org2pdf export broken on parabola

2016-08-28 Thread Divan Santana
tex/latexconfig/epstopdf-sys.cfg))
(/usr/share/texmf-dist/tex/latex/hyperref/nameref.sty
(/usr/share/texmf-dist/tex/generic/oberdiek/gettitlestring.sty)) (.//test.out)
(.//test.out) (.//test.toc
kpathsea: Running mktextfm ecrm1440
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; 
input ecrm1440
This is METAFONT, Version 2.7182818 (TeX Live 2016/Parabola) (preloaded base=mf)

kpathsea: Running mktexmf ecrm1440

! I can't find file `ecrm1440'.
<*> ...ljfour; mag:=1; nonstopmode; input ecrm1440

Please type another input file name
! Emergency stop.
<*> ...ljfour; mag:=1; nonstopmode; input ecrm1440

Transcript written on mfput.log.
grep: ecrm1440.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input 
ecrm1440' failed to make ecrm1440.tfm.

kpathsea: Running mktextfm ecbx1440
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; 
input ecbx1440
This is METAFONT, Version 2.7182818 (TeX Live 2016/Parabola) (preloaded base=mf)

kpathsea: Running mktexmf ecbx1440

! I can't find file `ecbx1440'.
<*> ...ljfour; mag:=1; nonstopmode; input ecbx1440

Please type another input file name
! Emergency stop.
<*> ...ljfour; mag:=1; nonstopmode; input ecbx1440

Transcript written on mfput.log.
grep: ecbx1440.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input 
ecbx1440' failed to make ecbx1440.tfm.

kpathsea: Running mktextfm ecbx1095
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; 
input ecbx1095
This is METAFONT, Version 2.7182818 (TeX Live 2016/Parabola) (preloaded base=mf)

kpathsea: Running mktexmf ecbx1095

! I can't find file `ecbx1095'.
<*> ...ljfour; mag:=1; nonstopmode; input ecbx1095

Please type another input file name
! Emergency stop.
<*> ...ljfour; mag:=1; nonstopmode; input ecbx1095

Transcript written on mfput.log.
grep: ecbx1095.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input 
ecbx1095' failed to make ecbx1095.tfm.

! Font T1/cmr/m/n/14.4=ecrm1440 at 14.4pt not loadable: Metric (TFM) file not f
ound.

   relax
l.1 ...section}{\numberline {1}Test}{1}{section.1}

! Font T1/cmr/bx/n/14.4=ecbx1440 at 14.4pt not loadable: Metric (TFM) file not
found.

   relax
l.1 ...section}{\numberline {1}Test}{1}{section.1}

! Font T1/cmr/bx/n/10.95=ecbx1095 at 10.95pt not loadable: Metric (TFM) file no
t found.

   relax
l.1 ...section}{\numberline {1}Test}{1}{section.1}

) [1] (.//test.aux) )
(see the transcript file for additional information)
Output written on .//test.pdf (1 page, 1365 bytes).
Transcript written on .//test.log.
END QUOTE

So basically it says the font ecrm1095.mf is missing.
On arch linux this file is at
/usr/share/texmf-dist/fonts/source/jknappen/ec/ecrm1095.mf and provided
by package texlive-core.

On parabola linux this font is missing due to some issues which are
detailed here:
https://lists.parabola.nu/pipermail/assist/2016-August/000716.html

So I'm wondering how one can use the org export to PDF function on
parabola linux which has stripped these fonts due to some licensing
issue (I think).



Aaron Ecay <aarone...@gmail.com> writes:

> Hi Divan,
>
> 2016ko abuztuak 23an, Divan Santana-ek idatzi zuen:
>>
>> Hi All,
>>
>> So I'm pretty new to Emacs and org-mode. Loving it so far.
>>
>> On parabola (FSF approved Arch linux distro) the default emacs org2pdf
>> function is broken.
>>
>> Details on the reason here:
>>
>> https://lists.parabola.nu/pipermail/assist/2016-August/000716.html
>>
>> Something about freedom licensing issues I think.
>>
>> Two questions:
>>
>> 1) How can I work around this issue on parabola so I can export org 2
>> pdf?
>>
>> 2) If there is an issue with the texlive fonts should org upstream not
>> default to a free software compatible font? So org2pdf works on FSF
>> approved distros?
>
> AFAIK the default org export does not do any font selection (either
> of free or non-free fonts).  So it should work just fine.
>
> Obviously it does not for you, though.  It would be helpful if you could
> send an example of an org document (it can be short/meaningless, as long
> as it demonstrates the problem), the latex it produces on export, and
> the latex compiler log file, so that we can see the error.  Looking at
> that, we will probably be able to diagnose your problem more precisely,
> and figure out what needs to be changed to make it work.
>
> Thanks,



[O] org2pdf export broken on parabola

2016-08-23 Thread Divan Santana
Hi All,

So I'm pretty new to Emacs and org-mode. Loving it so far.

On parabola (FSF approved Arch linux distro) the default emacs org2pdf
function is broken.

Details on the reason here:

https://lists.parabola.nu/pipermail/assist/2016-August/000716.html

Something about freedom licensing issues I think.

Two questions:

1) How can I work around this issue on parabola so I can export org 2
pdf?

2) If there is an issue with the texlive fonts should org upstream not
default to a free software compatible font? So org2pdf works on FSF
approved distros?

Divan