Text Formattingvertical alignment about the question env of exsheets

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
inkmathematics
Posts: 3
Joined: Sat Aug 06, 2016 11:06 am

vertical alignment about the question env of exsheets

Post by inkmathematics »

Here is my code segment.How can I program to make there no text below the number 1?I want the question environment be vertical alignment with "这".Anyone can help me ? Thank you.

Code: Select all

\documentclass{article}
\usepackage{ctex}
\usepackage{exsheets}
\usepackage[showframe]{geometry}

\begin{document}

 \SetupExSheets{headings=runin-nr}

  \begin{question}
这个问题你能正确解答出来么?你能提供几种正确解答方法呢?这个问题你能正确解答出来么?你能提供几种正确解答方法呢?这个问题你能正确解答出来么?你能提供几种正确解答方法呢?
\end{question}
  
\end{document}
Last edited by cgnieder on Sat Aug 06, 2016 12:25 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: vertical alignment about the question env of exsheets

Post by Johannes_B »

Hi and welcome, i bet the issue also arises without cjk-stuff. It would be easier for the helpers to read and test, as no special fonts are needed. Can you check and update?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

vertical alignment about the question env of exsheets

Post by cgnieder »

Something like this?

Code: Select all

\documentclass{article}
\usepackage{exsheets}
\usepackage{scrextend}% provides the {addmargin} environment

\SetupExSheets{
  headings  = margin-nr ,
  question/pre-hook  = \addmargin[2em]{0pt} ,
  question/post-hook = \endaddmargin ,
  question/no-skip-below
}

\usepackage[showframe]{geometry}
\usepackage{lipsum}

\begin{document}

\lipsum[1]
\begin{question}
  \lipsum[2]
\end{question}
\begin{question}
  \lipsum[3]
\end{question}
\lipsum[4]

\end{document}
exsheets.png
exsheets.png (88.5 KiB) Viewed 5386 times
The {addmargin} environment takes a mandatory argument for left and right margin and an optional argument for setting a different left margin than on the right. The example above sets the additional margin to zero but adds a left margin of 2em and puts the question number in the margin.

Regards
site moderator & package author
inkmathematics
Posts: 3
Joined: Sat Aug 06, 2016 11:06 am

Re: vertical alignment about the question env of exsheets

Post by inkmathematics »

@cgnieder ,Thanks for your reply,Thoug your solution works well with English words ,it does not work well with Chinese words.Can you help me ?
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

vertical alignment about the question env of exsheets

Post by cgnieder »

inkmathematics wrote:@cgnieder ,Thanks for your reply,Thoug your solution works well with English words ,it does not work well with Chinese words.
What do you mean with “it does not work well”?

Code: Select all

\documentclass{article}
\usepackage{ctex}
\usepackage{exsheets}
\usepackage{scrextend}

\SetupExSheets{
  headings  = margin-nr ,
  question/pre-hook  = \addmargin[2em]{0pt} ,
  question/post-hook = \endaddmargin ,
  question/no-skip-below
}

\usepackage[showframe]{geometry}

\begin{document}

这个问题你能正确解答出来么?你能提供几种正确解答方法呢?这个问题你能正确解答出
来么?你能提供几种正确解答方法呢?这个问题你能正确解答出来么?你能提供几种正确
解答方法呢?
\begin{question}
  这个问题你能正确解答出来么?你能提供几种正确解答方法呢?这个问题你能正确解答
  出来么?你能提供几种正确解答方法呢?这个问题你能正确解答出来么?你能提供几种
  正确解答方法呢?
\end{question}
\begin{question}
  这个问题你能正确解答出来么?你能提供几种正确解答方法呢?这个问题你能正确解答
  出来么?你能提供几种正确解答方法呢?这个问题你能正确解答出来么?你能提供几种
  正确解答方法呢?
\end{question}
这个问题你能正确解答出来么?你能提供几种正确解答方法呢?这个问题你能正确解答出
来么?你能提供几种正确解答方法呢?这个问题你能正确解答出来么?你能提供几种正确
解答方法呢?

\end{document}
exsheets.png
exsheets.png (62.8 KiB) Viewed 5257 times
site moderator & package author
inkmathematics
Posts: 3
Joined: Sat Aug 06, 2016 11:06 am

Re: vertical alignment about the question env of exsheets

Post by inkmathematics »

@cgnieder Thank you very much.You solution has solved my question.
Post Reply