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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- 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