/usr/share/perl5/LaTeXML/Package/rotating.sty.ltxml is in latexml 0.8.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | # -*- mode: Perl -*-
# /=====================================================================\ #
# | rotating | #
# | Implementation for LaTeXML | #
# |=====================================================================| #
# | Part of LaTeXML: | #
# | Public domain software, produced as part of work done by the | #
# | United States Government & not subject to copyright in the US. | #
# |---------------------------------------------------------------------| #
# | Bruce Miller <bruce.miller@nist.gov> #_# | #
# | http://dlmf.nist.gov/LaTeXML/ (o o) | #
# \=========================================================ooo==U==ooo=/ #
package LaTeXML::Package::Pool;
use strict;
use warnings;
use LaTeXML::Package;
#======================================================================
foreach my $option (qw(twoside figuresright figuresleft
quiet log chatter)) {
DeclareOption($option, undef); }
ProcessOptions();
# counterclockwise clockwise anticlockwise
# DeclareOption($option,undef); }
# expected...
RequirePackage('graphicx');
#RequirePackage('ifthen');
DefRegister('\rotFPtop' => Dimension('0pt'));
DefRegister('\rotFPbot' => Dimension('0pt'));
DefEnvironment('{sideways}',
"<ltx:inline-block angle='#angle' width='#width' height='#height' depth='#depth'"
. " innerwidth='#innerwidth' innerheight='#innerheight' innerdepth='#innerdepth'"
. " xscale='#xscale' yscale='#yscale'"
. " xtranslate='#xtranslate' ytranslate='#ytranslate'>"
. "#body"
. "</ltx:inline-block>",
afterDigestBody => sub {
my ($stomach, $whatsit) = @_;
$whatsit->setProperties(rotatedProperties(90, $whatsit->getBody)); });
DefEnvironment('{turn}{Float}',
"<ltx:inline-block angle='#angle' width='#width' height='#height' depth='#depth'"
. " innerwidth='#innerwidth' innerheight='#innerheight' innerdepth='#innerdepth'"
. " xscale='#xscale' yscale='#yscale'"
. " xtranslate='#xtranslate' ytranslate='#ytranslate'>"
. "#body"
. "</ltx:inline-block>",
afterDigestBody => sub {
my ($stomach, $whatsit) = @_;
$whatsit->setProperties(rotatedProperties($whatsit->getArg(1), $whatsit->getBody)); });
DefEnvironment('{rotate}{Float}',
"<ltx:inline-block angle='#angle' width='#width' height='#height' depth='#depth'"
. " innerwidth='#innerwidth' innerheight='#innerheight' innerdepth='#innerdepth'"
. " xscale='#xscale' yscale='#yscale'"
. " xtranslate='#xtranslate' ytranslate='#ytranslate'>"
. "#body"
. "</ltx:inline-block>",
afterDigestBody => sub {
my ($stomach, $whatsit) = @_;
$whatsit->setProperties(rotatedProperties($whatsit->getArg(1), $whatsit->getBody, 1)); });
# \turnbox{angle}{stuff}
# Same as graphics' \rotatebox ?
DefConstructor('\turnbox{Float} Digested',
"<ltx:inline-block angle='#angle' width='#width' height='#height' depth='#depth'"
. " innerwidth='#innerwidth' innerheight='#innerheight' innerdepth='#innerdepth'"
. " xscale='#xscale' yscale='#yscale'"
. " xtranslate='#xtranslate' ytranslate='#ytranslate'>"
. "#2"
. "</ltx:inline-block>",
properties => sub {
my ($stomach, $angle, $box) = @_;
rotatedProperties($angle, $box); },
mode => 'text');
#======================================================================
# These should produce a table or figure, but marked to rotate by 90degrees!
# and this rotation likely should be ignored!!!
# Basically, copy table & figure environments, but add class=ltx_sideways
# REWRITE THESE TO USE Regular figure and the above inner macros?
# No, that doesn't work, because there's no appropriate inline-block element
# that could sensibly go inside or outside the figure!
# Next best thing: at least make the contained elements have normal wrap
DefEnvironment('{sidewaysfigure}[]',
"<ltx:figure refnum='#refnum' frefnum='#frefnum' rrefnum='#rrefnum' xml:id='#id' ?#1(placement='#1')"
. " angle='#angle' width='#width' height='#height' depth='#depth'"
. " innerwidth='#innerwidth' innerheight='#innerheight' innerdepth='#innerdepth'"
. " xscale='#xscale' yscale='#yscale'"
. " xtranslate='#xtranslate' ytranslate='#ytranslate'>"
. "#body"
. "</ltx:figure>",
properties => { layout => 'vertical' },
beforeDigest => sub { DefMacroI('\@captype', undef, 'figure'); },
afterDigest => sub {
my ($stomach, $whatsit) = @_;
RescueCaptionCounters('figure', $whatsit);
return; },
afterDigestBody => sub {
my ($stomach, $whatsit) = @_;
$whatsit->setProperties(rotatedProperties(90, $whatsit->getBody)); });
DefEnvironment('{sidewaysfigure*}[]',
"<ltx:figure refnum='#refnum' frefnum='#frefnum' rrefnum='#rrefnum' xml:id='#id' ?#1(placement='#1')"
. " angle='#angle' width='#width' height='#height' depth='#depth'"
. " innerwidth='#innerwidth' innerheight='#innerheight' innerdepth='#innerdepth'"
. " xscale='#xscale' yscale='#yscale'"
. " xtranslate='#xtranslate' ytranslate='#ytranslate'>"
. "#body"
. "</ltx:figure>",
properties => { layout => 'vertical' },
beforeDigest => sub { DefMacroI('\@captype', undef, 'figure'); },
afterDigest => sub { RescueCaptionCounters('figure', $_[1]); },
afterDigestBody => sub {
my ($stomach, $whatsit) = @_;
$whatsit->setProperties(rotatedProperties(90, $whatsit->getBody)); });
DefEnvironment('{sidewaystable}[]',
"<ltx:table refnum='#refnum' frefnum='#frefnum' rrefnum='#rrefnum' xml:id='#id' ?#1(placement='#1')"
. " angle='#angle' width='#width' height='#height' depth='#depth'"
. " innerwidth='#innerwidth' innerheight='#innerheight' innerdepth='#innerdepth'"
. " xscale='#xscale' yscale='#yscale'"
. " xtranslate='#xtranslate' ytranslate='#ytranslate'>"
. "#body"
. "</ltx:table>",
properties => { layout => 'vertical' },
beforeDigest => sub { DefMacroI('\@captype', undef, 'table'); },
afterDigest => sub { RescueCaptionCounters('table', $_[1]); },
afterDigestBody => sub {
my ($stomach, $whatsit) = @_;
$whatsit->setProperties(rotatedProperties(90, $whatsit->getBody)); });
DefEnvironment('{sidewaystable*}[]',
"<ltx:table refnum='#refnum' frefnum='#frefnum' rrefnum='#rrefnum' xml:id='#id' ?#1(placement='#1')"
. " angle='#angle' width='#width' height='#height' depth='#depth'"
. " innerwidth='#innerwidth' innerheight='#innerheight' innerdepth='#innerdepth'"
. " xscale='#xscale' yscale='#yscale'"
. " xtranslate='#xtranslate' ytranslate='#ytranslate'>"
. "#body"
. "</ltx:table>",
properties => { layout => 'vertical' },
beforeDigest => sub { DefMacroI('\@captype', undef, 'table'); },
afterDigest => sub { RescueCaptionCounters('table', $_[1]); },
afterDigestBody => sub {
my ($stomach, $whatsit) = @_;
$whatsit->setProperties(rotatedProperties(90, $whatsit->getBody)); });
# This is likely to be totally wrong.
# This way puts the caption where it can't be!
#DefMacro('\rotcaption{}', '\turnbox{90}{\caption{#1}}');
# This one puts the rotated caption ON TOP of the figure!
DefMacro('\rotcaption{}', '\caption{\turnbox{90}{#1}}');
#======================================================================
1;
|