Open pydanny opened 4 years ago
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 Are you an expert on LaTeX formatting or providing advice on debugging? Just curious, because we could really use the former.
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.
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.
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}
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)
Tufte Style?
Black top style?
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.