Re: [NTG-context] LMTX MetaFun SVG trouble, a portion of the SVG is cut of in the PDF

2020-12-17 Thread Pablo Rodriguez
On 12/17/20 6:45 PM, Pablo Rodriguez wrote:
> On 12/17/20 5:08 PM, Neven Sajko wrote:
>> On Thu, 17 Dec 2020 at 15:27, Aditya Mahajan  wrote:
>> [...]
>>> Can you check with a desktop pdf viewer as well.
>>
>> It looks the same with MuPDF.
>
> Hi Neven,
>
> it seems to be an issue with the conversion of the SVG file.

Hans,

I thought it was an issue with the MP conversion of the SVG file.

I was wrong: it is an issue on how LMTX deals with the SVG conversion in
MP. MkIV is totally fine respecting image dimensions.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] LMTX MetaFun SVG trouble, a portion of the SVG is cut of in the PDF

2020-12-17 Thread Pablo Rodriguez
On 12/17/20 5:08 PM, Neven Sajko wrote:
> On Thu, 17 Dec 2020 at 15:27, Aditya Mahajan  wrote:
> [...]
>> Can you check with a desktop pdf viewer as well.
>
> It looks the same with MuPDF.

Hi Neven,

it seems to be an issue with the conversion of the SVG file.

> This is a combined TeX file containing two different ways I took to
> try to accomplish the same thing:

How about a much simpler approach?

  \starttext
  \framed[offset=overlay]

{\externalfigure[hammingCoderStopwatch-hammingCoder-gcc-RowsSparse-1023-1013.svg]
  [width=\textwidth, offset=20pt]}
  \stoptext

In that case, if you use \externalfigure, ConTeXt will invoke Inkscape
to convert the file. The output is way better.

Just in case it may help,

Pablo
--
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] LMTX MetaFun SVG trouble, a portion of the SVG is cut of in the PDF

2020-12-17 Thread Neven Sajko
On Thu, 17 Dec 2020 at 15:27, Aditya Mahajan  wrote:
> OT but can Gadfly directly produce PDFs? [...]

Yes it can. Going to try that route if this doesn't work out.

> [..] Depending on how complicated plots you want to generate, you can also 
> use metapost graph module or pdfplots package for drawing 2D plots.

OT, but that wouldn't work for me easily, because I don't actually
know what function I'm plotting - it's a probability density function
estimation (which is similar to a histogram, but continuous), where I
only provide the data points and Gadfly takes care of everything else.

> Can you check with a desktop pdf viewer as well.

It looks the same with MuPDF.

> The mailing list has a size limit for attachments, so I think that your zip 
> file did not get included in your message. Could you just include the tex 
> file and maybe upload the svg somewhere and include a link.

This is a combined TeX file containing two different ways I took to
try to accomplish the same thing:

\starttext
{\switchtobodyfont[2pt]

{\framed[offset=overlay]{\includesvgfile[../hammingCoderStopwatch-hammingCoder-gcc-RowsSparse-1023-1013.svg][offset=20pt]}}
{some offset}

\startMPcode
draw lmt_svg [
filename =
"../hammingCoderStopwatch-hammingCoder-gcc-RowsSparse-1023-1013.svg"
];
setbounds currentpicture to
  boundingbox currentpicture
  enlarged 20pt;
\stopMPcode
}
\stoptext

The SVG: 
https://drive.google.com/file/d/1_JsIfA9cgEs5_x7FFJrUWPPe3Ht8JnIm/view?usp=sharing

To be specific, what gets cut off is the bottom half of each number on
the x-axis and the entire x-axis label.

Thanks,
Neven
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Installing VSCode extension?

2020-12-17 Thread Mikael Sundqvist
On Thu, Dec 17, 2020 at 10:40 AM Saša Janiška  wrote:

> On Thu, 17 Dec 2020 07:51:34 +0100
> Mikael Sundqvist  wrote:
>
> > To set the color theme, click the blue button "Set color theme".
>
> So, this is the only thing which can be configured?
>
>
> Sincerely,
> Gour
>
> --
> Everyone is forced to act helplessly according to the qualities
> he has acquired from the modes of material nature; therefore no
> one can refrain from doing something, not even for a moment.
>
>
>
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>

