## LaTeX forum ⇒ Text Formatting ⇒ Making Sense of Code Topic is solved

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
cgnieder
Site Moderator
Posts: 1974
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:

### Re: Making Sense of Code  Topic is solved

LaTexLearner wrote:What I meant about 3cm of space was 3cm of vertical space. Maybe this would have two horizontal rules all the way across or maybe not. Is that possible?

My suggestion would be to use \answerline macro only for usage in the current text flow. For bigger chunks that need some vertical space I'd suggest defining an environment. I'll post something later.

LaTexLearner wrote:Also, what is the "adapted proposal" you mentioned?

I meant this viewtopic.php?f=44&t=26667&sid=0c044fd412559bd4bd83853fd5c8d494#p91512 but it sounds like I misunderstood your question.
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

Tags:

Johannes_B
Site Moderator
Posts: 3587
Joined: Thu Nov 01, 2012 4:08 pm
Currently, the macro for an answer is meant for single words, not for paragraphs of text. I am not quite sure what you are trying to achieve? Maybe have a look at package exsheets, it is customizable and great for doing exam sheets and similar stuff.

\documentclass{article}\begin{document}Is there a question?\phantom{42}Really? Is there a question?42Really? \rule{0pt}{3cm} Hello? Anybody here? \vspace{4cm} Anybody? Where is everyone?\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

cgnieder
Site Moderator
Posts: 1974
Joined: Sat Apr 16, 2011 7:27 pm
Location: Germany
Contact:
Johannes_B wrote:I am not quite sure what you are trying to achieve?

This will become clear with a little history

LaTeXLearner asked a question over at TeX.se (actually using the exsheets package) and I gave an answer. In the comments he asked whether we could discuss the code so I suggested to do that here since a forum is much better suited for discussions.

Best
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

LaTexLearner
Posts: 138
Joined: Tue Mar 10, 2015 11:06 am
cgnieder wrote:
LaTexLearner wrote:What I meant about 3cm of space was 3cm of vertical space. Maybe this would have two horizontal rules all the way across or maybe not. Is that possible?

My suggestion would be to use \answerline macro only for usage in the current text flow. For bigger chunks that need some vertical space I'd suggest defining an environment. I'll post something later.

I think that I understand the majority of this thread well enough, with the exception of all the @ use which sounds pretty complicated.

I've started a new thread for longer answers. (I posted it on here; not sure if it should have gone on tex.stackexchange instead... this forum seems easier to use, though. )

Stefan Kottwitz
Posts: 8541
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
Hi,

LaTexLearner wrote:not sure if it should have gone on tex.stackexchange instead... this forum seems easier to use, though. )

I'm on tex.stackexchange too. But since a while I rarely post there. I like talking here in the LaTeX Community forum, it feels more free to me and I feel relaxed here, not so on stackexchange with strict rules, often closing questions and such.

Stefan

LaTexLearner
Posts: 138
Joined: Tue Mar 10, 2015 11:06 am
cgnieder wrote:
LaTexLearner wrote:Also, is there any way to set the answer space so that the default length is, say, 2cm, but there is an optional argument to make it longer?

One possibility: change the definition of \answerline like this:
\newcommand\answerline[2][\answerspace]{%   \begingroup     \ifdim#1=\answerspace     \else       \setlength\answerspace{#1}%     \fi     \ifmmode       \answerline@math{#2}%     \else       \answerline@text{#2}%     \fi   \endgroup}

I'm trying to adjust this code so that if there is a sequence of fill-in-the-blank exercises, the first one is an example, i.e. already filled in regardless of the setting of \SetupExSheets{...}.

I tried the code below, but it did not seem to work. I also imagine there is a more elegant way to begin the code instead of using #1 twice in the first line.

The goal was to have it make this macro \exampleline[optional length]{filled in text}
