Questions tagged [code-review]

{code-review} asks for a review or possible improvement of the code used to create some output (typically a {diagram} or some structured format like a {title-page}).

Filter by
Sorted by
Tagged with
1 vote
1 answer
267 views

easyreview package : setreviewsoff not working

I have been working on a personal template for preparing my papers in case some journal don't have one. In the way, I found the easyReview package and the commands \setreviewsoff or \setreviewson ...
user avatar
1 vote
1 answer
31 views

Looking for a better layout or style in writing solutions of equations

Before I proceed to write a lot of solutions, I want to adopt a style that I will use consistently in my document. So far I write a solution of an equation as follows. Could you review this ? Any ...
user avatar
0 votes
1 answer
76 views

Is this a good way to change \section in document using luacode? Or could this be done using plain Latex macro?

I wanted to do simple thing. Change each \section to \cprotect\section in the whole document. I could not figure out how to do it using latex macro. So I used lua I'd like to ask if you think this ...
user avatar
  • 18k
4 votes
1 answer
179 views

Newspaper layout

This is the template for my school newspaper that I maintain. It contains bits and pieces from everywhere (we all need to start start somewhere). I am aware that there are probably a lot that I can ...
user avatar
1 vote
1 answer
114 views

How can I nicely format my form in LaTeX?

I am in need for a little authorization form and decided that this is great opportunity to use LaTeX. Here is what I have so far (minimized, translated to English—not the actual form of course): \...
user avatar
  • 585
1 vote
0 answers
56 views

Code review for a self created .sty file

I will start to write my masterthesis in the next weeks with LaTeX. I have build my own .sty and integrated it into my document. Everything works fine and it looks like it should but it would be great ...
user avatar
  • 608
6 votes
1 answer
213 views

Make tikzpicture take remaining space of page

I am trying to place three rectangles on a page using tikz with these equirements The two first boxes should have an height of 3.5 (as in my code) The remaining box should take the remaining space of ...
user avatar
12 votes
4 answers
4k views

Draw a checker pattern with a black X in the center

I am trying to recreate the following image in TikZ Using some old code I was able to produce the following result While I was able to produce the correct result, I feel that my solution was a bit ...
user avatar
2 votes
0 answers
117 views

tikz animation on beamer slide - centering and improvements

The code below animates 4 simple, nearly identical, processes, maybe familiar to many of you. Each time it adds the completed picture to the list at the top. My main issue is centering - I am having ...
user avatar
  • 209
4 votes
2 answers
257 views

How to show a point name?

