Scaling a matrix

149 views
Skip to first unread message

Tom Killwhang

unread,
May 24, 2020, 5:22:56 AM5/24/20
to LaTeX Users Group
I have a matrix composed of a real and imaginary part but it is too big to fit in the line and overflows. 
What is the best way to reduce its size?

 \[W^*_{642}=\left[ \begin{array} {cccc}
\ 1.5372\  & 1.4499\  & -0.8958\  & 1.3592\  \\ 
\ -0.1472\  & 1.0482\  & 1.8678\  & -0.4285\  \\ 
-0.0520\  & 0.8299\mathrm{\ \ } & 1.3499\mathrm{\ \ } & -0.2669\  \\ 
0.8216\  & \ 0.8565\  & -0.3562\  & 0.7059\  \end{array} 
 \right]
+ i\left[ \begin{array}{cccc}
\mathrm{\ \ -}\mathrm{0.7905} & \ 0.0101 & \ -\ 0.1503 & \ 1.4715 \\ 
\mathrm{\ \ }\mathrm{0.3275} & \ -\ 0.5116 & \mathrm{\ \ }\mathrm{0.7519} & \ -\ 0.6568 \\ 
\mathrm{\ -}\mathrm{0.1427} & \mathrm{\ \ }\mathrm{0.4836}\  & \ -\ 0.6818\  & \mathrm{\ \ }\mathrm{0.3105} \\ 
\ 0.4507 & \mathrm{\ \ \ }\mathrm{0.8530} & \ -\ 1.0814 & \ -\ 0.7589 \end{array} 
 \right]\] 


I tried using \scalemath{0.75}  and it does work though I needed to use it twice. Maybe you wizards have an easier method

 \[W^*_{642}=\left[\scalemath{0.75}  {  \begin{array} {cccc}
\ 1.5372\  & 1.4499\  & -0.8958\  & 1.3592\  \\ 
\ -0.1472\  & 1.0482\  & 1.8678\  & -0.4285\  \\ 
-0.0520\  & 0.8299\mathrm{\ \ } & 1.3499\mathrm{\ \ } & -0.2669\  \\ 
0.8216\  & \ 0.8565\  & -0.3562\  & 0.7059\  \end{array} }
 \right]
+ i\left[ \scalemath{0.75} { \begin{array}{cccc}
\mathrm{\ \ -}\mathrm{0.7905} & \ 0.0101 & \ -\ 0.1503 & \ 1.4715 \\ 
\mathrm{\ \ }\mathrm{0.3275} & \ -\ 0.5116 & \mathrm{\ \ }\mathrm{0.7519} & \ -\ 0.6568 \\ 
\mathrm{\ -}\mathrm{0.1427} & \mathrm{\ \ }\mathrm{0.4836}\  & \ -\ 0.6818\  & \mathrm{\ \ }\mathrm{0.3105} \\ 
\ 0.4507 & \mathrm{\ \ \ }\mathrm{0.8530} & \ -\ 1.0814 & \ -\ 0.7589 \end{array} }
 \right]\] 

Thank you

Peter Flynn

unread,
May 24, 2020, 5:36:06 AM5/24/20
to latexusersgroup
If you find yourself adding extra spaces like that, it's always the wrong thing. 
Never use "\  " to try and force formatting — LaTeX has proper ways to do this which are much easier

\documentclass{article}
\usepackage{dcolumn}
\newcolumntype{d}{D{.}{.}{4}}
\arraycolsep.5ex
\begin{document}
{\footnotesize
  \[W^*_{642}=\left[\begin{array} {dddd}
      1.5372&1.4499&-0.8958&1.3592\\
      -0.1472&1.0482&1.8678&-0.4285\\
      -0.0520&0.8299&1.3499&-0.2669\\
      0.8216&0.8565&-0.3562&0.7059\end{array}
      \right]
  + i
  \left[\begin{array}{dddd}
      -0.7905&0.0101&0.1503&1.4715\\
      0.3275&0.5116&0.7519&-0.6568\\
      -0.1427&0.4836&-0.6818&0.3105\\
      0.4507&0.8530&-1.0814&-0.7589\end{array}
      \right]\]
}
\end{document}

Peter

--
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to latexusersgro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/latexusersgroup/9e1680a6-7a53-4f50-b1f9-0bf9a1ebfae3%40googlegroups.com.

Tom Killwhang