It is the only way I know of but maybe someone else knows more?

Best regards, Mikael
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] LMTX MetaFun SVG trouble, a portion of the SVG is cut of in the PDF

2020-12-17 Thread Aditya Mahajan
On Thu, 17 Dec 2020, Neven Sajko wrote:

> Hello all,
> 
> I am completely new to TeX, ConTeXt, MetaPost, etc. (Except for some
> MathJax snippets and the like.)
> 
> I am using Aditya's LMTX package from AUR on Archlinux.
> 
> I have some SVGs (generated by the Julia Gadfly package) that
> represent 2D plots of some functions, and I would like to include the
> SVGs in a ConTeXt document so it ends up as PDF. 

OT but can Gadfly directly produce PDFs? Depending on how complicated plots you 
want to generate, you can also use metapost graph module or pdfplots package 
for drawing 2D plots.

> I started creating
> the document by including the SVGs using the new LMTX MetaPost SVG
> feature, however at this point I don't know how to proceed...
> 
> This is the situation: the source SVGs look fine, but after including
> them in the document with the new ConTeXt feature mentioned above, the
> bottom-most part of the image is "cut off" (not visible). In the
> attached ZIP I included all relevant files (.tex, .svg, .pdf, ...), as
> well as PNG screenshots of the PDFs (in case the issue is
> PDF-viewer-specific, I'm using Chromium as the PDF viewer).

Can you check with a desktop pdf viewer as well.

> I tried doing this in two different ways: using includesvgfile with
> the offset option, and using startMPcode with setbounds in the MetaFun
> code. In both cases I just get blank space instead of the cut-off
> content
> 
> How can I fix this?

The mailing list has a size limit for attachments, so I think that your zip 
file did not get included in your message. Could you just include the tex file 
and maybe upload the svg somewhere and include a link.

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] LuaMetaTeX: \hbox dir vs. direction

2020-12-17 Thread Henri Menke
Dear Hans,

In LuaMetaTeX the directional syntax for boxes

\hbox dir TLT {...}

is no longer supported.  Currently this is necessary for PGF because certain
things like shading have to always be typeset in TLT.  Is there a simple
workaround?

Cheers, Henri

See also: https://github.com/pgf-tikz/pgf/issues/958

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] LMTX MetaFun SVG trouble, a portion of the SVG is cut of in the PDF

2020-12-17 Thread Neven Sajko
Hello all,

I am completely new to TeX, ConTeXt, MetaPost, etc. (Except for some
MathJax snippets and the like.)

I am using Aditya's LMTX package from AUR on Archlinux.

I have some SVGs (generated by the Julia Gadfly package) that
represent 2D plots of some functions, and I would like to include the
SVGs in a ConTeXt document so it ends up as PDF. I started creating
the document by including the SVGs using the new LMTX MetaPost SVG
feature, however at this point I don't know how to proceed...

This is the situation: the source SVGs look fine, but after including
them in the document with the new ConTeXt feature mentioned above, the
bottom-most part of the image is "cut off" (not visible). In the
attached ZIP I included all relevant files (.tex, .svg, .pdf, ...), as
well as PNG screenshots of the PDFs (in case the issue is
PDF-viewer-specific, I'm using Chromium as the PDF viewer).

I tried doing this in two different ways: using includesvgfile with
the offset option, and using startMPcode with setbounds in the MetaFun
code. In both cases I just get blank space instead of the cut-off
content

How can I fix this?

Related question: is it possible to get the MetaPost code that (I
think) the SVG gets translated to? I'm interested in how it looks
like.

Thanks,
Neven
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Installing VSCode extension?

2020-12-17 Thread Saša Janiška
On Thu, 17 Dec 2020 07:51:34 +0100
Mikael Sundqvist  wrote:

> To set the color theme, click the blue button "Set color theme".

So, this is the only thing which can be configured?


Sincerely,
Gour

-- 
Everyone is forced to act helplessly according to the qualities
he has acquired from the modes of material nature; therefore no
one can refrain from doing something, not even for a moment.


___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___