Ask Your Question

done_with_fish's profile - activity

2023-07-05 14:01:18 +0200 received badge  Notable Question (source)
2023-07-05 14:01:18 +0200 received badge  Popular Question (source)
2022-05-19 17:36:14 +0200 received badge  Popular Question (source)
2022-04-04 05:38:15 +0200 received badge  Notable Question (source)
2022-03-09 21:41:32 +0200 received badge  Notable Question (source)
2022-01-27 22:34:30 +0200 received badge  Famous Question (source)
2021-08-24 09:46:50 +0200 received badge  Notable Question (source)
2021-03-10 09:57:17 +0200 received badge  Famous Question (source)
2021-02-15 21:45:48 +0200 received badge  Notable Question (source)
2020-10-13 06:23:47 +0200 received badge  Popular Question (source)
2020-10-04 22:33:17 +0200 received badge  Popular Question (source)
2020-10-04 22:33:17 +0200 received badge  Notable Question (source)
2020-08-31 08:58:58 +0200 asked a question Can sagetex generate tex files?

I'm writing a latex document that will eventually need to be compiled on a machine that does not have sage on it. However, right now I'm using sagetex to write this document. I'm curious if it is somehow possible to generate a latex document with all of the \sage invocations replaced with the corresponding latex code.

2020-07-13 13:07:54 +0200 received badge  Notable Question (source)
2020-05-13 19:43:57 +0200 received badge  Popular Question (source)
2020-05-08 03:35:08 +0200 received badge  Popular Question (source)
2020-04-23 09:46:45 +0200 received badge  Famous Question (source)
2020-04-23 09:46:36 +0200 received badge  Notable Question (source)
2020-04-09 22:54:19 +0200 asked a question Can sagetex be configured to read init.sage?

I have a lot of useful code stored in $DOT_SAGE/init.sage. I'd like sagetex to always have access to my useful code in init.sage. Is this possible?

2020-04-09 22:27:55 +0200 commented answer How can I change the location of DOT_SAGE?

Ahh, so sage reads environment variables set by my shell?

2020-04-09 06:35:27 +0200 asked a question How can I change the location of DOT_SAGE?

The documentation for environment variables used by sage it is mentioned that the default location of DOT_SAGE is $HOME/.sage/ but that this location can be changed.

How can this location be changed?

2020-03-09 19:11:29 +0200 received badge  Popular Question (source)
2020-02-07 19:03:40 +0200 received badge  Nice Question (source)
2020-02-07 19:03:36 +0200 received badge  Nice Answer (source)
2020-02-07 19:03:23 +0200 received badge  Notable Question (source)
2020-01-04 15:28:10 +0200 received badge  Popular Question (source)
2019-10-26 13:18:59 +0200 received badge  Nice Question (source)
2019-08-27 22:47:29 +0200 received badge  Popular Question (source)
2019-08-27 22:16:52 +0200 received badge  Popular Question (source)
2019-08-27 16:20:26 +0200 received badge  Popular Question (source)
2019-08-27 11:40:29 +0200 received badge  Famous Question (source)
2019-06-26 17:43:49 +0200 received badge  Notable Question (source)
2019-06-26 17:43:49 +0200 received badge  Famous Question (source)
2019-01-15 04:47:30 +0200 asked a question Why can't I use the sagesilent environment in AtBeginDocument?

I'm trying to write a latex sty file to change the default behavior of sagetex.

My file is

\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{examplepackage}[2018/12/24 examplepackage]

\RequirePackage{sagetex}
\RequirePackage{etoolbox}

\AtBeginDocument{%
  \begin{sagesilent}
    A = 3
  \end{sagesilent}
}

\endinput

However, attempting to use this sty file in the following latex file produces the error ! File ended while scanning use of \next.

\documentclass[12pt]{article}

\usepackage{examplepackage}

\begin{document}
hello world!
\end{document}

What's wrong with my sty file?

2018-12-25 11:28:00 +0200 asked a question Is it possible to remove the latex parentheses from exponential functions?

Consider the block of code

sage: f = exp(x**2)
sage: latex(f)
e^{\left(x^{2}\right)}

It looks like sage is configured to include parentheses in the latex of an exponential function. Is it possible to configure sage to exclude these parentheses?

2018-12-24 19:20:40 +0200 marked best answer Can sage compute the h* vector of a polytope?

We can define polytopes in sage with the command

sage: p = Polytope(A)

Here p is the convex hull of the integer matrix A.

I'm curious if we can compute the h* vector of p. Is this possible?

Roughly, the h* vector of a convex lattice polytope is constructed as follows.

The Ehrhart series can be expressed as a rational function whose numerator is a polynomial. The h* vector of a polytope is the vector of coefficients of this polynomial.

I'm aware that sage can compute the ehrhart polynomial of a polytope with sage: p.ehrhart_polynomial() but I cant find anything about the h* vector in the documentation.

I know the command in polymake is $p -> H_STAR_VECTOR, but I'm not sure if this vector can be constructed in sage.

Perhaps a more general question would be: can I pass a polytope defined in sage to polymake and can sage read the results of the polymake operation?

2018-12-24 19:19:35 +0200 asked a question Is it possible to customize the default behavior of sagetex?

When using sagetex, I want my matrices to have square brackets and my vectors to have angled brackets. Hence, the first thing I do after \begin{document} is include the code

  \begin{sagesilent}
    latex.matrix_delimiters(left='[', right=']')
    latex.vector_delimiters(left='<', right='>')
  \end{sagesilent}

This is very annoying. Is it possible to set sagetex up to do this by default?

2018-05-02 16:11:09 +0200 received badge  Popular Question (source)
2018-05-02 15:27:48 +0200 received badge  Nice Question (source)
2018-05-02 15:10:12 +0200 received badge  Notable Question (source)