unread,
May 24, 2020, 4:09:31 PM5/24/20
to LaTeX Users Group
Thank you everybody - very useful 

Aleks Kleyn

unread,
Jun 28, 2020, 6:15:24 PM6/28/20
to latexus...@googlegroups.com

In new version of pdfLaTeX appeared strange bug. If I use command

pdflatex a.English.tex

I cannot finish compilation because it terminates without any specific error message. If I change command

pdflatex a.English.tex >a.txt

then compilation is successful. Any ideas what I can do to see process on console like I did before

 

Aleks Kleyn

http://alekskleyn.dyndns-home.com:4080/ 

http://sites.google.com/site/AleksKleyn/

http://arxiv.org/a/kleyn_a_1 

http://AleksKleyn.blogspot.com/

http://KleynAleks.blogspot.com/

 

Derivative in Banach algebra

dx2

=1x+x1

dx

  d x2 =(1x+x1) ◦dx=dx x+x dx

 

 

.

Peter Flynn

unread,
Jun 28, 2020, 7:29:44 PM6/28/20
to latexus...@googlegroups.com
On 28/06/2020 23:15, Aleks Kleyn wrote:
> In new version of pdfLaTeX appeared strange bug. If I use command
>
> pdflatex a.English.tex
>
> I cannot finish compilation because it terminates without any specific
> error message. If I change command
>
> pdflatex a.English.tex >a.txt
>
> then compilation is successful. Any ideas what I can do to see process
> on console like I did before

We need more help from you to answer this:

1. What distribution? (TeX Live, MiKTeX, MacTeX, etc)

2. What version of pdflatex?

3. What version of LaTeX?

4. What is the last message you see before it terminates?

5. Create a minimal example (remove everything unnecessary from the file
until you get the smallest file which shows the error)

6. If you are using Windows, I think there is a problem using filenames
with more than one dot. Rename a.English.tex to a-English.tex and try that.

Peter

Aleks Kleyn

unread,
Jun 28, 2020, 8:13:49 PM6/28/20
to latexus...@googlegroups.com

1. I use MiKTeX 20.6 and made today fresh update

 

2. I use pdflatex, but in the log file I see pdfTeX, Version 3.14159265-2.6-1.40.21

 

3. This is amsbook class

 

4. What is the last message you see before it terminates?

Last text in log file is

] [10] <xymatrix 3x2 141>

 

Overfull \hbox (1.47255pt too wide) in paragraph at lines 714--717

[][][]\T2B/cmr/m/sc/10 Теорема \T2B/cmr/m/n/10 2.2.6\T2B/cmr/m/sc/10 . []\T2B/c

mr/m/it/10 Про-из-ве-де-ние су-.

 

I think there is problem to output text to console. When I order text to file, compilation goes to finish.  

 

5. Create a minimal example (remove everything unnecessary from the file

until you get the smallest file which shows the error)

 

I expected this request. However I am not sure this is real task. Even compilation terminates on page 8, this is about 10 files

 

6. If you are using Windows, I think there is a problem using filenames

with more than one dot. Rename a.English.tex to a-English.tex and try that.

 

I work with such packages more than 15 years.

--

You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.

To unsubscribe from this group and stop receiving emails from it, send an email to latexusersgro...@googlegroups.com.

Peter Flynn

unread,
Jun 28, 2020, 8:50:14 PM6/28/20
to latexus...@googlegroups.com
On 29/06/2020 01:13, Aleks Kleyn wrote:
> 1. I use MiKTeX 20.6 and made today fresh update
>
> 2. I use pdflatex, but in the log file I see pdfTeX, Version
> 3.14159265-2.6-1.40.21
>
> 3. This is amsbook class
>
> 4. What is the last message you see before it terminates?
>
> Last text in log file is
>
> ] [10] <xymatrix 3x2 141>
>
> Overfull \hbox (1.47255pt too wide) in paragraph at lines 714--717
>
> [][][]\T2B/cmr/m/sc/10 Теорема \T2B/cmr/m/n/10 2.2.6\T2B/cmr/m/sc/10 .
> []\T2B/c
>
> mr/m/it/10 Про-из-ве-де-ние су-.
>
> I think there is problem to output text to console. When I order text to
> file, compilation goes to finish.

I've never heard of that happening before. But that Cyrillic might
possibly be triggering some weird behaviour from the console if the
encoding is being misinterpreted as control characters.

