From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/28352 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Randy Yates Newsgroups: gmane.text.pandoc Subject: Re: Markdown to PDF via TeX: Tyring to change section title color Date: Sat, 15 May 2021 11:50:53 -0700 (PDT) Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_6962_205911107.1621104653411" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25467"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCB75SPSW4EBBDVQQCCQMGQELVTTOUI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat May 15 20:50:57 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f64.google.com ([209.85.210.64]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lhzNI-0006Rb-Pg for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 15 May 2021 20:50:56 +0200 Original-Received: by mail-ot1-f64.google.com with SMTP id u12-20020a9d4d8c0000b02902dcb6679ca2sf1930002otk.20 for ; Sat, 15 May 2021 11:50:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=VaQQfiGNsFNurNZ/UhaFbdT217RuJ0Prb0lap3XRTmQ=; b=qunHmZs8cBg4z1BV5snh6kOUcBRmXCb0Z4nBkL3BL0ZvNgNSepmp8a2f7qceMg/85V sdAXcpOlfbeKF0Gee6Sgj1vOzYo68loLwJ62Eploxlzd35Xa7ukPrTcV0cLkRb3lvfz+ l0RSZ5XA5ToWaH16mO70dem3lNMJB+XlZ8SNcKU0ErwQAys9lHejeFTZYhSRxnP2VK1a /t6t87HtUoncrHAtrpKMDSJ4J8c8w8iAq+RAlrxMR3Rqt4J+vzmmpDU2678wMsBJ89h7 nD0dzPMkZtFJdwv26hvEZymUIMqFDVpbM1VgO/JbrZ09/+OY6LvZueUcscdvPCBOKkhv OHKw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=VaQQfiGNsFNurNZ/UhaFbdT217RuJ0Prb0lap3XRTmQ=; b=aQTaREmpvjewLEuIJfkYCLv+php/Ved/WhIZOF58mMJPUnvASCZoKApd2dfdDKQcMN mhk68dLB0COyiLDuFL7vFADHldTdHpq505nVpnh6jlDT14klMw0fnbS/fonAyASdYzSc XGU9n6g+XZ2E2ZVNZuobRpnhECT1wDY5EOG/A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=VaQQfiGNsFNurNZ/UhaFbdT217RuJ0Prb0lap3XRTmQ=; b=Q4jPcpQ8SMjew+b7wUu7nu+tR+3y2HUDJv8yMCV26wdYxXfv9zahHz/Fyl+qAqg0ly +tjTfWxYnBD7v52ye1P0Pg4xotWTavvMGRF0G0LwOZ/Z2BcV2HWltKbPdPqlEg2yTdMv FaQJ1fD4dknX+GOzqO6aVILgypIqO1esq4u+U86m94XErHg5wrdg1z0GGBjEtJqBX9fL ZqZWfhnKyyJh26psB0y9MoBSWL2IcUS9fMciepPGfqdXJuP3NPirHxiw6vh65x075PTL fjWuX5dV71qUuDr3Ra5HYjTbZRq/x9LXbPqwAeNGonfld8EWAjffV40bE8Fvj5444i1B OffQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM532cboFwErDJnYBXaO1f25mf6+UOUAmYPebvKPU030HBW23QJqzi ZcuK0/LAItbXsOgDXIEOyD0= X-Google-Smtp-Source: ABdhPJzZD5LbPXm28ti9v/rv8IQIfYfPT2t+JRxnAGyj0QH7hfBR5p8iGBud5bwnm+YjuMJirPLZWQ== X-Received: by 2002:a9d:7e99:: with SMTP id m25mr2548170otp.37.1621104655807; Sat, 15 May 2021 11:50:55 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a9d:6c87:: with SMTP id c7ls3507015otr.3.gmail; Sat, 15 May 2021 11:50:54 -0700 (PDT) X-Received: by 2002:a9d:7747:: with SMTP id t7mr30108013otl.96.1621104654137; Sat, 15 May 2021 11:50:54 -0700 (PDT) In-Reply-To: X-Original-Sender: yates-EkmVulN54Sk@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:28352 Archived-At: ------=_Part_6962_205911107.1621104653411 Content-Type: multipart/alternative; boundary="----=_Part_6963_2110147953.1621104653412" ------=_Part_6963_2110147953.1621104653412 Content-Type: text/plain; charset="UTF-8" Hi Russ, I hope you don't resent these thoughts since they do not solve your problem directly, but may I ask why you are trying to go from markdown to latex to pdf? Latex is compilable directly to pdf and almost certainly will generate better pdf than pandoc. Don't use markdown as your source document format. Latex's capabilities for generating rich output are far, far greater than markdown, which can't even generate numbered section headers. Latex also offers: 1. Elegant mathematics 2. An extensive bibliography/citation system 3. The ability to natively generate graphics using Tikz/Pgm. I've also found an excellent, free tool for converting latex docs to html: LaTeXML . It automagically handles citations. It is even capable of translating many tikz illustrations to html, e.g. several of the examples here . So in general, choose a source document format that's the least "lossy" in terms of typographical capability, then translation to other formats incurs the least loss possible. --Randy On Friday, May 14, 2021 at 5:22:02 PM UTC-4 rurq...-Zl5T1cyB3pc@public.gmane.org wrote: > Hi all, > > I found several items on the web about customizing my pdf output from > Pandoc. > > I am calling pandoc with the following parameters: > > pandoc *.md -H seccolor.tex -o test_doc.pdf --table-of-contents > --number-sections --indented-code-classes=javascript > --highlight-style=monochrome -V mainfont="Palatino" -V documentclass=report > -V papersize=A5 -V geometry:margin=1in -V monofont="Courier" > --pdf-engine=xelatex > > The seccolor.tex file is: > > \usepackage{titlesec} > \definecolor{DPurple}{rgb}{.75,.52,.153} > \titleformat*{\section}{\color{DPurple}} > % \sectionfont{\color{DPurple}} > > When i run the command i get: > > Error producing PDF. > ! LaTeX Error: File `titlesec.sty' not found. > > Type X to quit or to proceed, > or enter new name. (Default extension: sty) > > Enter file name: > ! Emergency stop. > > > l.98 \definecolor > > Should i be using another style? I WAS able to generate a standard PDF, > but just wanted to add a splash of color. From what I read, this snippet of > TeX should work. > > Can anyone suggest how I can fix this? > > Thanks, > > Russ > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/f025f0e7-98ff-4f50-9ba2-37687041fb3dn%40googlegroups.com. ------=_Part_6963_2110147953.1621104653412 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Russ,

I hope you don't resent these thoughts since th= ey do not solve your problem directly, but may I ask why you are trying to = go from markdown to latex to pdf? 
Latex is compilable direc= tly to pdf and almost certainly will generate better pdf than pandoc. =

Don't use markdown as your source document fo= rmat. Latex's capabilities for generating rich output are far, far greater = than markdown, which can't even generate numbered section headers. Latex al= so offers:

  1. Elegant mathematics
  2. An = extensive bibliography/citation system
  3. The ability to natively gene= rate graphics using Tikz/Pgm.
I've also found an excellent, f= ree tool for converting latex docs to html: LaTeXML. It automagically handles citations. It is eve= n capable of translating many tikz illustrations to html, e.g. several of t= he examples here.<= /div>

So in general, choose a source document form= at that's the least "lossy" in terms of typographical capability, then tran= slation to other formats incurs the least loss possible.

--Randy

On Friday, May 14, 2021 at 5:22:02 PM UTC-4 rurq.= ..@d2iq.com wrote:
Hi all,

I found several items on the web about cus= tomizing my pdf output from Pandoc.

I am calling p= andoc with the following parameters:

=C2=A0 =C2=A0= =C2=A0pandoc *.md -H seccolor.tex -o test_doc.pdf --table-of-contents --nu= mber-sections --indented-code-classes=3Djavascript --highlight-style=3Dmono= chrome -V mainfont=3D"Palatino" -V documentclass=3Dreport -V pape= rsize=3DA5 -V geometry:margin=3D1in -V monofont=3D"Courier" --pdf= -engine=3Dxelatex

The seccolor.tex file is:

=C2=A0 =C2=A0 \us= epackage{titlesec}
\definecolor{DPurple}{rgb}{.75,.52,.153}
=
\titleformat*{\section}{\color{DPurple}}
% \sectionfont{\col= or{DPurple}}

When i run the command i get:

Error produci= ng PDF.
! LaTeX Error: File `titlesec.sty' not found.

Type X to quit or <RETURN> to proceed,
or= enter new name. (Default extension: sty)

Enter fi= le name:=C2=A0
! Emergency stop.
<read *>=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
l.98 \definecolor
=
Should i be using another style? I WAS able to generate a standard PDF,= but just wanted to add a splash of color. From what I read, this snippet o= f TeX should work.

Can anyone suggest how I can fix this?

Tha= nks,

Russ

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/f025f0e7-98ff-4f50-9ba2-37687041fb3dn%40googlegroups.= com.
------=_Part_6963_2110147953.1621104653412-- ------=_Part_6962_205911107.1621104653411--