The circle Mixtilinear. \documentclass[12pt,a4paper]{article} \usepackage{amsmath,amssymb,newcent} \usepackage{pstricks} % required package \usepackage{pst-node,pst-func,pst-plot,pst-eucl,pstricks-...
user avatar
2 votes
2 answers
91 views

What is the recommended method to have an image lie side by side with a list?

What I am doing below should suffice but I invite any other better ways. Is there any other better ones? \documentclass[preview,border=12pt,12pt]{standalone} \usepackage{enumitem,graphicx} \begin{...
user avatar
5 votes
1 answer
2k views

Circuit diagram with tikz

Hi I am trying to draw the following circuit: using Tikz package in Latex. The following is my code \begin{figure}[t] \begin{center} \ctikzset{bipoles/length=1cm} \begin{...
user avatar
  • 251
5 votes
1 answer
302 views

Improvements for conveyor belt in TikZ

Consider the following MWE: \documentclass[border=5pt,tikz]{standalone} \begin{document} \foreach \n in {0,-10,...,-720} { \begin{tikzpicture} \useasboundingbox (-3,-3) ...
user avatar
  • 5,165
6 votes
1 answer
291 views

How can a node remember it's previous position?

Consider the following MWE: \documentclass[border=5pt,tikz]{standalone} \begin{document} \foreach \n in {2,3,...,20} { \begin{tikzpicture} \useasboundingbox (-6,-4) rectangle (2,1); ...
user avatar
  • 5,165
2 votes
0 answers
321 views

Improvements for Lissajous curve

I was working on following MWE: \documentclass[border=5pt,tikz]{standalone} \usepackage{bookman} \usetikzlibrary{backgrounds} \tikzset{ io/.style={ fill=black,circle,inner sep=.5pt }, ...
user avatar
  • 5,165
2 votes
1 answer
98 views

How to rewrite the looping below with nested ifelse operators?

Could you rewrite the looping part just with nested PostScript ifelse operators? \documentclass[pstricks,border=1cm]{standalone} \makeatletter \def\scale{% \psline(100,0) \foreach \x in {0,...
user avatar
4 votes
1 answer
185 views

How can I change the number of iterations from 11 to 3?

The simplified example given below currently uses 11 iterations just for drawing at most 3 stems (vertical segments). It seems that my code is not efficient enough so I want to reduce the number of ...
user avatar
1 vote
2 answers
782 views

TikZ Code Review Request: Arrow pointing to circle from inside through two points

The code at the bottom produces the correct drawing, shown below. The issue is that I don't think I drew it in the best way possible; in particular, I really don't like having to construct (X) or (Y) ...
user avatar
9 votes
2 answers
1k views

Temporarily changing catcode of %

Scenario I have a bunch of TeX files which may be processed by an external filter. The filter is (unfortunately) immutable: it does a string replacement where, for example, %d is expanded to a ...
user avatar
  • 19.7k
28 votes
3 answers
2k views

Make fireworks with only text

For the holidays, I wanted to follow up to the question about making fireworks with tikz (How can we display fireworks?): How can we make fireworks with only text? I have made a crude attempt below. ...
user avatar
  • 11.8k
8 votes
3 answers
306 views

Code review: Tables on a page

In a document I am working on, I am trying to group four tables on a single page. However, it seems I still have not one, but multiple issues with my understanding of how tables work... I tried to ...
user avatar
  • 7,527
6 votes
2 answers
2k views

Better idiomatic way to print a centered "starlet" (asterisk)?

I need to print what the publisher calls "a starlet" (asterisk). I devised the code below, but I am not sure if it is a sound code, i.e., it won't cause problems later on, within other commands and ...
user avatar
  • 659
4 votes
3 answers
382 views

Like to know how my code can be improved!

I would like to know better way of accomplishing the following figure than the code I used. I'm used to for loops, but not to LaTeX loops! THE CODE \documentclass[a4paper,11pt,x11names,svgnames]{...
user avatar
  • 333
2 votes
1 answer
185 views

How to iterate a list of colors with two additional counters more elegantly?

A part of my code (especially iterating a list of colors with 2 additional counters) below does not seem straightforward. \documentclass[pstricks,border=12pt,dvipsnames]{standalone} \usepackage{pst-...
user avatar
8 votes
1 answer
8k views

Which one should I use to annotate equations? \tag or \text?

I am still confused in selecting whether to use \text or \tag for annotating equations. Which one should I use? If it is about personal preference, what is the pros and cons between them? \...
user avatar
10 votes
3 answers
1k views

TikZ: How can I write my code more concisely?

I am learning how to use TikZ and want to learn ways to write more concise TikZ code. I feel I use many more lines than others may need to achieve the same results. In particular, I want to learn a ...
user avatar
  • 17.9k
2 votes
1 answer
3k views

Need to remove blank page

I have a blank page in the middle of my document that I'm unsure how to remove. Beginning \documentclass{article} \usepackage[a6paper, top=1cm, bottom=1cm, left=1pt, right=1cm]{geometry} \...
user avatar
3 votes
1 answer
470 views

Building a flowchart with PSTricks

I am building several flow-charts similar to this. They represent a procedure (algorithm) for dividing a triangle. Right now, I use the following code: \newcommand{\thetriangle}{ \pspolygon[...
user avatar
14 votes
1 answer
3k views

Code improvement on a title page design

I am designing a new title page to post in the topic Showcase of beautiful title page done in TeX but am having some issues with the code I wrote. I don't like and I know it can be improved. In ...
user avatar
  • 27.6k
3 votes
1 answer
1k views

LaTeX Resume, Code Review for style and advice

I am using the code-review tag. I would like to get feedback on my Resume. I started out with another's CV, but I pared it back to almost nothing and expanded it in a totally different style. I would ...
user avatar
3 votes
1 answer
404 views

Improve ugly PSTricks code [closed]

Consider the following code: \documentclass{article} \usepackage{pstricks-add} \psset{unit = 0.47\psunit, fillstyle = solid} \begin{document} \begin{pspicture}(0.5,1)(25,12.7) \psframe(3,1)(10,10)...
user avatar
8 votes
1 answer
172 views

How to mimic LINQ's query method for macro's key-value?

Inspired by LINQ's query method, such as deck.Take(randomCount) .Where (card => card.Suit == "Hearts") .Skip(2) .Take(5) .OrderBy (card => card.FaceValue); The deck which is an ...
user avatar
5 votes
2 answers
186 views

How to buffer the extreme value of f(x) to draw a line representing a range of f(x)?

Please consider the following animation. \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-plot} \def\f{x^2-x-6} \psset{unit=3,algebraic} \def\Atom#1{% \begin{pspicture}(-1.5,-6.5)(2,-...
user avatar
3 votes
1 answer
412 views

Tikz - Thick line by overlapping rectangles - How to improve the diagram

I create my diagram with the following code. \documentclass{article} % \usepackage[ngerman]{babel} \usepackage{tikz} \usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,% ...
user avatar
  • 265
4 votes
4 answers
906 views

Improvement of PSTricks code for drawing of balls in a triangular box

Consider the following. Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{auto-pst-pdf,pst-eucl} \usepackage{expl3} \ExplSyntaxOn \cs_new_eq:NN \calc \fp_eval:n \...
user avatar
2 votes
1 answer
241 views

Improvement of PSTricks code for drawing of Pantheon

Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{ auto-pst-pdf, pst-eucl, pstricks-add } \usepackage[ locale=DE ]{siunitx} \begin{...
user avatar
3 votes
1 answer
158 views

Definition of PSTricks constant and improvement of code for drawing of Pantheon

Consider the following. Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{ auto-pst-pdf, pst-eucl, pstricks-add } \usepackage{siunitx} \begin{document} \begin{...
user avatar
1 vote
2 answers
380 views

Definition of PSTricks constant (again) and improvement of code

Consider the following example. (This is either the last one or the second to last.) Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{auto-pst-pdf,pstricks-add} \...
user avatar
7 votes
3 answers
1k views

Improve PSTricks code for drawing of the Olympic flag

Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{auto-pst-pdf,pstricks-add} \usepackage[locale=DE]{siunitx} \ExplSyntaxOn \cs_new_eq:NN ...
user avatar
9 votes
3 answers
880 views

Improve PSTricks code for drawing of a general, regular polygon

Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{auto-pst-pdf,pst-eucl,pst-poly,pstricks-add} \usepackage[locale=DE]{siunitx} \...
6 votes
2 answers
475 views

Improve PSTricks code for drawing of a football pitch

Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{auto-pst-pdf,pstricks-add} \usepackage{siunitx} \begin{document} % Paremeters \def\...
user avatar
11 votes
4 answers
504 views

Improve PSTricks code for drawing of a chest of drawers

Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{auto-pst-pdf,pstricks-add} \begin{document} \psset{unit=0.08cm} \begin{pspicture}(45,...
user avatar
5 votes
2 answers
311 views

Optimize (or improve, at least) PSTricks code for drawing a beehive

Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} \usepackage{ auto-pst-pdf, pst-eucl } \usepackage{siunitx} \begin{document} \begin{figure} \def\...
user avatar
10 votes
4 answers
746 views

How to improve my PSTricks code to construct a triangle diagram?

This question is similar to How to improve my PSTricks code to construct a triangle number diagram?. Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} ...
user avatar
7 votes
2 answers
324 views

How to improve my PSTricks code to construct a triangle number diagram?

This question is similar to How to improve my PSTricks code to construct a triangle diagram?. Consider the following example. Code % pdflatex -shell-escape test.tex \documentclass{article} \...
user avatar
6 votes
2 answers
329 views

Code improvement for PSTricks figure

Consider the following example. Code \documentclass{article} \usepackage{pstricks-add} \begin{document} \def\laengde{60 } \psset{unit=0.04} \begin{pspicture}(260,260) \pnode(0,0){P1} \pnode(!0 \...
user avatar
3 votes
0 answers
182 views

Optimizing tikz code for less redundancies [closed]

I don't use tikz very often. When I do, I'm usually pretty happy with the result (and with how useful that manual is). But I always think the code I produced to get there could be optimized, as in the ...
user avatar
  • 9,533