Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LaTeX (text mode) commands #459

Open
EvoArt opened this issue Jun 6, 2022 · 2 comments
Open

LaTeX (text mode) commands #459

EvoArt opened this issue Jun 6, 2022 · 2 comments

Comments

@EvoArt
Copy link

EvoArt commented Jun 6, 2022

Hi there
Is it possible to iput text in a .jmd and have it included verbatim in a generated .tex file? e.g. I use a custom template with tufte.sty and it would be great to be able to type \sidenote{some cool fact} and have the side note appear in my pdf.

@NoelAraujo
Copy link

I would love to see 'Tufte style' listed in list_out_formats, but I imagine that Julia Mardown needs to support it first (?)

Maybe someone knows how to create Tufte with Weaver.jl could post a minimal working example here.

@EvoArt
Copy link
Author

EvoArt commented Jul 6, 2022

I have a custom template like this

\documentclass{tufte-handout}

\usepackage{geometry}
\usepackage{lmodern}
\usepackage{sourcecodepro}
\usepackage{amssymb,amsmath}
\usepackage{bm}
\usepackage{graphicx}
\usepackage{microtype}
\usepackage{hyperref}
\usepackage{listings}
\usepackage{color}
\definecolor{lbcolor}{rgb}{1,1,0.95} 
\lstset{frameround=fttt,
	frame=trBL,
    basicstyle=\sourcecodepro\footnotesize,
    upquote=true,
    breaklines=true,
    breakindent=0pt,
    keepspaces=true,
    showspaces=false,
    columns=fullflexible,
    showtabs=false,
    showstringspaces=false,
    escapeinside={(*@}{@*)},
    extendedchars=true,
    backgroundcolor=\color{lbcolor}
}
{{#:tex_deps}}
{{{ :tex_deps }}}
{{/:tex_deps}}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1.2ex}

\hypersetup
       {   pdfauthor = { {{{:author}}} },
           pdftitle={ {{{:title}}} },
           colorlinks=TRUE,
           linkcolor=black,
           citecolor=blue,
           urlcolor=blue
       }

{{#:title}}
\title{ {{{ :title }}} }
{{/:title}}

{{#:author}}
\author{ {{{ :author }}} }
{{/:author}}

{{#:date}}
\date{ {{{ :date }}} }
{{/:date}}

{{ :highlight }}

\begin{document}

{{#:title}}\maketitle{{/:title}}

{{{ :body }}}

\end{document}

and call weave like so

weave("my_doc.jmd", template = "custom.tpl", doctype = "md2pdf")

margin figures can be included:

```julia, fig_env = "marginfigure", fig_pos = "-1cm",fig_cap = "Plot of x and y."
plot(x,y)

Only works if you include fig_pos

Obviously, you need to install tufte.sty for this to work.

Not sure how to do sidenotes, but Julia Markdown would not need to support it. Just needs some way to tell Weave to pass on the raw LaTeX command to pdflatex, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants