* kaobook tex template integration to a org file to make self-contained, portable?
@ 2023-08-07 7:13 Zenny
2023-08-07 11:55 ` Christian Moe
0 siblings, 1 reply; 8+ messages in thread
From: Zenny @ 2023-08-07 7:13 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 697 bytes --]
Hi,
References of interest:
1. https://github.com/fmarotta/kaobook
2. https://github.com/asilata/emacsconf2021
Can anyone guide me how to get a self-contained and portable template that
executes kaobook tex templates (see 1) to create an org-file that resembles
with the instance in 2 above?
I tried the best I can by adding the kaobook.cls and kaobook.sty files
inside `~/texmf/tex/latex/kaobook/` folder and specified 'kaobook' in the
`#+latex_class: kaobook` but it failed to produce the desired look of pdf
similar to
https://github.com/fmarotta/kaobook/blob/master/example_and_documentation.pdf
withing the same examples directory!
Any input appreciated!
Cheers and have a nice week,
/z
[-- Attachment #2: Type: text/html, Size: 1239 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: kaobook tex template integration to a org file to make self-contained, portable?
2023-08-07 7:13 kaobook tex template integration to a org file to make self-contained, portable? Zenny
@ 2023-08-07 11:55 ` Christian Moe
2023-08-08 8:12 ` Zenny
2023-08-08 18:35 ` Zenny
0 siblings, 2 replies; 8+ messages in thread
From: Christian Moe @ 2023-08-07 11:55 UTC (permalink / raw)
To: emacs-orgmode
Hi,
For starters, have you added the kaobook document class to the variable
org-latex-classes? (If yes, ignore the rest of this message, if not, do
so and see what happens.)
This is needed to tell Org how to set the document class and what commands
are used for sections. See the manual 13.10.2 and 13.10.3,
[[info:org#LaTeX specific export settings]] and [[info:org#LaTeX header
and sectioning]], and look up the docstring for org-latex-classes if you
need help.
E.g., in .emacs I have this for Tufte-Latex:
(add-to-list 'org-latex-classes
'("tufte-handout" "\\documentclass[11pt,a4paper]{tufte-handout}"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")))
(add-to-list 'org-latex-classes
'("tufte-book" "\\documentclass[11pt,a5paper,nols]{tufte-book}"
("\\part{%s}" . "\\part*{%s}")
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")))
Yours,
Christian
Zenny writes:
> Hi,
>
> References of interest:
> 1. https://github.com/fmarotta/kaobook
> 2. https://github.com/asilata/emacsconf2021
>
> Can anyone guide me how to get a self-contained and portable template that
> executes kaobook tex templates (see 1) to create an org-file that resembles
> with the instance in 2 above?
>
> I tried the best I can by adding the kaobook.cls and kaobook.sty files
> inside `~/texmf/tex/latex/kaobook/` folder and specified 'kaobook' in the
> `#+latex_class: kaobook` but it failed to produce the desired look of pdf
> similar to
> https://github.com/fmarotta/kaobook/blob/master/example_and_documentation.pdf
> withing the same examples directory!
>
> Any input appreciated!
>
> Cheers and have a nice week,
> /z
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: kaobook tex template integration to a org file to make self-contained, portable?
2023-08-07 11:55 ` Christian Moe
@ 2023-08-08 8:12 ` Zenny
2023-08-08 18:35 ` Zenny
1 sibling, 0 replies; 8+ messages in thread
From: Zenny @ 2023-08-08 8:12 UTC (permalink / raw)
To: Christian Moe; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 4465 bytes --]
Thanks Christian for the pointer,
But I already have,
(add-to-list 'org-latex-classes
> `("kaobook"
> ,(string-join
> '("\\documentclass{kaobook}"
> "\\usepackage{color}"
> "\\usepackage{amsmath,amssymb}")
> "\n")
> ("\\chapter{%s}" . "\\chapter*{%s}")
> ("\\section{%s}" . "\\section*{%s}")
> ("\\subsection{%s}" . "\\subsection*{%s}")
> ("\\paragraph{%s}" . "\\paragraph*{%s}")
> ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
>
yet `C-c C-e l o` fails to produce pdf.
Cheers,
On Mon, Aug 7, 2023 at 1:55 PM Christian Moe <mail@christianmoe.com> wrote:
>
>
> Hi,
>
> For starters, have you added the kaobook document class to the variable
> org-latex-classes? (If yes, ignore the rest of this message, if not, do
> so and see what happens.)
>
> This is needed to tell Org how to set the document class and what commands
> are used for sections. See the manual 13.10.2 and 13.10.3,
> [[info:org#LaTeX specific export settings]] and [[info:org#LaTeX header
> and sectioning]], and look up the docstring for org-latex-classes if you
> need help.
>
> E.g., in .emacs I have this for Tufte-Latex:
>
> (add-to-list 'org-latex-classes
> '("tufte-handout"
> "\\documentclass[11pt,a4paper]{tufte-handout}"
> ("\\section{%s}" . "\\section*{%s}")
> ("\\subsection{%s}" . "\\subsection*{%s}")))
>
> (add-to-list 'org-latex-classes
> '("tufte-book"
> "\\documentclass[11pt,a5paper,nols]{tufte-book}"
> ("\\part{%s}" . "\\part*{%s}")
> ("\\section{%s}" . "\\section*{%s}")
> ("\\subsection{%s}" . "\\subsection*{%s}")
> ("\\paragraph{%s}" . "\\paragraph*{%s}")))
>
> Yours,
> Christian
>
>
> Zenny writes:
>
> > Hi,
> >
> > References of interest:
> > 1. https://github.com/fmarotta/kaobook
> > 2. https://github.com/asilata/emacsconf2021
> >
> > Can anyone guide me how to get a self-contained and portable template
> that
> > executes kaobook tex templates (see 1) to create an org-file that
> resembles
> > with the instance in 2 above?
> >
> > I tried the best I can by adding the kaobook.cls and kaobook.sty files
> > inside `~/texmf/tex/latex/kaobook/` folder and specified 'kaobook' in the
> > `#+latex_class: kaobook` but it failed to produce the desired look of pdf
> > similar to
> >
> https://github.com/fmarotta/kaobook/blob/master/example_and_documentation.pdf
> > withing the same examples directory!
> >
> > Any input appreciated!
> >
> > Cheers and have a nice week,
> > /z
>
>
--
Cheers,
/z
-.. .. ... -.-. .-.. .- .. -- . .-. | -.. .. ... -.-. .-.. .- .. -- . .-.
CONFIDENTIALITY NOTICE AND DISCLAIMER: Access to this e-mail and its
contents by anyone other than the intended recipient is unauthorized as it
contains privileged and confidential information, and is subject to legal
privilege. Please do not re/distribute it. If you are not the intended
recipient (or responsible for delivery of the message to such person), you
may not use, copy, distribute or deliver the email and part of its contents
to anyone this message (or any part of its contents or take any action in
connection to it. In such case, you should destroy this message, and notify
the sender immediately. If you have received this email in error, please
notify the sender or your sysadmin immediately by e-mail or telephone, and
delete the e-mail from any computer. If you or your employer does not
consent to internet e-mail messages of this kind, please notify the sender
immediately. All reasonable precautions have been taken to ensure no
viruses are present in this e-mail and attachments included. As the sender
cannot accept responsibility for any loss or damage arising from the use of
this e-mail or attachments it is recommended that you are responsible to
follow your virus checking procedures prior to use. The views, opinions,
conclusions and other informations expressed in this electronic mail are
not given or endorsed by any company including the network providers unless
otherwise indicated by an authorized representative independent of this
message.
-.. .. ... -.-. .-.. .- .. -- . .-. | -.. .. ... -.-. .-.. .- .. -- . .-.
[-- Attachment #2: Type: text/html, Size: 6250 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: kaobook tex template integration to a org file to make self-contained, portable?
2023-08-07 11:55 ` Christian Moe
2023-08-08 8:12 ` Zenny
@ 2023-08-08 18:35 ` Zenny
2023-08-08 18:39 ` Zenny
2023-08-08 20:02 ` Thomas S. Dye
1 sibling, 2 replies; 8+ messages in thread
From: Zenny @ 2023-08-08 18:35 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 4466 bytes --]
Hi again,
I updated the texlive to 2023 and can produce a pdf with the following
snippets inside the https://github.com/asilata/emacsconf2021/ggm.org:
** Org LaTeX setup
> #+latex_class: kaobook
> #+latex_class_options: [openany, a5paper]
> #+latex_header:
> \usepackage{amsmath,amssymb,amsthm,geometry,hyperref,paralist,svg,thmtools,tikz,tikz-cd}
> #+latex_header: \usepackage{mathtools}
> #+latex_header: \usepackage[capitalise,noabbrev]{cleveref}
> #+latex_header: \usepackage{environ} \NewEnviron{abmn}{\marginnote{\BODY}}
> #+latex_header: \setcounter{tocdepth}{1}
> #+latex_header: \newtheorem{theorem}{Theorem}
> #+latex_header: \newtheorem{example}[theorem]{Example}
> #+latex_header: \newtheorem{exmpl}[theorem]{Example}
> #+latex_header: \newtheorem{definition}[theorem]{Definition}
> #+latex_header: \newtheorem{proposition}[theorem]{Proposition}
> #+latex_header: \newtheorem{lemma}[theorem]{Lemma}
> #+latex_header: \newtheorem{exercise}[theorem]{Exercise}
> #+latex_header: \usetikzlibrary{arrows,automata,positioning}
> ** Export settings
> Export into the artifacts directory
> #+export_file_name: artifacts/ggm
>
> Add ~kaobook~ to ~org-latex-classes~ and update ~org-latex-pdf-process~.
> #+name: export-setup
> #+begin_src emacs-lisp :results silent :var this-year="2023"
> (add-to-list 'org-latex-classes
> `("kaobook"
> ,(string-join
> '("\\documentclass{kaobook}"
> "\\usepackage{color}"
> "\\usepackage{amsmath,amssymb}")
> "\n")
> ("\\chapter{%s}" . "\\chapter*{%s}")
> ("\\section{%s}" . "\\section*{%s}")
> ("\\subsection{%s}" . "\\subsection*{%s}")
> ("\\paragraph{%s}" . "\\paragraph*{%s}")
> ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
>
However, the pdf did not inherit all the kaobook template features like:
1. Mini table of contents in the margin at the start of each chapter.
2. Chapter headings.
3. Huge chapter number with a vertical line
Any input will be appreciated to render the file that looks like
https://github.com/fmarotta/kaobook/blob/master/example_and_documentation.pdf
or https://github.com/tudelft3d/terrainbook/releases/latest.
Thank you in advance,
/z
On Mon, Aug 7, 2023 at 1:55 PM Christian Moe <mail@christianmoe.com> wrote:
>
>
> Hi,
>
> For starters, have you added the kaobook document class to the variable
> org-latex-classes? (If yes, ignore the rest of this message, if not, do
> so and see what happens.)
>
> This is needed to tell Org how to set the document class and what commands
> are used for sections. See the manual 13.10.2 and 13.10.3,
> [[info:org#LaTeX specific export settings]] and [[info:org#LaTeX header
> and sectioning]], and look up the docstring for org-latex-classes if you
> need help.
>
> E.g., in .emacs I have this for Tufte-Latex:
>
> (add-to-list 'org-latex-classes
> '("tufte-handout"
> "\\documentclass[11pt,a4paper]{tufte-handout}"
> ("\\section{%s}" . "\\section*{%s}")
> ("\\subsection{%s}" . "\\subsection*{%s}")))
>
> (add-to-list 'org-latex-classes
> '("tufte-book"
> "\\documentclass[11pt,a5paper,nols]{tufte-book}"
> ("\\part{%s}" . "\\part*{%s}")
> ("\\section{%s}" . "\\section*{%s}")
> ("\\subsection{%s}" . "\\subsection*{%s}")
> ("\\paragraph{%s}" . "\\paragraph*{%s}")))
>
> Yours,
> Christian
>
>
> Zenny writes:
>
> > Hi,
> >
> > References of interest:
> > 1. https://github.com/fmarotta/kaobook
> > 2. https://github.com/asilata/emacsconf2021
> >
> > Can anyone guide me how to get a self-contained and portable template
> that
> > executes kaobook tex templates (see 1) to create an org-file that
> resembles
> > with the instance in 2 above?
> >
> > I tried the best I can by adding the kaobook.cls and kaobook.sty files
> > inside `~/texmf/tex/latex/kaobook/` folder and specified 'kaobook' in the
> > `#+latex_class: kaobook` but it failed to produce the desired look of pdf
> > similar to
> >
> https://github.com/fmarotta/kaobook/blob/master/example_and_documentation.pdf
> > withing the same examples directory!
> >
> > Any input appreciated!
> >
> > Cheers and have a nice week,
> > /z
>
>
[-- Attachment #2: Type: text/html, Size: 6284 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: kaobook tex template integration to a org file to make self-contained, portable?
2023-08-08 18:35 ` Zenny
@ 2023-08-08 18:39 ` Zenny
2023-08-08 20:02 ` Thomas S. Dye
1 sibling, 0 replies; 8+ messages in thread
From: Zenny @ 2023-08-08 18:39 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 6517 bytes --]
The pdf rendered after appending the org-latex-class looked like the
attachment which appears the three features of kaobook skipping, fyi.
Thanks!
On Tue, Aug 8, 2023 at 8:35 PM Zenny <garbytrash@gmail.com> wrote:
> Hi again,
>
> I updated the texlive to 2023 and can produce a pdf with the following
> snippets inside the https://github.com/asilata/emacsconf2021/ggm.org:
>
> ** Org LaTeX setup
>> #+latex_class: kaobook
>> #+latex_class_options: [openany, a5paper]
>> #+latex_header:
>> \usepackage{amsmath,amssymb,amsthm,geometry,hyperref,paralist,svg,thmtools,tikz,tikz-cd}
>> #+latex_header: \usepackage{mathtools}
>> #+latex_header: \usepackage[capitalise,noabbrev]{cleveref}
>> #+latex_header: \usepackage{environ} \NewEnviron{abmn}{\marginnote{\BODY}}
>> #+latex_header: \setcounter{tocdepth}{1}
>> #+latex_header: \newtheorem{theorem}{Theorem}
>> #+latex_header: \newtheorem{example}[theorem]{Example}
>> #+latex_header: \newtheorem{exmpl}[theorem]{Example}
>> #+latex_header: \newtheorem{definition}[theorem]{Definition}
>> #+latex_header: \newtheorem{proposition}[theorem]{Proposition}
>> #+latex_header: \newtheorem{lemma}[theorem]{Lemma}
>> #+latex_header: \newtheorem{exercise}[theorem]{Exercise}
>> #+latex_header: \usetikzlibrary{arrows,automata,positioning}
>> ** Export settings
>> Export into the artifacts directory
>> #+export_file_name: artifacts/ggm
>>
>> Add ~kaobook~ to ~org-latex-classes~ and update ~org-latex-pdf-process~.
>> #+name: export-setup
>> #+begin_src emacs-lisp :results silent :var this-year="2023"
>> (add-to-list 'org-latex-classes
>> `("kaobook"
>> ,(string-join
>> '("\\documentclass{kaobook}"
>> "\\usepackage{color}"
>> "\\usepackage{amsmath,amssymb}")
>> "\n")
>> ("\\chapter{%s}" . "\\chapter*{%s}")
>> ("\\section{%s}" . "\\section*{%s}")
>> ("\\subsection{%s}" . "\\subsection*{%s}")
>> ("\\paragraph{%s}" . "\\paragraph*{%s}")
>> ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
>>
>
> However, the pdf did not inherit all the kaobook template features like:
>
> 1. Mini table of contents in the margin at the start of each chapter.
> 2. Chapter headings.
> 3. Huge chapter number with a vertical line
>
> Any input will be appreciated to render the file that looks like
> https://github.com/fmarotta/kaobook/blob/master/example_and_documentation.pdf
> or https://github.com/tudelft3d/terrainbook/releases/latest.
>
> Thank you in advance,
> /z
>
> On Mon, Aug 7, 2023 at 1:55 PM Christian Moe <mail@christianmoe.com>
> wrote:
>
>>
>>
>> Hi,
>>
>> For starters, have you added the kaobook document class to the variable
>> org-latex-classes? (If yes, ignore the rest of this message, if not, do
>> so and see what happens.)
>>
>> This is needed to tell Org how to set the document class and what commands
>> are used for sections. See the manual 13.10.2 and 13.10.3,
>> [[info:org#LaTeX specific export settings]] and [[info:org#LaTeX header
>> and sectioning]], and look up the docstring for org-latex-classes if you
>> need help.
>>
>> E.g., in .emacs I have this for Tufte-Latex:
>>
>> (add-to-list 'org-latex-classes
>> '("tufte-handout"
>> "\\documentclass[11pt,a4paper]{tufte-handout}"
>> ("\\section{%s}" . "\\section*{%s}")
>> ("\\subsection{%s}" . "\\subsection*{%s}")))
>>
>> (add-to-list 'org-latex-classes
>> '("tufte-book"
>> "\\documentclass[11pt,a5paper,nols]{tufte-book}"
>> ("\\part{%s}" . "\\part*{%s}")
>> ("\\section{%s}" . "\\section*{%s}")
>> ("\\subsection{%s}" . "\\subsection*{%s}")
>> ("\\paragraph{%s}" . "\\paragraph*{%s}")))
>>
>> Yours,
>> Christian
>>
>>
>> Zenny writes:
>>
>> > Hi,
>> >
>> > References of interest:
>> > 1. https://github.com/fmarotta/kaobook
>> > 2. https://github.com/asilata/emacsconf2021
>> >
>> > Can anyone guide me how to get a self-contained and portable template
>> that
>> > executes kaobook tex templates (see 1) to create an org-file that
>> resembles
>> > with the instance in 2 above?
>> >
>> > I tried the best I can by adding the kaobook.cls and kaobook.sty files
>> > inside `~/texmf/tex/latex/kaobook/` folder and specified 'kaobook' in
>> the
>> > `#+latex_class: kaobook` but it failed to produce the desired look of
>> pdf
>> > similar to
>> >
>> https://github.com/fmarotta/kaobook/blob/master/example_and_documentation.pdf
>> > withing the same examples directory!
>> >
>> > Any input appreciated!
>> >
>> > Cheers and have a nice week,
>> > /z
>>
>>
>
>
>
--
Cheers,
/z
-.. .. ... -.-. .-.. .- .. -- . .-. | -.. .. ... -.-. .-.. .- .. -- . .-.
CONFIDENTIALITY NOTICE AND DISCLAIMER: Access to this e-mail and its
contents by anyone other than the intended recipient is unauthorized as it
contains privileged and confidential information, and is subject to legal
privilege. Please do not re/distribute it. If you are not the intended
recipient (or responsible for delivery of the message to such person), you
may not use, copy, distribute or deliver the email and part of its contents
to anyone this message (or any part of its contents or take any action in
connection to it. In such case, you should destroy this message, and notify
the sender immediately. If you have received this email in error, please
notify the sender or your sysadmin immediately by e-mail or telephone, and
delete the e-mail from any computer. If you or your employer does not
consent to internet e-mail messages of this kind, please notify the sender
immediately. All reasonable precautions have been taken to ensure no
viruses are present in this e-mail and attachments included. As the sender
cannot accept responsibility for any loss or damage arising from the use of
this e-mail or attachments it is recommended that you are responsible to
follow your virus checking procedures prior to use. The views, opinions,
conclusions and other informations expressed in this electronic mail are
not given or endorsed by any company including the network providers unless
otherwise indicated by an authorized representative independent of this
message.
-.. .. ... -.-. .-.. .- .. -- . .-. | -.. .. ... -.-. .-.. .- .. -- . .-.
[-- Attachment #1.2: Type: text/html, Size: 8797 bytes --]
[-- Attachment #2: ggm-A4.pdf --]
[-- Type: application/pdf, Size: 272803 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: kaobook tex template integration to a org file to make self-contained, portable?
2023-08-08 18:35 ` Zenny
2023-08-08 18:39 ` Zenny
@ 2023-08-08 20:02 ` Thomas S. Dye
2023-08-09 5:33 ` Zenny
1 sibling, 1 reply; 8+ messages in thread
From: Thomas S. Dye @ 2023-08-08 20:02 UTC (permalink / raw)
To: Zenny; +Cc: emacs-orgmode
Aloha Zenny,
Zenny <garbytrash@gmail.com> writes:
>
> However, the pdf did not inherit all the kaobook template
> features like:
>
> 1 Mini table of contents in the margin at the start of each
> chapter.
> 2 Chapter headings.
> 3 Huge chapter number with a vertical line
The kaobook.cls defines non-standard LaTeX commands for some of
its features. Org mode doesn't know about these, so you'll have
to figure out how Org mode can recognize and export them.
All the best,
Tom
--
Thomas S. Dye
https://tsdye.online/tsdye
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: kaobook tex template integration to a org file to make self-contained, portable?
2023-08-08 20:02 ` Thomas S. Dye
@ 2023-08-09 5:33 ` Zenny
2023-08-09 17:21 ` Thomas S. Dye
0 siblings, 1 reply; 8+ messages in thread
From: Zenny @ 2023-08-09 5:33 UTC (permalink / raw)
To: Thomas S. Dye; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 2715 bytes --]
Aloha Tom,
Thank you for taking time to respond with an useful pointer. I feel like I
reached the right person who is an expert in both LaTeX and Orgmode who
has contributed to org-tufte book earlier as seen in your github repo. I am
a novice, fyi.
I appreciate if you take some time to point out the non-standard features
in order to make Orgmode can recognize.
On Tue, Aug 8, 2023 at 10:06 PM Thomas S. Dye <tsd@tsdye.online> wrote:
> Aloha Zenny,
>
> Zenny <garbytrash@gmail.com> writes:
> >
> > However, the pdf did not inherit all the kaobook template
> > features like:
> >
> > 1 Mini table of contents in the margin at the start of each
> > chapter.
> > 2 Chapter headings.
> > 3 Huge chapter number with a vertical line
>
> The kaobook.cls defines non-standard LaTeX commands for some of
> its features. Org mode doesn't know about these, so you'll have
> to figure out how Org mode can recognize and export them.
>
> All the best,
> Tom
> --
> Thomas S. Dye
> https://tsdye.online/tsdye
>
--
Cheers,
/z
-.. .. ... -.-. .-.. .- .. -- . .-. | -.. .. ... -.-. .-.. .- .. -- . .-.
CONFIDENTIALITY NOTICE AND DISCLAIMER: Access to this e-mail and its
contents by anyone other than the intended recipient is unauthorized as it
contains privileged and confidential information, and is subject to legal
privilege. Please do not re/distribute it. If you are not the intended
recipient (or responsible for delivery of the message to such person), you
may not use, copy, distribute or deliver the email and part of its contents
to anyone this message (or any part of its contents or take any action in
connection to it. In such case, you should destroy this message, and notify
the sender immediately. If you have received this email in error, please
notify the sender or your sysadmin immediately by e-mail or telephone, and
delete the e-mail from any computer. If you or your employer does not
consent to internet e-mail messages of this kind, please notify the sender
immediately. All reasonable precautions have been taken to ensure no
viruses are present in this e-mail and attachments included. As the sender
cannot accept responsibility for any loss or damage arising from the use of
this e-mail or attachments it is recommended that you are responsible to
follow your virus checking procedures prior to use. The views, opinions,
conclusions and other informations expressed in this electronic mail are
not given or endorsed by any company including the network providers unless
otherwise indicated by an authorized representative independent of this
message.
-.. .. ... -.-. .-.. .- .. -- . .-. | -.. .. ... -.-. .-.. .- .. -- . .-.
[-- Attachment #2: Type: text/html, Size: 3496 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: kaobook tex template integration to a org file to make self-contained, portable?
2023-08-09 5:33 ` Zenny
@ 2023-08-09 17:21 ` Thomas S. Dye
0 siblings, 0 replies; 8+ messages in thread
From: Thomas S. Dye @ 2023-08-09 17:21 UTC (permalink / raw)
To: Zenny; +Cc: Thomas S. Dye, emacs-orgmode
Aloha Zenny,
Zenny <garbytrash@gmail.com> writes:
> Aloha Tom,
>
> Thank you for taking time to respond with an useful pointer. I
> feel like I reached the right person who is an expert in both
> LaTeX and Orgmode who has contributed to org-tufte book
> earlier as seen in your github repo. I am a novice, fyi.
>
> I appreciate if you take some time to point out the non-standard
> features in order to make Orgmode can recognize.
>
> On Tue, Aug 8, 2023 at 10:06 PM Thomas S. Dye <tsd@tsdye.online>
> wrote:
>
> Aloha Zenny,
>
> Zenny <garbytrash@gmail.com> writes:
> >
> > However, the pdf did not inherit all the kaobook template
> > features like:
> >
> > 1 Mini table of contents in the margin at the start of each
> > chapter.
> > 2 Chapter headings.
> > 3 Huge chapter number with a vertical line
>
> The kaobook.cls defines non-standard LaTeX commands for some of
> its features. Org mode doesn't know about these, so you'll
> have
> to figure out how Org mode can recognize and export them.
>
I haven't used kaobook, so I can't offer specific pointers. I
have used Tufte LaTeX with Org mode, so I can give general
pointers.
A LaTeX class, such as kaobook, typically redefines standard LaTeX
commands and environments, and also defines non-standard commands
and environments. So, you should first check if your system
correctly compiles a pdf from the LaTeX examples supplied with
kaobook. When the LaTeX side is working correctly, then you'll
want to identify non-standard commands and environments defined by
the kaobook class. In the style and class files you might search
for \newcommand and \newenvironment, or the documentation might
identify the user facing non-standard commands and environments.
These are the ones you'll need to configure specially.
I typically use Org mode macros to insert non-standard LaTeX
commands. Here are some I use with non-standard commands from
Tufte LaTex:
#+MACRO: newthought \newthought{$1}
#+MACRO: sidenote \sidenote[$2][$3]{$1}
#+MACRO: marginnote \marginnote[$2]{$1}
#+MACRO: urlnote \sidenote[$2][$3]{\url{$1}}
Non-standard environments are a bit trickier.
First, you might be able to wrap the non-standard environment like
this in your Org mode file:
#+begin_<<kaobook-environment>>
Something that should be wrapped in <<kaobook-environment>>.
#+end_<<kaobook-environment>>
For figures and tables, you can pass an arbitrary argument to
:float. I do this for the Tufte LaTeX marginfigure environment:
#+attr_latex: :float marginfigure :height 1.2in
#+attr_latex: :float marginfigure :options angle=90
#+attr_latex: :placement [ht!] \setfloatalignment{b}
The last example abuses attr_latex to pass a non-standard LaTeX
command that Tufte LaTeX uses to tweak the vertical alignment of
the figure.
Good luck!
hth,
Tom
--
Thomas S. Dye
https://tsdye.online/tsdye
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-08-09 18:02 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-07 7:13 kaobook tex template integration to a org file to make self-contained, portable? Zenny
2023-08-07 11:55 ` Christian Moe
2023-08-08 8:12 ` Zenny
2023-08-08 18:35 ` Zenny
2023-08-08 18:39 ` Zenny
2023-08-08 20:02 ` Thomas S. Dye
2023-08-09 5:33 ` Zenny
2023-08-09 17:21 ` Thomas S. Dye
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.