2

If I compile this code in my system (Windows 10, Miktex 2.9, Tikz 3.01a) everything is fine except that the rotated formulas are shifted to the right so that the bottom one straddles the right side of the box. If I change the measure (text width) from 5.5 to 5 the output is as it should (or very nearly so); it seems this type of thing never happens; it is rather disturbing; is there a known explanation for that? What's current knowledge regarding this sort of discrepancy?

The code is repeated below.

\documentclass{article}
\usepackage[landscape,margin=0cm]{geometry}
\usepackage{mathtools}
\usepackage{amssymb,amsthm}
\usepackage{multicol}
\usepackage[most]{tcolorbox}
\usepackage{tikz}
\usetikzlibrary{positioning}

\newtcolorbox{mybox}[2][]{width=\linewidth,fontupper=\scriptsize,
  fonttitle=\bfseries\sffamily\scriptsize, colbacktitle=black, enhanced,
  attach boxed title to top left={yshift=-2mm,xshift=3mm},
  boxed title style={sharp corners},top=2mm, bottom=1mm, left=1.5mm,
  right=1.5mm, title=#2, colback=white}

\pagestyle{empty}
\parindent=0pt
\parskip=2pt

\begin{document}

\begin{multicols*}{3}

\begin{mybox}{Single Side-Band (SSB)}
\begin{tikzpicture}[node distance=2mm, inner sep=0pt, outer sep=0pt]
  \node (image) {\includegraphics[width=3.4cm]{example-image-a}};
  \node (phase) [align=center, text width=5.5cm, right=of image.north east,
      anchor=north west] {
    Phase Shifting method: \\
    $\phi_{SSB} =  A_{c}[m(t)\cos 2\pi f_{c}t\mp\hat{m}(t)\sin2\pi f_{c}t]$
  };
  \node [below=of image.south west, anchor=north west,text width=7.5cm] {
    Demod of SSB-SC: \\
    \quad$=A_{c}m(t)+\underbrace{A_{c}[m(t)\cos 4\pi f_{c}t\mp \hat{m}(t)\sin4\pi f_{c}t]}_{\text{Suppressed by LPF}}$};
  \node [rotate=90, text width=8cm, below=of phase.south east, anchor=south
  east, font=\tiny] {
    \begin{align*}
      \phi_{SSB} = & A_{c}[m(t)\cos 2\pi f_{c}t\mp\hat{m}(t)\sin2\pi f_{c}t] + A\cos2\pi f_{c}t, \\
                 = & E(t)\cos(2\pi f_{c}t + \theta(t)) \\
      \text{where}\quad E(t) = & A_{c}\sqrt{[A+m(t)]^{2} + [\hat{m}(t)]^{2}} \text{ and } \theta(t)=-\tan^{-1}\left\{ \frac{\hat{m}(t)}{A + m(t)} \right\}
    \end{align*}
  };
\end{tikzpicture}
\end{mybox}

\end{multicols*}
\end{document}
LPH
  • 246
  • you have tagged the question with windows and miktex tags but it seems unrelated to all of those, the content is simply too wide for the page, if you reduce the width of the node from 5.5 to 5 it almost fits – David Carlisle Nov 03 '18 at 08:36
  • 3
    also what do you mean by "same code" surely making the width of the text node smaller is explicitly changing the code to fix the issue that it is too wide? – David Carlisle Nov 03 '18 at 08:40
  • I mean that the code taken from the answer I refer to is not changed by me before I compile it (and I get something that does not correspond); I do change it only after that, in order to check if it might not be a matter of distance. It hadn't occurred to me to check whether there were bad boxes or not but after your precisions I recompiled and did so; there is a bad box for 5.5, there is one for 5 and there is none for 4.5. That would seem to show that the answerer's code does not correspond to his output. It just didn't occur to me that there could have been a problem with the initial code. – LPH Nov 03 '18 at 09:06
  • ah Ok I thought you meant "unchanged after you'd changed it" (which didn't make sense:-) I left a comment on the other answer, you were doing the same at the same time, it seems. – David Carlisle Nov 03 '18 at 09:15
  • I just rechecked it on my machine and output is the same as the screen shot in the referenced question. If I add \listfiles the most recently updated files are the l3kernel ones updated on 2018/09/24. I run debian testing, so my files lag a little behind the latest. Could outdated files on my machine be the causing problems? – David Purton Nov 03 '18 at 12:36
  • Perhaps it's to do with the overfull boxes.Try changing the width of the last node from 8cm to 8.1cm. And the width of the example image from 3.4cm to 3.3cm. This gets rid of the overfull boxes for me. – David Purton Nov 03 '18 at 12:51
  • My best guess is paper size. My paper size is automatically set to A4, but it could be US Letter for you. If I change it to Letter, then I do get overlaps. – David Purton Nov 03 '18 at 13:15
  • @DavidPurton I made the changes you suggest and that improves the placement of the formulas, but that's all; it's still off and the compilation causes 1 bad box. There has to be a difference in our respective systems after all. It's possible I need to update mine. – LPH Nov 03 '18 at 13:18
  • @DavidPurton Mine's also a4 usually, and declared to be so in either one of the Miktex or Texniccenter installations; However, I did not specify it in the code which I left such as I found it (and there is no specification in it, it's just "\documentclass{article}". This new try now, that is introducing "letter" as an option in the documentclass command, doesn't help either. – LPH Nov 03 '18 at 13:30
  • @DavidPurton I understand now that my system is set on a letter default and that I had to take that into account (which nothing had yet made me aware of) and add the option "a4paper"; I just did that and all is fine; thanks for your suggestions. – LPH Nov 03 '18 at 13:51

1 Answers1

2

The problem was with my set up used when I initially answered the original question.

I had a geometry.cfg file containing \ExecuteOptions{a4paper} which meant my columns were wider than the default.

The answer in the original question is now updated.

It has been suggested to me that having such a geometry.cfg is a bad idea if I'm going to post answers on this site ;).

David Purton
  • 25,884