arXiv / html_feedback

Supports a student project developing a UI for feedback on arXiv articles rendered as html.
MIT License
18 stars 3 forks source link

Bad tikz rendering and too-large image sizes #394

Open ZamDimon opened 8 months ago

ZamDimon commented 8 months ago

Description

  1. Using the tikz package produces poorly aligned pictures. For example attached, the LaTeX code is following:

    \begin{tikzpicture}        
    % Image
    \node[anchor=center,inner sep=0](img) at (0,0) {\includegraphics[width=0.125\textwidth]{trainer_real.png}};
    
    % Reshaping layer
    \node[draw,shape=rectangle,color=black!60,fill=black!2,drop shadow,minimum width=0.5cm, minimum height=2.5cm, very thick](reshape) at (2.5,0) {};
    \node[draw,shape=circle,color=black!60,fill=black!2,minimum width=0.3cm, minimum height=0.3cm, very thick](reshape1) at (2.5,0) {};
    
    \node[draw,shape=circle,color=black!60,fill=black!2,minimum width=0.3cm, minimum height=0.3cm, very thick](reshape2) at (2.5,-1) {};
    \node[draw,shape=circle,color=black!60,fill=black!2,minimum width=0.3cm, minimum height=0.3cm, very thick](reshape3) at (2.5,-0.5) {};
    \node[draw,shape=circle,color=black!60,fill=black!2,minimum width=0.3cm, minimum height=0.3cm, very thick](reshape4) at (2.5,0.5) {};
    \node[draw,shape=circle,color=black!60,fill=black!2,minimum width=0.3cm, minimum height=0.3cm, very thick](reshape5) at (2.5,1) {};
    
    % Hidden layer
    \node[draw,shape=rectangle,color=black!60,fill=black!2,drop shadow,minimum width=0.5cm, minimum height=2.5cm, very thick](hidden) at (4.5,0) {};
    \node[draw,shape=circle,color=black!60,fill=black!2,minimum width=0.3cm, minimum height=0.3cm, very thick](hidden1) at (4.5,0) {};
    
    \node[draw,shape=circle,color=black!60,fill=black!2,minimum width=0.3cm, minimum height=0.3cm, very thick](hidden2) at (4.5,-1) {};
    \node[draw,shape=circle,color=black!60,fill=black!2,minimum width=0.3cm, minimum height=0.3cm, very thick](hidden3) at (4.5,-0.5) {};
    \node[draw,shape=circle,color=black!60,fill=black!2,minimum width=0.3cm, minimum height=0.3cm, very thick](hidden4) at (4.5,0.5) {};
    \node[draw,shape=circle,color=black!60,fill=black!2,minimum width=0.3cm, minimum height=0.3cm, very thick](hidden5) at (4.5,1) {};
    
    % Unit circle
    \node[draw,shape=circle,color=blue!60,fill=blue!10,minimum width=1.5cm, minimum height=1.5cm, very thick](unitcircle) at (7.5,0) {};
    \node (A) at (7.4, -0.1) {};
    \node (B) at (7.5+1.41421/2.2, 1.41421/2.2) {};
    \draw[-Latex,line width=0.3mm,color=red](A) edge (B);
    \node[circle,fill,inner sep=1pt,color=blue!60] at (7.5,0){};
    
    % Pathes
    \path[line width=0.5mm,dashed](img) edge [-{Stealth[length=3mm]},above] node {Reshape} (reshape);
    \path[line width=0.5mm](reshape) edge [-{Stealth[length=3mm]},above] node {} (hidden);
    \path[line width=0.5mm](hidden) edge [-{Stealth[length=3mm]},above] node {$L_2$ norm} (unitcircle);
    
    % Labels
    \node(imglabel)[above=0.05 of img]{Input image};
    \node(reshapelabel)[above=0.05 of reshape]{794 neurons};
    \node(hiddenlabel)[above=0.05 of hidden]{2048 neurons};
    \node(unitcirclelabelbelow)[below=0.05 of unitcircle]{$\|e\|_2 = 1$};
    \node(unitcirclelabelabove)[above=0.05 of unitcircle]{Unit hypersphere};
    \end{tikzpicture}
  2. Pictures seem much larger in the HTML version, both when used in tikz and via simple includegraphics. I initially thought relying on \linewidth or other relative measures was the issue; however, changing the width to the fixed value does not fix the sizing. In other words, both

    \includegraphics[width=1cm]{...}

    and

    \includegraphics[width=.1\linewidth]{...}

    look big-ish.

(Optional:) Please add any files, screenshots, or other information here.

bad tikz bad sizing

(Required) What is this issue most closely related to? Select one.

Figures

Internal issue ID

cc6d250f-3288-476d-b60d-d0b8471b7874

Paper URL

https://services.arxiv.org/html/submission/5388441/view

Browser

Firefox/122.0

Device Type

Desktop

github-actions[bot] commented 8 months ago

Hello @ZamDimon, thanks for the issue report! We are reviewing your report and will address it as soon as possible.