two-scoops-of-django-3.x icon indicating copy to clipboard operation
two-scoops-of-django-3.x copied to clipboard

Make the tables pretty

Open pydanny opened this issue 5 years ago • 9 comments

The tabu LaTeX package we used in the past is no longer working and no longer maintained. We need a new way to present our tables in an attractive fashion.

If you are an expert at LaTeX, we're interested in talking to you. We will pay for expert LaTeX help.

pydanny avatar May 11 '20 00:05 pydanny

Here is an example of a working table: 6.2 When to use null and blank by field Did you check all differences of broken and working tables? There are more, but stripping down this one and filling it with content of a broken table should reveal the issue.

kakulukia avatar May 17 '20 06:05 kakulukia

@kakulukia Are you an expert on LaTeX formatting or providing advice on debugging? Just curious, because we could really use the former.

pydanny avatar May 19 '20 19:05 pydanny

I worked with Latex once or twice, which ain't qualifying. But I saw some working tables and thus the chance of fixing the problem by spotting differences ist pretty high. I consider myself fairly good at that topic no matter the coding language. We could try to fix it together.

kakulukia avatar May 20 '20 05:05 kakulukia

Unfortunately, fixing the tables in Two Scoops of Django is going to require a lot more than the rubber duck debugging you are suggesting. I can't overstate the difficulty of this challenge. While we (me and Audrey) could do it ourselves, then we wouldn't be working on the material on the book for weeks.

So while I appreciate the offer, we're going to hire a LaTeX expert to get us past this hurdle.

pydanny avatar May 20 '20 16:05 pydanny

What our current code looks like:

\begin{table}[htp]
  \begin{tabularx}{\textwidth}{ |X|X|X| }    
	  \adjust Code & \adjust Import Type & \adjust Usage \\
	  % \texttt{\small from core.views import FoodMixin} & absolute import & Use when importing from outside the current app \\
    from core.views import FoodMixin & absolute import & Use when importing from outside the current app \\
	  \hline
	  % \texttt{\small from .models import WaffleCone} & explicit relative & Use when importing from another module in the current app \\
    from .models import WaffleCone & explicit relative & Use when importing from another module in the current app \\
	  \hline
	  % \texttt{\small from models import WaffleCone} & implicit relative & Often used when importing from another module in the current app, but not a good idea \\
    from models import WaffleCone & implicit relative & Often used when importing from another module in the current app, but not a good idea \\
    \hline
  \end{tabularx}
	\caption{Imports: Absolute vs. Explicit Relative vs. Implicit Relative}
	\label{tab:importstypes}  
\end{table}

pydanny avatar May 28 '20 19:05 pydanny

Would you be happy with something like this? tabla.pdf

quique avatar May 28 '20 20:05 quique

Update: Now that I actually look at the content, the "implicit relative" import is disallowed in Python 3 now.

I couldn't get the \adjust or \textwidth to work, so I deleted that part, but I think these kinds of tables look better:

$ cat lat.tex 
\documentclass{article}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{adjustbox}

\begin{document}

\begin{table}[htp]
  %\begin{tabularx}{\textwidth}{ |X|X|X| }    
  \begin{tabularx}{300pt}{ X X X }    
	   Code &  Import Type &  Usage \\
       \hline
	  % \texttt{\small from core.views import FoodMixin} & absolute import & Use when importing from outside the current app \\
    from core.views import FoodMixin & absolute import & Use when importing from outside the current app \\
	 % \hline
	  % \texttt{\small from .models import WaffleCone} & explicit relative & Use when importing from another module in the current app \\
    from .models import WaffleCone & explicit relative & Use when importing from another module in the current app \\
	 % \hline
	  % \texttt{\small from models import WaffleCone} & implicit relative & Often used when importing from another module in the current app, but not a good idea \\
    from models import WaffleCone & implicit relative & Often used when importing from another module in the current app, but not a good idea \\
    %\hline
  \end{tabularx}
	\caption{Imports: Absolute vs. Explicit Relative vs. Implicit Relative}
	\label{tab:importstypes}  
\end{table}

\end{document}
[lat.pdf](https://github.com/feldroy/two-scoops-of-django-3.x/files/4698728/lat.pdf)

lat.pdf

aaronchall avatar May 28 '20 23:05 aaronchall

Tufte Style?

pydanny avatar Jun 08 '20 18:06 pydanny

Black top style?

pydanny avatar Jun 08 '20 18:06 pydanny