Skip to content

Commit

Permalink
add options to control scale, width and height when compiling a latex…
Browse files Browse the repository at this point in the history
…-string to pdf
  • Loading branch information
kamalsaleh committed Jun 8, 2024
1 parent b607e74 commit ae4132f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion ToolsForHigherHomologicalAlgebra/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "ToolsForHigherHomologicalAlgebra",
Subtitle := "Tools for the Higher Homological Algebra project",
Version := "2023.09-01",
Version := "2024.06-01",
Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ),
License := "GPL-2.0-or-later",

Expand Down
23 changes: 9 additions & 14 deletions ToolsForHigherHomologicalAlgebra/gap/LaTeX.gi
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ InstallOtherMethod( Show,
[ IsString, IsObject ],
function( c, r )

Show( c : ScaleBox := r );
Show( c : scale := r );

end );

Expand All @@ -48,27 +48,22 @@ InstallMethod( Show,
[ IsString ],

function( str )
local scale, dir, filename, string, x, file;

scale := ValueOption( "ScaleBox" );
local scale, width, height, dir, filename, string, file, x;

if scale = fail then

scale := "1";

elif not IsString( scale ) then

scale := String( scale );

fi;
scale := CAP_INTERNAL_RETURN_OPTION_OR_DEFAULT( "scale", "1" );
width := CAP_INTERNAL_RETURN_OPTION_OR_DEFAULT( "width", "10in" );
height := CAP_INTERNAL_RETURN_OPTION_OR_DEFAULT( "height", "15in" );

dir := DirectoryTemporary();

filename := Filename( dir, "main.tex" );

string := Concatenation(
"""
\documentclass[12pt,makeidx]{amsbook}
\documentclass{article}
\usepackage{geometry}
% Set custom paper size
\geometry{paperwidth=""", width, ", paperheight=", height, """, margin=1in}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{amsthm}
Expand Down

0 comments on commit ae4132f

Please sign in to comment.