General ⇒ tabbing or font size
tabbing or font size
This question puzzles me a lot... I am trying to print something like that with indents on the left:
=INDEX(List,
.......SMALL(IF(MATCH(List,List,0)
..................=ROW(INDIRECT(”1:”&ROWS(List))),
................MATCH(List,List,0),
................””),
.......ROW(INDIRECT(”1:”&SUM(SIGN(MATCH(List,List,0)
....................................=ROW(INDIRECT(”1:”&ROWS(List)))))))))
(Please replace .... by blank)
With indents on the left, the levels of the functions are more visible. At the moment I use \begin{tabbing} , \end{tabbing} , \= , \> ... to realize that.
However, one problem is that the lines are too long, and they exceed the margin. I want to make the font smaller to fit the length of line, but it seems that {tabbing} can not do that...
So i guess, either i use something else than {tabbing} to realize indents or make the font smaller... But i do not know neither of these ways... Does anyone have any idea?
Thanks and regards
Tie
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
tabbing or font size
Code: Select all
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[includeheadfoot,margin=2cm]{geometry}
\usepackage[svgnames]{xcolor}
\usepackage{listings}
\usepackage{lmodern}
\lstset{
aboveskip=1ex,
backgroundcolor=\color{gray!25},
basicstyle=\small\ttfamily,
belowskip=1ex,
breaklines=true,
columns=fullflexible,
framerule=0pt,
framexrightmargin=0em,
framexleftmargin=0em,
numbers=left,
numberstyle=\footnotesize\sffamily,
tabsize=2
}
\begin{document}
\begin{lstlisting}
=INDEX(List,
SMALL(IF(MATCH(List,List,0)
=ROW(INDIRECT("1:"&ROWS(List))),
MATCH(List,List,0),
""),
ROW(INDIRECT("1:"&SUM(SIGN(MATCH(List,List,0)
=ROW(INDIRECT("1:"&ROWS(List)))))))))
\end{lstlisting}
\end{document}
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: tabbing or font size
Thanks very much for your code!
I have already made your code run inside my code, and i see the interest of using listings. However, the "intend" does not work 100% yet.
When I set "showspaces=true, tabsize=1", the printed output is exactly intended as my code, which is good; However, if I set "showspaces=false, tabsize=1", the position of each line changes a little bit.
Obviously I do not want to show spaces finally, do you see how to do to make printed lines intended as the code?
Thanks and regards
Tie CHENG
tabbing or font size
keepspaces=true,
Regards
Tie CHENG