> I expected this request. However I am not sure this is real task. Even
> compilation terminates on page 8, this is about 10 files

The next choice is a binary split. Find the file in which the error
occurs, and insert /end{document} in the middle of it (50% through).
Process it.

If there is no error, move the \end{document} to the 75% mark. Repeat.

Keep moving the \end{document} until the error occurs, then move it back
until the error does not occur, and then you have found the line.

> I work with such packages more than 15 years.

OK, so that's not it.

But as it works fine in TL 2017, I suspect it is using some macro that
has been changed in more recent versions.

Peter


Aleks Kleyn

unread,
Jun 28, 2020, 9:13:42 PM6/28/20
to latexus...@googlegroups.com
I do not think it relates directly to Cyrillic. I compile two version, one using Cyrillic and another plain English. It happened today after update. May be they will fix it in next version. I just let know that this happened. I think it relates to amount of output to console, may be number of buffers in output file.

I have one more question related to this problem. PdfLaTeX has option -quiet which should reduce amount of output to console. If it would work properly, then it could reduce time of compilation. This make sense when I compile text 200 - 300 pages long. But this option never worked as I expected. Is there way to reduce output to console and see only error messages?

Thank you
Derivative in Banach algebra
dx2
=1⊗ x+x⊗1
dx

d x2 =(1⊗ x+x⊗1) ◦dx=dx x+x dx




-----Original Message-----
From: latexus...@googlegroups.com [mailto:latexus...@googlegroups.com] On Behalf Of Peter Flynn
Sent: Sunday, June 28, 2020 8:50 PM
To: latexus...@googlegroups.com
Subject: Re: [latexusersgroup] new version of pdfLaTeX

--
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to latexusersgro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/latexusersgroup/d41b377c-2667-8c18-3a7e-fee415be2edf%40gmail.com.

Peter Flynn

unread,
Jun 29, 2020, 4:16:45 AM6/29/20
to latexus...@googlegroups.com
On 29 June 2020 02:13:42 "Aleks Kleyn" <Aleks...@mailaps.org> wrote:

I do not think it relates directly to Cyrillic. I compile two version, one using Cyrillic and another plain English. It happened today after update. May be they will fix it in next version. I just let know that this happened. I think it relates to amount of output to console, may be number of buffers in output file.

Given who wrote TeX, I doubt it.


I have one more question related to this problem. PdfLaTeX has option -quiet which should reduce amount of output to console. If it would work properly, then it could reduce time of compilation. This make sense when I compile text 200 - 300 pages long. But this option never worked as I expected. Is there way to reduce output to console and see only error messages?

Pipe stderr through a filter for error messages?

P

Aleks Kleyn

unread,
Jun 29, 2020, 11:50:32 AM6/29/20
to latexus...@googlegroups.com

I checked option to use pre-released packages. And everything works fine.

 

I did not understand your second question. What I wanted to do is to reduce output to console during translation, but I am not sure if this is possible.

 

Thank you,

--

You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to latexusersgro...@googlegroups.com.

Peter Flynn

unread,
Jun 29, 2020, 8:33:37 PM6/29/20
to latexus...@googlegroups.com
On 29/06/2020 16:50, Aleks Kleyn wrote:
> I checked option to use pre-released packages. And everything works fine.

Cool.

> I did not understand your second question. What I wanted to do is to
> reduce output to console during translation, but I am not sure if this
> is possible.

Sorry, I was not very explicit.

> Pipe std.err through a filter for error messages?

I meant

$ pdflatex a.English.tex 2|grep -A2 '^\!'

That just shows the errors, nothing else. But that only works on Mac,
Linux, and Windows/cygwin as far as I know. There may be a way to pipe
std.err in Windows but I don't know how to.

Peter

Aleks Kleyn

unread,
Jun 29, 2020, 10:06:23 PM6/29/20
to latexus...@googlegroups.com
Yes, you write this is explicitly lunix format. I will think about this, thank you.
-----Original Message-----
From: latexus...@googlegroups.com [mailto:latexus...@googlegroups.com] On Behalf Of Peter Flynn
Sent: Monday, June 29, 2020 8:34 PM
To: latexus...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to latexusersgro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/latexusersgroup/4dcf4be4-ec26-b693-d798-dc1b9077245e%40gmail.com.

Reply all
Reply to author
Forward
0 new messages